Spectra¶
Frequency definitions for spectral wave models.
Frequency
pydantic-model
¶
Frequency(**data: Any)
Bases: RompyBaseModel
Wave frequency.
Fields:
-
model_type(Literal['frequency', 'FREQUENCY']) -
freq(list[float])
LogFrequency
pydantic-model
¶
LogFrequency(**data: Any)
Bases: RompyBaseModel
Logarithmic wave frequencies.
Frequencies are defined according to f(i+1) = γ · 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:
from rompy.core.spectrum import LogFrequency
print(LogFrequency(f0=0.04, f1=1.0, nbin=34))
print(LogFrequency(f0=0.04, f1=1.0, finc=0.1))
print(LogFrequency(f0=0.04, nbin=34, finc=0.1))
print(LogFrequency(f1=1.0, nbin=34, finc=0.1))
LogFrequency:
model_type: log
f0: 0.04
f1: 1.0
finc: 0.0992991258103799
nbin: 34
LogFrequency:
model_type: log
f0: 0.04
f1: 1.0
finc: 0.0992991258103799
nbin: 34
LogFrequency:
model_type: log
f0: 0.04
f1: 1.0219067944750664
finc: 0.1000000000000006
nbin: 34
LogFrequency:
model_type: log
f0: 0.03914251301220403
f1: 1.0
finc: 0.10000000000000035
nbin: 34
Fields:
-
model_type(Literal['log', 'LOG']) -
f0(Optional[float]) -
f1(Optional[float]) -
finc(Optional[float]) -
nbin(Optional[int])
Validators:
nbin
pydantic-field
¶
Number of frequency bins, one less the size of frequency array
init_options
pydantic-validator
¶
init_options() -> LogFrequency
Set the missing frequency parameters.
check_for_typos
classmethod
¶
Suggest the closest field name for an unknown input key.
A field can be given by its name or, like in pydantic, by its alias.