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)
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#