O3API Reference
If you are looking for information on a specific function, class or method, this part of the documentation is for you.
api
O3as REST API methods:
- o3api.api.get_api_info()[source]
Return information about the package
- Returns
The o3api package info
- Return type
dict
- o3api.api.get_data_tco3_return(*args, **kwargs)[source]
Retrieve data to produce tco3_return plot
- Parameters
kwargs – provided in the API call parameters
- Returns
JSON document with data points
- o3api.api.get_data_tco3_zm(*args, **kwargs)[source]
Retrieve data to produce tco3_zm plot
- Parameters
kwargs – provided in the API call parameters
- Returns
JSON document with data points
- o3api.api.get_data_vmro3_zm(*args, **kwargs)[source]
Retrieve data to produce vmro3_zm plot
- Parameters
kwargs – provided in the API call parameters
- Returns
JSON document with data points
- o3api.api.get_model_detail(*args, **kwargs)[source]
Return information about the Ozone model
- Returns
Info about the Ozone model
- Return type
dict
- o3api.api.get_models_info()[source]
Return dictionary of available models with the meta info
- Returns
The dictionary of available models
- Return type
dict
- o3api.api.get_models_list(*args, **kwargs)[source]
Return the list of available Ozone models
- Returns
The list of available models
- Return type
list
- o3api.api.get_plot_style(*args, **kwargs)[source]
Returning plot style for selected models and plot type
- o3api.api.plot(data, ckwargs, **kwargs)[source]
Main plotting routine
- Parameters
data – data to plot
ckwargs – dictionary for curve plotting (e.g. color, style)
kwargs – provided in the API call parameters
- Returns
PDF plot
- o3api.api.plot_json(data, ckwargs, **kwargs)[source]
Plotting routine returning JSON points
- Parameters
data – data ready for plotting
ckwargs – dictionary for curve plotting (e.g. color, style)
kwargs – provided in the API call parameters
- Returns
JSON document with data points and styles for plotting
- o3api.api.plot_tco3_return(*args, **kwargs)[source]
Plot tco3_return
- Parameters
kwargs – provided in the API call parameters
- Returns
Either PDF plot or JSON document
plots
O3as helper classes to extact data for plotting:
- class o3api.plots.DataSelection(plot_type, **kwargs)[source]
Class to perform data selection, based on
Dataset
.- Parameters
begin – Year to start data scanning from
end – Year to finish data scanning
month – Month(s) to select, if not a whole year
lat_min – Minimum latitude to define the range (-90..90)
lat_max – Maximum latitude to define the range (-90..90)
- get_dataslice(model)[source]
Function to select the slice of data according to the time and latitude requested
- Parameters
model – The model to process
- Returns
xarray dataset selected according to the time and latitude
- Return type
xarray
- class o3api.plots.Dataset(plot_type, **kwargs)[source]
Base Class to initialize the dataset
- Parameters
plot_type – The plot type (e.g. tco3_zm, vmro3_zm, …)
- class o3api.plots.ProcessForTCO3(**kwargs)[source]
Subclass of
DataSelection
to calculate tco3_zm- get_ensemble_for_plot(models)[source]
Build the ensemble of tco3_zm models for plotting, include reference
- Parameters
models – Models to process for tco3_zm
- Returns
ensemble of models, including the reference, as pd.DataFrame
- Return type
pd.DataFrame
- get_ensemble_shifted(data)[source]
Shift tco3_zm data to reference year
- Parameters
data – data to process as pd.DataFrame
- Returns
shifted data points for plotting
- Return type
pd.DataFrame
- get_ensemble_smoothed(models, smooth_win)[source]
Smooth tco3_zm data using boxcar
- Parameters
models – Models to process for tco3_return
- Returns
smoothed data points
- Return type
pd.DataFrame
- get_ensemble_stats(data)[source]
Calculate Mean, Std, Median for tco3_zm data
- Parameters
data – data to process as pd.DataFrame
- Returns
updated pd.DateFrame with stats columns
- Return type
pd.DataFrame
- get_ensemble_yearly(models)[source]
Rebin tco3_zm data for yearly entries
- Parameters
models – Models to process for tco3_return
- Returns
yearly data points
- Return type
pd.DataFrame
- get_raw_data(model)[source]
Process the model to get tco3_zm raw data
- Parameters
model – The model to process for tco3_zm
- Returns
raw data points in preparation for plotting
- Return type
pandas series (pd.Series)
- get_raw_data_pd(model)[source]
Process the model to get tco3_zm raw data
- Parameters
model – The model to process for tco3_zm
- Returns
raw data points in preparation for plotting
- Return type
pd.DataFrame
- class o3api.plots.ProcessForTCO3Return(**kwargs)[source]
Subclass of
ProcessForTCO3
to calculate tco3_return
- class o3api.plots.ProcessForVMRO3(**kwargs)[source]
Subclass of
DataSelection
to calculate vmro3_zm
plothelpers
O3as help functions to create figures:
- o3api.plothelpers.cleanse_models(**kwargs)[source]
Cleansing models from empty entries, spaces, and quotes
- Parameters
kwargs – The provided in the API call parameters
- Returns
models cleansed from empty entries, spaces, quotes
- Return type
list
- o3api.plothelpers.get_date_range(ds)[source]
Return the range of dates in the provided dataset
- Parameters
ds – xarray dataset to check
- Returns
date_min, date_max
- o3api.plothelpers.get_periodicity(pd_time)[source]
Calculate periodicity in the provided data
- Parameters
pd_time (pandas DatetimeIndex) – The time period
- Returns
Calculated periodicity as the number of points per year
- Return type
int
- o3api.plothelpers.get_plot_info_html(**kwargs)[source]
Generate info text (HTML) for the plot
- Parameters
kwargs – The provided in the API call parameters
- Returns
information text (HTML) with legal info, parameters etc
- Return type
string
- o3api.plothelpers.get_plot_info_txt(**kwargs)[source]
Generate info text for the plot
- Parameters
kwargs – The provided in the API call parameters
- Returns
information text with legal info, parameters etc
- Return type
string
- o3api.plothelpers.get_plot_params(**kwargs)[source]
Get plot parameters
- Parameters
kwargs – The provided in the API call parameters
- Returns
plot_params with added input parameters
- Return type
string