rompy.swan.subcomponents.boundary.SEGMENT#

pydantic model rompy.swan.subcomponents.boundary.SEGMENT[source]#

Boundary over a segment defined from points.

SEGMENT XY < [x] [y] >
SEGMENT IJ < [i] [j] >

The segment is defined either by means of a series of points in terms of problem coordinates (XY) or by means of a series of points in terms of grid indices (IJ). The points do not have to include all or coincide with actual grid points.

Examples

In [259]: from rompy.swan.subcomponents.boundary import SEGMENT

In [260]: seg = SEGMENT(
   .....:     points=dict(
   .....:         model_type="xy",
   .....:         x=[172, 172, 172, 172.5, 173],
   .....:         y=[-41, -40.5, -40, -40, -40],
   .....:         fmt="0.2f",
   .....:     ),
   .....: )
   .....: 

In [261]: print(seg.render())
SEGMENT XY 
172.00 -41.00
172.00 -40.50
172.00 -40.00
172.50 -40.00
173.00 -40.00


In [262]: seg = SEGMENT(
   .....:     points=dict(
   .....:         model_type="ij",
   .....:         i=[0, 0, 5],
   .....:         j=[0, 19, 19],
   .....:     ),
   .....: )
   .....: 

In [263]: print(seg.render())
SEGMENT IJ 
i=0 j=0
i=0 j=19
i=5 j=19
Fields:
field model_type: Literal['segment', 'SEGMENT'] = 'segment'#

Model type discriminator

field points: XY | IJ [Required]#

Points to define the segment

cmd() str[source]#