rompy.swan.components.startup.COORDINATES#

pydantic model rompy.swan.components.startup.COORDINATES[source]#

SWAN Coordinates.

COORDINATES ->CARTESIAN|SPHERICAL REPEATING

Command to choose between Cartesian and spherical coordinates (see Section 2.5). A nested SWAN run must use the same coordinate system as the coarse grid SWAN run.

Examples

In [215]: from rompy.swan.components.startup import COORDINATES

In [216]: coords = COORDINATES()

In [217]: print(coords.render())
COORDINATES CARTESIAN

In [218]: coords = COORDINATES(
   .....:     kind=dict(model_type="spherical", projection="ccm"),
   .....:     reapeating=True,
   .....: )
   .....: 

In [219]: print(coords.render())
COORDINATES SPHERICAL CCM REPEATING

Show JSON schema
{
   "title": "COORDINATES",
   "description": "SWAN Coordinates.\n\n.. code-block:: text\n\n    COORDINATES ->CARTESIAN|SPHERICAL REPEATING\n\nCommand to choose between Cartesian and spherical coordinates (see Section 2.5).\nA nested SWAN run must use the same coordinate system as the coarse grid SWAN run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import COORDINATES\n    coords = COORDINATES()\n    print(coords.render())\n    coords = COORDINATES(\n        kind=dict(model_type=\"spherical\", projection=\"ccm\"),\n        reapeating=True,\n    )\n    print(coords.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "coordinates",
         "description": "Model type discriminator",
         "enum": [
            "coordinates",
            "COORDINATES"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "kind": {
         "anyOf": [
            {
               "$ref": "#/$defs/CARTESIAN"
            },
            {
               "$ref": "#/$defs/SPHERICAL"
            }
         ],
         "description": "Coordinates kind",
         "title": "Kind"
      },
      "reapeating": {
         "default": false,
         "description": "This option is only for academic cases. It means that wave energy leaving at one end of the domain (in computational x-direction) enter at the other side; it is as if the wave field repeats itself in x-direction with the length of the domain in x-direction. This option cannot be used in combination with computation of set-up (see command SETUP). This option is available only with regular grids",
         "title": "Reapeating",
         "type": "boolean"
      }
   },
   "$defs": {
      "CARTESIAN": {
         "additionalProperties": false,
         "description": "Cartesian coordinates.\n\n.. code-block:: text\n\n    CARTESIAN\n\nAll locations and distances are in m. Coordinates are given with respect\nto x- and y-axes chosen by the user in the various commands.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import CARTESIAN\n    coords = CARTESIAN()\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "cartesian",
               "description": "Model type discriminator",
               "enum": [
                  "cartesian",
                  "CARTESIAN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "CARTESIAN",
         "type": "object"
      },
      "SPHERICAL": {
         "additionalProperties": false,
         "description": "Spherical coordinates.\n\n.. code-block:: text\n\n    SPHERICAL [->CCM|QC]\n\nNotes\n-----\n\nprojection options:\n\n* CCM: central conformal Mercator. The horizontal and vertical scales are\n  uniform in terms of cm/degree over the area shown. In the centre of the scale\n  is identical to that of the conventional Mercator projection (but only at\n  that centre). The area in the projection centre is therefore exactly conformal.\n* QC: the projection method is quasi-cartesian, i.e. the horizontal and vertical\n  scales are equal to one another in terms of cm/degree.\n\nAll coordinates of locations and geographical grid sizes are given in degrees;`x`\nis longitude with `x = 0` being the Greenwich meridian and `x > 0` is East of this\nmeridian; `y` is latitude with `y > 0` being the Northern hemisphere. Input and\noutput grids have to be oriented with their x-axis to the East; mesh sizes are in\ndegrees. All other distances are in meters.\n\nNote that spherical coordinates can also be used for relatively small areas, say 10\nor 20 km horizontal dimension. This may be useful if one obtains the boundary\nconditions by nesting in an oceanic model which is naturally formulated in\nspherical coordinates. Note that in case of spherical coordinates regular grids\nmust always be oriented E-W, N-S, i.e. `alpc=0`, `alpinp=0`, `alpfr=0`\n(see commands CGRID, INPUT GRID and FRAME, respectively).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SPHERICAL\n    coords = SPHERICAL()\n    print(coords.render())\n    coords = SPHERICAL(projection=\"qc\")\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "spherical",
               "description": "Model type discriminator",
               "enum": [
                  "spherical",
                  "SPHERICAL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "projection": {
               "default": "ccm",
               "description": "Defines the projection method in case of spherical coordinates, `ccm` Central Conformal Mercator, `qc` means Quasi-cartesian",
               "enum": [
                  "ccm",
                  "qc"
               ],
               "title": "Projection",
               "type": "string"
            }
         },
         "title": "SPHERICAL",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field kind: CARTESIAN | SPHERICAL [Optional]#

Coordinates kind

field model_type: Literal['coordinates', 'COORDINATES'] = 'coordinates'#

Model type discriminator

field reapeating: bool = False#

This option is only for academic cases. It means that wave energy leaving at one end of the domain (in computational x-direction) enter at the other side; it is as if the wave field repeats itself in x-direction with the length of the domain in x-direction. This option cannot be used in combination with computation of set-up (see command SETUP). This option is available only with regular grids

cmd() str[source]#

Return the string or list of strings to render the component to the CMD.