pyiem.models package¶
Submodules¶
pyiem.models.cwa module¶
Data Model for CWA.
- class pyiem.models.cwa.CWAModel(*, center: str, expire: datetime, geom: Polygon, issue: datetime, is_corrected: bool, narrative: str, num: int)¶
Bases:
BaseModel
A Center Weather Advisory.
- center: str¶
- expire: datetime¶
- geom: Polygon¶
- is_corrected: bool¶
- issue: datetime¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- narrative: str¶
- num: int¶
pyiem.models.gairmet module¶
Data Model for GAIRMET.
- class pyiem.models.gairmet.AIRMETRecord(*, gml_id: str, label: str, status: str, hazard_type: str, valid_at: datetime, weather_conditions: List[str], geom: Polygon)¶
Bases:
BaseModel
A single AIRMET Record.
- geom: Polygon¶
- gml_id: str¶
- hazard_type: str¶
- label: str¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- status: str¶
- valid_at: datetime¶
- weather_conditions: List[str]¶
- class pyiem.models.gairmet.FreezingLevelRecord(*, gml_id: str, valid_at: datetime, geom: MultiLineString, level: int | None = None, lower_level: int, upper_level: int)¶
Bases:
BaseModel
A single FreezingLevel Record.
- geom: MultiLineString¶
- gml_id: str¶
- level: int | None¶
- lower_level: int¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- upper_level: int¶
- valid_at: datetime¶
- class pyiem.models.gairmet.GAIRMETModel(*, valid_from: datetime, valid_to: datetime, issuetime: datetime, airmets: List[AIRMETRecord] = [], freezing_levels: List[FreezingLevelRecord] = [])¶
Bases:
BaseModel
A G-AIRMET.
- airmets: List[AIRMETRecord]¶
- freezing_levels: List[FreezingLevelRecord]¶
- issuetime: datetime¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- valid_from: datetime¶
- valid_to: datetime¶
pyiem.models.sel module¶
Pydantic data model for SPC Watch (SEL).
pyiem.models.shef module¶
SHEF Data Model.
- class pyiem.models.shef.SHEFElement(*, station: str, basevalid: datetime, valid: datetime, dv_interval: timedelta | None = None, physical_element: str = None, duration: str = None, type: str = 'R', source: str = 'Z', extremum: str = 'Z', probability: str = 'Z', str_value: str = '', num_value: float = None, data_created: datetime = None, depth: Annotated[int, Ge(ge=0), Le(le=32767)] = None, unit_convention: str = 'E', qualifier: str = None, comment: str = None, narrative: str = None, raw: str = None)¶
Bases:
BaseModel
A PEDTSEP Element.
- basevalid: datetime¶
- comment: str¶
- consume_code(text)¶
Fill out element based on provided text.
- data_created: datetime¶
- depth: int¶
- duration: str¶
- dv_interval: timedelta | None¶
- extremum: str¶
- lonlat()¶
For ‘Stranger Locations’, return longitude and latitude.
- model_config: ClassVar[ConfigDict] = {'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- narrative: str¶
- num_value: float¶
- physical_element: str¶
- probability: str¶
- qualifier: str¶
- raw: str¶
- source: str¶
- station: str¶
- str_value: str¶
- to_english() float ¶
Return an English value representation.
Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value.
- type: str¶
- unit_convention: str¶
- valid: datetime¶
- varname() str ¶
Return the Full SHEF Code.
pyiem.models.taf module¶
TAF Data Model.
- class pyiem.models.taf.SkyCondition(*, amount: str, level: Annotated[int | None, Ge(ge=0), Le(le=100000)] = None)¶
Bases:
BaseModel
The Sky condition.
- amount: str¶
- level: int | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pyiem.models.taf.TAFForecast(*, valid: datetime, raw: str, istempo: bool = False, end_valid: datetime = None, sknt: Annotated[int, Ge(ge=0), Le(le=199)] = None, drct: Annotated[int, Ge(ge=0), Le(le=360)] = None, gust: Annotated[int, Ge(ge=0), Le(le=199)] = None, visibility: Annotated[float, Ge(ge=0), Le(le=6)] = None, presentwx: List[str] = [], sky: List[SkyCondition] = [], shear: WindShear = None)¶
Bases:
BaseModel
A TAF forecast.
- drct: int¶
- end_valid: datetime¶
- gust: int¶
- istempo: bool¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- presentwx: List[str]¶
- raw: str¶
- sknt: int¶
- sky: List[SkyCondition]¶
- valid: datetime¶
- visibility: float¶
- class pyiem.models.taf.TAFReport(*, station: Annotated[str, MinLen(min_length=4), MaxLen(max_length=4)], valid: datetime, product_id: Annotated[str, MinLen(min_length=28), MaxLen(max_length=35)], observation: TAFForecast, forecasts: List[TAFForecast] = [])¶
Bases:
BaseModel
A TAF Report consisting of forecasts.
- forecasts: List[TAFForecast]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- observation: TAFForecast¶
- product_id: str¶
- station: str¶
- valid: datetime¶
- class pyiem.models.taf.WindShear(*, level: Annotated[int, Ge(ge=0), Le(le=100000)], drct: Annotated[int, Ge(ge=0), Le(le=360)], sknt: Annotated[int, Ge(ge=0), Le(le=199)])¶
Bases:
BaseModel
A Wind Shear Value.
- drct: int¶
- level: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- sknt: int¶
pyiem.models.wwp module¶
Pydantic data model for SPC Watch Probabilities (WWP).
- class pyiem.models.wwp.WWPModel(*, typ: str, num: int, tornadoes_2m: int = None, tornadoes_1m_strong: int = None, wind_10m: int = None, wind_1m_65kt: int = None, hail_10m: int = None, hail_1m_2inch: int = None, hail_wind_6m: int = None, max_hail_size: float = None, max_wind_gust_knots: int = None, max_tops_feet: int = None, storm_motion_drct: int = None, storm_motion_sknt: int = None, is_pds: bool)¶
Bases:
BaseModel
SPC Watch Probability.
- hail_10m: int¶
- hail_1m_2inch: int¶
- hail_wind_6m: int¶
- is_pds: bool¶
- max_hail_size: float¶
- max_tops_feet: int¶
- max_wind_gust_knots: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- num: int¶
- storm_motion_drct: int¶
- storm_motion_sknt: int¶
- tornadoes_1m_strong: int¶
- tornadoes_2m: int¶
- typ: str¶
- wind_10m: int¶
- wind_1m_65kt: int¶
Module contents¶
pyiem data models.