rompy.swan.components.output.RAY#
- pydantic model rompy.swan.components.output.RAY[source]#
Output locations along a depth contour.
RAY 'rname' [xp1] [yp1] [xq1] [yq1] < [int] [xp] [yp] [xq] [yq] >
With this optional command the user provides SWAN with information to determine output locations along the depth contour line(s) defined subsequently in command ISOLINE (see below).
These locations are determined by SWAN as the intersections of the depth contour line(s) and the set of straight rays defined in this command RAY. These rays are characterized by a set of master rays defined by their start and end positions (xp,`yp`) and (xq,`yq`). Between each pair of sequential master rays thus defined SWAN generates int-1 intermediate rays by linear interpolation of the start and end positions.
Rays defined by this component have nothing in common with wave rays (e.g. as obtained from conventional refraction computations).
Note
Cannot be used in 1D-mode.
Note
All coordinates and distances should be given in m when Cartesian coordinates are used or degrees when Spherical coordinates are used (see command COORD).
Note
When using rays the input grid for bottom and water level should not be curvilinear.
Examples
In [1]: from rompy.swan.components.output import RAY In [2]: loc = RAY( ...: rname="outray", ...: xp1=171.9, ...: yp1=-40.1, ...: xq1=172.1, ...: yq1=-39.9, ...: npts=[3, 3], ...: xp=[171.9, 173.9], ...: yp=[-38.1, -38.1], ...: xq=[172.1, 174.1], ...: yq=[-37.9, -37.9], ...: ) ...: In [3]: print(loc.render()) RAY rname='outray' xp1=171.9 yp1=-40.1 xq1=172.1 yq1=-39.9 & int=3 xp=171.9 yp=-38.1 xq=172.1 yq=-37.9 & int=3 xp=173.9 yp=-38.1 xq=174.1 yq=-37.9
Show JSON schema
{ "title": "RAY", "description": "Output locations along a depth contour.\n\n.. code-block:: text\n\n RAY 'rname' [xp1] [yp1] [xq1] [yq1] < [int] [xp] [yp] [xq] [yq] >\n\nWith this optional command the user provides SWAN with information to determine\noutput locations along the depth contour line(s) defined subsequently in command\n`ISOLINE` (see below).\n\nThese locations are determined by SWAN as the intersections of the depth contour\nline(s) and the set of straight rays defined in this command RAY. These rays are\ncharacterized by a set of master rays defined by their start and end positions\n(`xp`,`yp`) and (`xq`,`yq`). Between each pair of sequential master rays thus\ndefined SWAN generates `int-1` intermediate rays by linear interpolation of the\nstart and end positions.\n\nRays defined by this component have nothing in common with wave rays (e.g. as\nobtained from conventional refraction computations).\n\nNote\n----\nCannot be used in 1D-mode.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command `COORD`).\n\nNote\n----\nWhen using rays the input grid for bottom and water level should not be curvilinear.\n\nExamples\n--------\n\n.. ipython:: python\n :okwarning:\n\n from rompy.swan.components.output import RAY\n loc = RAY(\n rname=\"outray\",\n xp1=171.9,\n yp1=-40.1,\n xq1=172.1,\n yq1=-39.9,\n npts=[3, 3],\n xp=[171.9, 173.9],\n yp=[-38.1, -38.1],\n xq=[172.1, 174.1],\n yq=[-37.9, -37.9],\n )\n print(loc.render())", "type": "object", "properties": { "model_type": { "default": "ray", "description": "Model type discriminator", "enum": [ "ray", "RAY" ], "title": "Model Type", "type": "string" }, "rname": { "description": "Name of the set of rays defined by this command", "maxLength": 32, "title": "Rname", "type": "string" }, "xp1": { "description": "Problem coordinate of the begin point of the first master ray in the x-direction", "title": "Xp1", "type": "number" }, "yp1": { "description": "Problem coordinate of the begin point of the first master ray in the y-direction", "title": "Yp1", "type": "number" }, "xq1": { "description": "Problem coordinate of the end point of the first master ray in the x-direction", "title": "Xq1", "type": "number" }, "yq1": { "description": "Problem coordinate of the end point of the first master ray in the y-direction", "title": "Yq1", "type": "number" }, "npts": { "description": "The `int` RAY parameter, number of subdivisions between the previous master ray and the following master ray defined by the following data (number of subdivisions is one morethan the number of interpolated rays)", "items": { "type": "integer" }, "minItems": 1, "title": "Npts", "type": "array" }, "xp": { "description": "problem coordinates of the begin of each subsequent master ray in the x-direction", "items": { "type": "number" }, "minItems": 1, "title": "Xp", "type": "array" }, "yp": { "description": "problem coordinates of the begin of each subsequent master ray in the y-direction", "items": { "type": "number" }, "minItems": 1, "title": "Yp", "type": "array" }, "xq": { "description": "problem coordinates of the end of each subsequent master ray in the x-direction", "items": { "type": "number" }, "minItems": 1, "title": "Xq", "type": "array" }, "yq": { "description": "problem coordinates of the end of each subsequent master ray in the y-direction", "items": { "type": "number" }, "minItems": 1, "title": "Yq", "type": "array" } }, "additionalProperties": false, "required": [ "rname", "xp1", "yp1", "xq1", "yq1", "npts", "xp", "yp", "xq", "yq" ] }
- Fields:
- Validators:
ensure_equal_size
»all fields
- field model_type: Literal['ray', 'RAY'] = 'ray'#
Model type discriminator
- Validated by:
- field npts: list[int] [Required]#
The int RAY parameter, number of subdivisions between the previous master ray and the following master ray defined by the following data (number of subdivisions is one morethan the number of interpolated rays)
- Constraints:
min_length = 1
- Validated by:
- field rname: str [Required]#
Name of the set of rays defined by this command
- Constraints:
max_length = 32
- Validated by:
- field xp: list[float] [Required]#
problem coordinates of the begin of each subsequent master ray in the x-direction
- Constraints:
min_length = 1
- Validated by:
- field xp1: float [Required]#
Problem coordinate of the begin point of the first master ray in the x-direction
- Validated by:
- field xq: list[float] [Required]#
problem coordinates of the end of each subsequent master ray in the x-direction
- Constraints:
min_length = 1
- Validated by:
- field xq1: float [Required]#
Problem coordinate of the end point of the first master ray in the x-direction
- Validated by:
- field yp: list[float] [Required]#
problem coordinates of the begin of each subsequent master ray in the y-direction
- Constraints:
min_length = 1
- Validated by:
- field yp1: float [Required]#
Problem coordinate of the begin point of the first master ray in the y-direction
- Validated by:
- field yq: list[float] [Required]#
problem coordinates of the end of each subsequent master ray in the y-direction
- Constraints:
min_length = 1
- Validated by:
- field yq1: float [Required]#
Problem coordinate of the end point of the first master ray in the y-direction
- Validated by: