rompy.core.spectrum.LogFrequency#

pydantic model rompy.core.spectrum.LogFrequency[source]#

Logarithmic wave frequencies.

Frequencies are defined according to:

\(f_{i+1} = \gamma * f_{i}\)

Note

The number of frequency bins nbin is always kept unchanged when provided. This implies other parameters may be adjusted so nbin bins can be defined. Specify f0, f1 and finc and let nbin be calculated to avoid those values changing.

Note

Choose finc=0.1 for a 10% increment between frequencies that satisfies the DIA.

Examples

In [1]: from rompy.core.spectrum import LogFrequency

In [2]: LogFrequency(f0=0.04, f1=1.0, nbin=34)
Out[2]: LogFrequency(model_type='log', f0=np.float64(0.04), f1=np.float64(1.0), finc=np.float64(0.0992991258103799), nbin=34)

In [3]: LogFrequency(f0=0.04, f1=1.0, finc=0.1)
Out[3]: LogFrequency(model_type='log', f0=np.float64(0.04), f1=np.float64(1.0), finc=np.float64(0.0992991258103799), nbin=34)

In [4]: LogFrequency(f0=0.04, nbin=34, finc=0.1)
Out[4]: LogFrequency(model_type='log', f0=np.float64(0.04), f1=np.float64(1.0219067944750664), finc=np.float64(0.1000000000000006), nbin=34)

In [5]: LogFrequency(f1=1.0, nbin=34, finc=0.1)
Out[5]: LogFrequency(model_type='log', f0=np.float64(0.03914251301220403), f1=np.float64(1.0), finc=np.float64(0.10000000000000035), nbin=34)

Show JSON schema
{
   "title": "LogFrequency",
   "description": "Logarithmic wave frequencies.\n\nFrequencies are defined according to:\n\n:math:`f_{i+1} = \\gamma * f_{i}`\n\nNote\n----\nThe number of frequency bins `nbin` is always kept unchanged when provided. This\nimplies other parameters may be adjusted so `nbin` bins can be defined. Specify\n`f0`, `f1` and `finc` and let `nbin` be calculated to avoid those values changing.\n\nNote\n----\nChoose `finc=0.1` for a 10% increment between frequencies that satisfies the DIA.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.core.spectrum import LogFrequency\n\n    LogFrequency(f0=0.04, f1=1.0, nbin=34)\n    LogFrequency(f0=0.04, f1=1.0, finc=0.1)\n    LogFrequency(f0=0.04, nbin=34, finc=0.1)\n    LogFrequency(f1=1.0, nbin=34, finc=0.1)",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "log",
         "description": "Model type discriminator",
         "enum": [
            "log",
            "LOG"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "f0": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Lower frequency boundary (Hz)",
         "title": "F0"
      },
      "f1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Upper frequency boundary (Hz)",
         "title": "F1"
      },
      "finc": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Log frequency increment",
         "title": "Finc"
      },
      "nbin": {
         "anyOf": [
            {
               "exclusiveMinimum": 0,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of frequency bins, one less the size of frequency array",
         "title": "Nbin"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field f0: float | None = None#

Lower frequency boundary (Hz)

Constraints:
  • gt = 0.0

Validated by:
field f1: float | None = None#

Upper frequency boundary (Hz)

Validated by:
field finc: float | None = None#

Log frequency increment

Constraints:
  • gt = 0.0

Validated by:
field model_type: Literal['log', 'LOG'] = 'log'#

Model type discriminator

Validated by:
field nbin: int | None = None#

Number of frequency bins, one less the size of frequency array

Constraints:
  • gt = 0

Validated by:
validator init_options  »  all fields[source]#

Set the missing frequency parameters.

property flen#
property gamma#
property nf#