API reference#
This page gives an overview of all ValEnsPy objects, functions, and methods. All classes and functions exposed in ValEnsPy.* are public API.
Modules#
Pre-made Diagnostic#
Most users will use pre-made diagnostics. They are organized into four categories and listed below.
Model2Self#
See Model2Self
for all shared functionality.
- AnnualCycle(ds: Dataset)#
Annual Cycle - Model2Self
The annual cycle of the data.
- Parameters:
ds (Dataset) – The data to calculate the annual cycle of.
See also
Model2Self
,valenspy.diagnostic.functions.annual_cycle
,valenspy.diagnostic.visualizations.plot_annual_cycle
Examples
>>> from valenspy.diagnostic import AnnualCycle >>> result = AnnualCycle(ds) >>> AnnualCycle.plot(result)
- DiurnalCycle(ds: Dataset)#
Diurnal Cycle - Model2Self
The diurnal cycle of the data.
- Parameters:
ds (Dataset) – The data to calculate the diurnal cycle of.
See also
Model2Self
,valenspy.diagnostic.functions.diurnal_cycle
,valenspy.diagnostic.visualizations.plot_diurnal_cycle
Examples
>>> from valenspy.diagnostic import DiurnalCycle >>> result = DiurnalCycle(ds) >>> DiurnalCycle.plot(result)
- SpatialTimeMean(ds: Dataset)#
Spatial Mean - Model2Self
The spatial representation of the time mean of the data.
- Parameters:
ds (Dataset) – The data to calculate the spatial mean of.
See also
Model2Self
,valenspy.diagnostic.functions.spatial_time_mean
,valenspy.diagnostic.visualizations.plot_map
Examples
>>> from valenspy.diagnostic import SpatialMean >>> result = SpatialMean(ds) >>> SpatialMean.plot(result)
- TimeSeriesSpatialMean(ds: Dataset)#
Time Series - Model2Self
The time series of the data - if the data is spatial, the spatial mean is taken.
- Parameters:
ds (Dataset) – The data to calculate the time series of the spatial mean of.
See also
Model2Self
,valenspy.diagnostic.functions.time_series_spatial_mean
,valenspy.diagnostic.visualizations.plot_time_series
Examples
>>> from valenspy.diagnostic import TimeSeries >>> result = TimeSeries(ds) >>> TimeSeries.plot(result)
- TimeSeriesTrendSpatialMean(ds: Dataset, window_size, min_periods: int = None, center: bool = True, **window_kwargs)#
Time Series Trend - Model2Self
The time series trend of the data - if the data is spatial, the spatial mean is taken.
- Parameters:
ds (Dataset) – The data to calculate the trend of.
window_size (Any) – The size - in number of time steps - of the window to use for the rolling average.
min_periods (int, default=None) – The minimum number of periods required for a value to be considered valid, by default None
center (bool, default=True) – If True, the value is placed in the center of the window, by default True
**window_kwargs (Any) – Description of window_kwargs.
See also
Model2Self
,valenspy.diagnostic.functions.time_series_trend
,valenspy.diagnostic.visualizations.plot_time_series
Examples
>>> from valenspy.diagnostic import TimeSeriesTrend >>> result = TimeSeriesTrend(ds) >>> TimeSeriesTrend.plot(result)
- UrbanHeatIsland(ds: Dataset, urban_coord: tuple, rural_coord: tuple, projection=None)#
Urban Heat Island - Model2Self
The urban heat island as the difference in temperature between urban and rural areas.
- Parameters:
ds (Dataset) – The data to calculate the urban heat island effect of.
urban_coord (tuple) – The coordinates of the urban area in the format (lat, lon).
rural_coord (tuple) – The coordinates of the rural area in the format (lat, lon).
projection (Any, default=None) – The projection used to convert the urban and rural coordinates to the dataset’s projection.
See also
Model2Self
,valenspy.diagnostic.functions.urban_heat_island
,valenspy.diagnostic.visualizations.plot_time_series
Examples
>>> from valenspy.diagnostic import UrbanHeatIsland >>> result = UrbanHeatIsland(ds) >>> UrbanHeatIsland.plot(result)
- UrbanHeatIslandDiurnalCycle(ds: Dataset, urban_coord: tuple, rural_coord: tuple, projection=None)#
Urban Heat Island Diurnal Cycle - Model2Self
The diurnal cycle of the urban heat island.
- Parameters:
ds (Dataset) – The data to calculate the urban heat island effect of.
urban_coord (tuple) – The coordinates of the urban area in the format (lat, lon).
rural_coord (tuple) – The coordinates of the rural area in the format (lat, lon).
projection (Any, default=None) – The projection used to convert the urban and rural coordinates to the dataset’s projection.
See also
Model2Self
,valenspy.diagnostic.functions.urban_heat_island_diurnal_cycle
,valenspy.diagnostic.visualizations.plot_diurnal_cycle
Examples
>>> from valenspy.diagnostic import UrbanHeatIslandDiurnalCycle >>> result = UrbanHeatIslandDiurnalCycle(ds) >>> UrbanHeatIslandDiurnalCycle.plot(result)
Model2Ref#
See Model2Ref
for all shared functionality.
- DiurnalCycleBias(ds: Dataset, ref: Dataset, calc_relative=False)#
Diurnal Cycle Bias - Model2Ref
The diurnal cycle bias of the data compared to the reference.
- Parameters:
ds (Dataset) – The data to calculate the diurnal cycle bias of.
ref (Dataset) – The reference data to compare the data to.
calc_relative (Any, default=False) – If True, return the calc_relative bias, by default False
See also
Model2Ref
,valenspy.diagnostic.functions.diurnal_cycle_bias
,valenspy.diagnostic.visualizations.plot_diurnal_cycle
Examples
>>> from valenspy.diagnostic import DiurnalCycleBias >>> result = DiurnalCycleBias(ds) >>> DiurnalCycleBias.plot(result)
- SpatialBias(ds: Dataset, ref: Dataset, calc_relative=False)#
Spatial Bias - Model2Ref
The spatial bias of the data compared to the reference.
- Parameters:
ds (Dataset) – The data to calculate the spatial bias of.
ref (Dataset) – The reference data to compare the data to.
calc_relative (Any, default=False) – If True, return the relative bias, if False return the absolute bias, by default False
See also
Model2Ref
,valenspy.diagnostic.functions.spatial_bias
,valenspy.diagnostic.visualizations.plot_map
Examples
>>> from valenspy.diagnostic import SpatialBias >>> result = SpatialBias(ds) >>> SpatialBias.plot(result)
- TemporalBias(ds: Dataset, ref: Dataset, calc_relative=False)#
Temporal Bias - Model2Ref
The temporal bias of the data compared to the reference.
- Parameters:
ds (Dataset) – The data to calculate the temporal bias of.
ref (Dataset) – The reference data to compare the data to.
calc_relative (Any, default=False) – If True, return the relative bias, if False return the absolute bias, by default False
See also
Model2Ref
,valenspy.diagnostic.functions.temporal_bias
,valenspy.diagnostic.visualizations.plot_time_series
Examples
>>> from valenspy.diagnostic import TemporalBias >>> result = TemporalBias(ds) >>> TemporalBias.plot(result)
Ensemble2Self#
See Ensemble2Self
for all shared functionality.
Ensemble2Ref#
See Ensemble2Self
for all shared functionality.
- MetricsRankings(dt_mod: DataTree, da_obs: Dataset, metrics=None, pss_binwidth=None)#
Metrics Rankings - Ensemble2Ref
The rankings of ensemble members with respect to several metrics when compared to the reference.
- Parameters:
dt_mod (DataTree) – Description of dt_mod.
da_obs (Dataset) – Description of da_obs.
metrics (Any, default=None) – Description of metrics.
pss_binwidth (Any, default=None) – Description of pss_binwidth.
See also
Ensemble2Ref
,valenspy.diagnostic.functions.calc_metrics_dt
,valenspy.diagnostic.visualizations.plot_metric_ranking
Examples
>>> from valenspy.diagnostic import MetricsRankings >>> result = MetricsRankings(ds) >>> MetricsRankings.plot(result)