rompy.swan.components.boundary.BOUNDSPEC#

pydantic model rompy.swan.components.boundary.BOUNDSPEC[source]#

Boundary along sides or segment.

BOUNDSPEC ->SIDE|SEGMENT CONSTANT|VARIABLE PAR|FILE

This command BOUNDSPEC defines parametric spectra at the boundary. It consists of two parts, the first part defines the boundary side or segment where the spectra will be given, the second part defines the spectral parameters of these spectra. Note that in fact only the incoming wave components of these spectra are used by SWAN. The fact that complete spectra are calculated at the model boundaries from the spectral parameters should not be misinterpreted. Only the incoming components are effective in the computation.

TODO: Add support for unstructured grid (k).

Examples

In [11]: from rompy.swan.components.boundary import BOUNDSPEC

In [12]: boundary = BOUNDSPEC(
   ....:     shapespec=dict(model_type="shapespec", shape=dict(model_type="pm")),
   ....:     location=dict(model_type="side", side="west", direction="ccw"),
   ....:     data=dict(model_type="constantpar", hs=2, per=8, dir=270, dd=30),
   ....: )
   ....: 

In [13]: print(boundary.render())
BOUND SHAPESPEC PM PEAK DSPR POWER
BOUNDSPEC SIDE WEST CCW CONSTANT PAR hs=2.0 per=8.0 dir=270.0 dd=30.0

In [14]: boundary = BOUNDSPEC(
   ....:     shapespec=dict(model_type="shapespec", shape=dict(model_type="pm")),
   ....:     location=dict(
   ....:         model_type="segment",
   ....:         points=dict(model_type="ij", i=[0, 0], j=[0, 3])
   ....:     ),
   ....:     data=dict(model_type="constantpar", hs=2, per=8, dir=270, dd=30),
   ....: )
   ....: 

In [15]: print(boundary.render())
BOUND SHAPESPEC PM PEAK DSPR POWER
BOUNDSPEC SEGMENT IJ  &
    i=0 j=0 &
    i=0 j=3 &
    CONSTANT PAR hs=2.0 per=8.0 dir=270.0 dd=30.0

Show JSON schema
{
   "title": "BOUNDSPEC",
   "description": "Boundary along sides or segment.\n\n.. code-block:: text\n\n    BOUNDSPEC ->SIDE|SEGMENT CONSTANT|VARIABLE PAR|FILE\n\nThis command BOUNDSPEC defines parametric spectra at the boundary. It consists of\ntwo parts, the first part defines the boundary side or segment where the spectra\nwill be given, the second part defines the spectral parameters of these spectra.\nNote that in fact only the incoming wave components of these spectra are used by\nSWAN. The fact that complete spectra are calculated at the model boundaries from\nthe spectral parameters should not be misinterpreted. Only the incoming components\nare effective in the computation.\n\nTODO: Add support for unstructured grid (k).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDSPEC\n    boundary = BOUNDSPEC(\n        shapespec=dict(model_type=\"shapespec\", shape=dict(model_type=\"pm\")),\n        location=dict(model_type=\"side\", side=\"west\", direction=\"ccw\"),\n        data=dict(model_type=\"constantpar\", hs=2, per=8, dir=270, dd=30),\n    )\n    print(boundary.render())\n    boundary = BOUNDSPEC(\n        shapespec=dict(model_type=\"shapespec\", shape=dict(model_type=\"pm\")),\n        location=dict(\n            model_type=\"segment\",\n            points=dict(model_type=\"ij\", i=[0, 0], j=[0, 3])\n        ),\n        data=dict(model_type=\"constantpar\", hs=2, per=8, dir=270, dd=30),\n    )\n    print(boundary.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundspec",
         "description": "Model type discriminator",
         "enum": [
            "boundspec",
            "BOUNDSPEC"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "shapespec": {
         "$ref": "#/$defs/SHAPESPEC",
         "description": "Spectral shape specification"
      },
      "location": {
         "anyOf": [
            {
               "$ref": "#/$defs/SIDE"
            },
            {
               "$ref": "#/$defs/SEGMENT"
            }
         ],
         "description": "Location to apply the boundary",
         "title": "Location"
      },
      "data": {
         "anyOf": [
            {
               "$ref": "#/$defs/CONSTANTPAR"
            },
            {
               "$ref": "#/$defs/CONSTANTFILE"
            },
            {
               "$ref": "#/$defs/VARIABLEPAR"
            },
            {
               "$ref": "#/$defs/VARIABLEFILE"
            }
         ],
         "description": "Spectral data",
         "title": "Data"
      }
   },
   "$defs": {
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "CONSTANTFILE": {
         "additionalProperties": false,
         "description": "Constant file specification.\n\n.. code-block:: text\n\n    CONSTANT FILE 'fname' [seq]\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTFILE\n    par = CONSTANTFILE(fname=\"tpar.txt\")\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "constantfile",
               "description": "Model type discriminator",
               "enum": [
                  "constantfile",
                  "CONSTANTFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the boundary condition.",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "seq": {
               "anyOf": [
                  {
                     "minimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case `seq` must always be 1",
               "title": "Seq"
            }
         },
         "required": [
            "fname"
         ],
         "title": "CONSTANTFILE",
         "type": "object"
      },
      "CONSTANTPAR": {
         "additionalProperties": false,
         "description": "Constant spectral parameters.\n\n.. code-block:: text\n\n    CONSTANT PAR [hs] [per] [dir] ([dd])\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTPAR\n    par = CONSTANTPAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "constantpar",
               "description": "Model type discriminator",
               "enum": [
                  "constantpar",
                  "CONSTANTPAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "exclusiveMinimum": 0.0,
               "title": "Hs",
               "type": "number"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
               "exclusiveMinimum": 0.0,
               "title": "Per",
               "type": "number"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degree), constant over frequencies",
               "maximum": 360.0,
               "minimum": -360.0,
               "title": "Dir",
               "type": "number"
            },
            "dd": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "title": "Dd"
            }
         },
         "required": [
            "hs",
            "per",
            "dir"
         ],
         "title": "CONSTANTPAR",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "IJ": {
         "additionalProperties": false,
         "description": "Points in grid indices coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import IJ\n    points = IJ(i=[0, 0, 5], j=[0, 19, 19])\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "ij",
               "description": "Model type discriminator",
               "enum": [
                  "ij",
                  "IJ"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "i": {
               "description": "i-index values",
               "items": {
                  "type": "integer"
               },
               "title": "I",
               "type": "array"
            },
            "j": {
               "description": "j-index values",
               "items": {
                  "type": "integer"
               },
               "title": "J",
               "type": "array"
            }
         },
         "required": [
            "i",
            "j"
         ],
         "title": "IJ",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "SEGMENT": {
         "additionalProperties": false,
         "description": "Boundary over a segment defined from points.\n\n.. code-block:: text\n\n    SEGMENT XY < [x] [y] >\n    SEGMENT IJ < [i] [j] >\n\nThe segment is defined either by means of a series of points in terms of problem\ncoordinates (`XY`) or by means of a series of points in terms of grid indices\n(`IJ`). The points do not have to include all or coincide with actual grid points.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SEGMENT\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"xy\",\n            x=[172, 172, 172, 172.5, 173],\n            y=[-41, -40.5, -40, -40, -40],\n            fmt=\"0.2f\",\n        ),\n    )\n    print(seg.render())\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"ij\",\n            i=[0, 0, 5],\n            j=[0, 19, 19],\n        ),\n    )\n    print(seg.render())",
         "properties": {
            "model_type": {
               "default": "segment",
               "description": "Model type discriminator",
               "enum": [
                  "segment",
                  "SEGMENT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "points": {
               "description": "Points to define the segment",
               "discriminator": {
                  "mapping": {
                     "IJ": "#/$defs/IJ",
                     "XY": "#/$defs/XY",
                     "ij": "#/$defs/IJ",
                     "xy": "#/$defs/XY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/XY"
                  },
                  {
                     "$ref": "#/$defs/IJ"
                  }
               ],
               "title": "Points"
            }
         },
         "required": [
            "points"
         ],
         "title": "SEGMENT",
         "type": "object"
      },
      "SHAPESPEC": {
         "additionalProperties": false,
         "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
         "properties": {
            "model_type": {
               "default": "shapespec",
               "description": "Model type discriminator",
               "enum": [
                  "shapespec",
                  "SHAPESPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shape": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/PM"
                  },
                  {
                     "$ref": "#/$defs/GAUSS"
                  },
                  {
                     "$ref": "#/$defs/BIN"
                  },
                  {
                     "$ref": "#/$defs/TMA"
                  }
               ],
               "description": "The spectral shape",
               "title": "Shape"
            },
            "per_type": {
               "default": "peak",
               "description": "The type of characteristic wave period",
               "enum": [
                  "peak",
                  "mean"
               ],
               "title": "Per Type",
               "type": "string"
            },
            "dspr_type": {
               "default": "power",
               "description": "The type of directional spreading",
               "enum": [
                  "power",
                  "degrees"
               ],
               "title": "Dspr Type",
               "type": "string"
            }
         },
         "title": "SHAPESPEC",
         "type": "object"
      },
      "SIDE": {
         "additionalProperties": false,
         "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
         "properties": {
            "model_type": {
               "default": "side",
               "description": "Model type discriminator",
               "enum": [
                  "side",
                  "SIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "side": {
               "description": "The side of the grid to apply the boundary to",
               "enum": [
                  "north",
                  "nw",
                  "west",
                  "sw",
                  "south",
                  "se",
                  "east",
                  "ne"
               ],
               "title": "Side",
               "type": "string"
            },
            "direction": {
               "default": "ccw",
               "description": "The direction to apply the boundary in",
               "enum": [
                  "ccw",
                  "clockwise"
               ],
               "title": "Direction",
               "type": "string"
            }
         },
         "required": [
            "side"
         ],
         "title": "SIDE",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      },
      "VARIABLEFILE": {
         "additionalProperties": false,
         "description": "Variable file specification.\n\n.. code-block:: text\n\n    VARIABLE FILE < [len] 'fname' [seq] >\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEFILE\n    par = VARIABLEFILE(\n        fname=[\"tpar1.txt\", \"tpar2.txt\", \"tpar3.txt\"],\n        len=[0.0, 0.5, 1.0],\n    )\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "variablefile",
               "description": "Model type discriminator",
               "enum": [
                  "variablefile",
                  "VARIABLEFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Names of the files containing the boundary condition",
               "items": {
                  "maxLength": 36,
                  "type": "string"
               },
               "title": "Fname",
               "type": "array"
            },
            "seq": {
               "anyOf": [
                  {
                     "items": {
                        "minimum": 1,
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case [seq] must always be 1.",
               "title": "Seq"
            },
            "len": {
               "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. [len] is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment.",
               "items": {
                  "minimum": 0,
                  "type": "number"
               },
               "title": "Len",
               "type": "array"
            }
         },
         "required": [
            "fname",
            "len"
         ],
         "title": "VARIABLEFILE",
         "type": "object"
      },
      "VARIABLEPAR": {
         "additionalProperties": false,
         "description": "Variable spectral parameter.\n\n.. code-block:: text\n\n    VARIABLE PAR < [len] [hs] [per] [dir] [dd] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEPAR\n    par = VARIABLEPAR(\n        hs=[1.5, 1.4, 1.1],\n        per=[8.1, 8.0, 8.1],\n        dir=[225, 226, 228],\n        dd=[25, 22, 23],\n        len=[0, 0.5, 1.0],\n    )\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "variablepar",
               "description": "Model type discriminator",
               "enum": [
                  "variablepar",
                  "VARIABLEPAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "items": {
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Hs",
               "type": "array"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE",
               "items": {
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Per",
               "type": "array"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degrees), constant over frequencies",
               "items": {
                  "maximum": 360.0,
                  "minimum": -360.0,
                  "type": "number"
               },
               "title": "Dir",
               "type": "array"
            },
            "dd": {
               "description": "Coefficient of directional spreading; a $cos^m(\u03b8)$ distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "items": {
                  "maximum": 360.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Dd",
               "type": "array"
            },
            "len": {
               "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. `len` is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment",
               "items": {
                  "minimum": 0,
                  "type": "number"
               },
               "title": "Len",
               "type": "array"
            }
         },
         "required": [
            "hs",
            "per",
            "dir",
            "dd",
            "len"
         ],
         "title": "VARIABLEPAR",
         "type": "object"
      },
      "XY": {
         "additionalProperties": false,
         "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "xy",
               "description": "Model type discriminator",
               "enum": [
                  "xy",
                  "XY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "x": {
               "description": "Problem x-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "X",
               "type": "array"
            },
            "y": {
               "description": "Problem y-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "Y",
               "type": "array"
            },
            "fmt": {
               "default": "0.8f",
               "description": "The format to render floats values",
               "title": "Fmt",
               "type": "string"
            }
         },
         "required": [
            "x",
            "y"
         ],
         "title": "XY",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "location",
      "data"
   ]
}

Fields:
field data: CONSTANTPAR | CONSTANTFILE | VARIABLEPAR | VARIABLEFILE [Required]#

Spectral data

field location: SIDE | SEGMENT [Required]#

Location to apply the boundary

field model_type: Literal['boundspec', 'BOUNDSPEC'] = 'boundspec'#

Model type discriminator

field shapespec: SHAPESPEC [Optional]#

Spectral shape specification

cmd() list[source]#

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