Station#
The Station holds all the data related to a single station. This includes:
observational data, stored as
SensorData,metadata, stored as a
Site,and timeseries of a model source, stored as
ModelTimeSeries.
Constructor#
|
Represents a weather station, holding metadata, sensor data, and model data. |
Data attributes#
A summary of all the attributes that hold or return data.
The name of the station. |
|
The Site instance of the station. |
|
The SensorData related to the station, as a dictionary. |
|
Station DataFrame constructor. |
|
Construct a DataFrame representation of metadata. |
|
Construct a DataFrame representation of all the outliers. |
|
Construct a DataFrame representation of all the gaps. |
|
Construct a DataFrame representation of all the present model data. |
|
Get a list of all the present observation types. |
|
Get the earliest start datetime from the observation data. |
|
Get the latest end datetime from the observation data. |
|
Retrieve the model data associated with the station. |
General methods and attributes#
|
Get the SensorData instance for a specific observation type. |
|
Add a new SensorData to the Station. |
|
Get the ModelTimeSeries instance for a specific observation type. |
|
Add a new ModelTimeSeries to the Station. |
|
Retrieve and optionally print detailed information about the station. |
|
Resample observation data to a specified frequency. |
Exporting and converting methods#
|
Save the station observations to a CSV file. |
|
Save the station observations to a parquet file. |
Merge all sensor and model data of a station into a single Dataset. |
|
|
Save the Station as a netCDF file. |
Visualisations#
|
Generate a time series plot of model data for a specific observation type. |
|
Generate a time series plot for observational data. |
Special methods#
The Station class implements several Python special methods for convenience:
__add__: Combine two Station objects, merging sensordata, site and modeltimeseries.__eq__: Test equality between two Station objects.__str__and__repr__: String representations for printing and debugging.copy: Create a (deep) copy of the Station.
Example usage:
from metobs_toolkit.dataset import Dataset
# Assume sta1 and sta2 are Station instances
sta_extend = sta1 + sta2 # Merge Stations
# Equality check
if sta1 == sta2:
print("Stations are equal")
# Copying
copy_of_1 = sta1.copy(deep=True)
# String representation
print(str(sta1))