rompy.swan.subcomponents.boundary.CONSTANTFILE#

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

Constant file specification.

CONSTANT FILE 'fname' [seq]

There are three types of files:

  • TPAR files containing nonstationary wave parameters

  • files containing stationary or nonstationary 1D spectra (usually from measurements)

  • files containing stationary or nonstationary 2D spectra (from other computer programs or other SWAN runs)

A TPAR file is for only one location; it has the string TPAR on the first line of the file and a number of lines which each contain 5 numbers, i.e.: Time (ISO-notation), Hs, Period (average or peak period depending on the choice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian, depending on command SET), Directional spread (in degrees or as power of cos depending on the choice given in command BOUND SHAPE).

Note

Example of a TPAR file:

TPAR
19920516.130000 4.2 12. -110. 22.
19920516.180000 4.2 12. -110. 22.
19920517.000000 1.2 8. -110. 22.
19920517.120000 1.4 8.5 -80. 26
19920517.200000 0.9 6.5 -95. 28

Examples

In [241]: from rompy.swan.subcomponents.boundary import CONSTANTFILE

In [242]: par = CONSTANTFILE(fname="tpar.txt")

In [243]: print(par.render())
CONSTANT FILE fname='tpar.txt'

Show JSON schema
{
   "title": "CONSTANTFILE",
   "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())",
   "type": "object",
   "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"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname"
   ]
}

Fields:
field fname: str [Required]#

Name of the file containing the boundary condition.

Constraints:
  • max_length = 36

field model_type: Literal['constantfile', 'CONSTANTFILE'] = 'constantfile'#

Model type discriminator

field seq: int | None = None#

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

Constraints:
  • ge = 1

cmd() str[source]#

Render subcomponent cmd.