metobs_toolkit.station.Station#
- class Station(stationname: str, site: Site, all_sensor_data: list)[source]#
Represents a weather station, holding metadata, sensor data, and model data.
- Parameters:
stationname (str) – Name of the station.
site (Site) – Site instance containing metadata and location.
all_sensor_data (list) – List of SensorData instances for the station.
- __init__(stationname: str, site: Site, all_sensor_data: list)[source]#
Initialize a Station with its name, site metadata and sensor data.
- Parameters:
stationname (str) – Unique name of the station.
site (Site) –
Siteinstance carrying spatial metadata for this station.all_sensor_data (list of SensorData) – List of
SensorDatainstances (one per observed variable).
Methods
__init__(stationname, site, all_sensor_data)Initialize a Station with its name, site metadata and sensor data.
add_to_modeldata(new_modeltimeseries[, ...])Add a new ModelTimeSeries to the Station.
add_to_sensordata(new_sensordata[, force_update])Add a new SensorData to the Station.
convert_outliers_to_gaps([all_observations, ...])Convert outlier values in the observation data to gaps.
copy([deep])Return a copy of the Station.
fill_gaps_with_debiased_modeldata(obstype[, ...])Fill the gaps using model data corrected for the bias.
Fill the gaps using model data corrected for the diurnal bias.
fill_gaps_with_raw_modeldata(obstype[, ...])Fill the gap(s) using model data without correction.
Fill the gaps using a weighted sum of model data corrected for the diurnal bias and weights with respect to the start of the gap.
Create gap status overview DataFrame with one row per gap period.
get_LCZ([update_metadata, initialize_gee, ...])Retrieve Local Climate Zone (LCZ) for the station using Google Earth Engine (GEE).
get_altitude([update_metadata, initialize_gee])Retrieve altitude for the station using Google Earth Engine (GEE).
get_gee_timeseries_data(gee_manager[, ...])Extract time series data from GEE.
get_info([printout])Retrieve and optionally print detailed information about the station.
get_landcover_fractions([buffers, ...])Get landcover fractions for a circular buffer at the station using GEE.
get_modeltimeseries(obstype[, modelname, ...])Get the ModelTimeSeries instance for a specific observation type.
get_qc_stats([obstype, make_plot])Summarize QC label frequencies for one station and optionally plot pies.
get_sensor(obstype)Get the SensorData instance for a specific observation type.
get_static_gee_buffer_fraction_data(gee_manager)Extract circular buffer fractions of a GEE dataset at Station locations.
get_static_gee_point_data(gee_manager[, ...])Extract static data from GEE dataset at Station locations.
gross_value_check([obstype, ...])Identify outliers based on thresholds.
interpolate_gaps(obstype[, method, ...])Fill the gap(s) using interpolation of SensorData.
make_plot([obstype, colorby, ...])Generate a time series plot for observational data.
make_plot_of_modeldata([obstype, modelname, ...])Generate a time series plot of model data for a specific observation type.
persistence_check([obstype, timewindow, ...])Check if values are not constant in a moving time window.
qc_overview_df([subset_obstypes])Build a QC overview DataFrame for all sensors of a Station.
repetitions_check([obstype, ...])Test if an observation changes after a number of repetitions.
resample(target_freq[, obstype, ...])Resample observation data to a specified frequency.
step_check([obstype, ...])Check for 'spikes' and 'dips' in a time series.
to_csv([filepath, overwrite])Save the station observations to a CSV file.
to_netcdf([filepath, overwrite])Save the Station as a netCDF file.
to_parquet([filepath, overwrite])Save the station observations to a parquet file.
to_xr()Merge all sensor and model data of a station into a single Dataset.
window_variation_check([obstype, ...])Test if the increase/decrease in a time window exceeds a threshold.
Attributes
Station DataFrame constructor.
Get the latest end datetime from the observation data.
Construct a DataFrame representation of all the gaps.
Construct a DataFrame representation of metadata.
Retrieve the model data associated with the station.
Construct a DataFrame representation of all the present model data.
The name of the station.
Construct a DataFrame representation of all the outliers.
Get a list of all the present observation types.
The SensorData related to the station, as a dictionary.
The Site instance of the station.
Get the earliest start datetime from the observation data.