API: qc_plots2 module
- class qc_plots.qc_plots2.FlagCategory(value)
An enumeration representing different subsets of data
- class qc_plots.qc_plots2.DataCategory(value)
An enumeration representing different roles of a data file
The roles are:
PRIMARY- the main data being plotted, this will usually be the*.ncfile given as a positional argument to the plotting script.REFERENCE- good quality data used as a reference to compare the primary data against.CONTEXT- a longer timeseries to put the primary data in context of the full instrument record
- exception qc_plots.qc_plots2.DataError
An exception to raise if a given subset of data cannot be provided.
- exception qc_plots.qc_plots2.PlotClassError
An exception to raise if a requested plot kind is not available.
- exception qc_plots.qc_plots2.PlottingError
An exception to raise if there is an issue with plotting due to incorrect configuration
- class qc_plots.qc_plots2.TcconData(data_category: DataCategory, nc_file, styles: dict, exclude_times=None, include_times=None, allowed_flag_categories: Optional[Sequence[FlagCategory]] = None)
A wrapper class around a TCCON netCDF dataset
These instances provide controlled access to the underlying dataset, allowing the data to be subset by flag and time if needed. They also carry some ancillary information, such as plotting styles associated with their data type and how to label the different data subtypes in the legend.
Access to data is through the
get_flag0_or_all_data()andget_data()methods. Labels for the data in the legend are accessed through theget_label()andget_flag0_or_all_label()methods.This class can be used as a context manager in place of
netCDF4.Dataset.Warning
exclude_timesandinclude_timesare mutually exclusive. If both are given,exclude_timestakes precedence andinclude_timesis ignored.- Parameters
data_category – Which category of data this instance represents; used by certain plots to skip datasets that they should not plot.
nc_file – Path to the netCDF file to read data from.
styles – A dictionary of plot style keywords to use for this type of data; expected to be 3 levels: plot kind, data subset, keywords.
exclude_times – A sequence of times that this instance will exclude data that overlaps. That is, the data getter methods will not return any data from the underlying dataset with a timestamp between the minimum and maximum times in this sequence.
include_times – The reverse of
exclude_times, if this is provided, the data getter methods will only return data with a timestamp between the minimum and maximum times in this sequence.allowed_flag_categories – If given, a sequence of
FlagCategoryinstances that limit which categories this dataset is permitted to return.
- has_flag_category(flag_category: FlagCategory) bool
Check whether this instance can provide data in a certain flag category.
- get_data(varname: str, flag_category: FlagCategory) MaskedArray
Get a subset of the data from the underlying netCDF dataset.
This will retrieve the subset of data for variable
varnamethat has the flags allowed byflag_category. If thisTcconDatainstance has additional limits on e.g. the times allowed, the subset will respect those limits.- Parameters
varname – The name of the variable in the underlying netCDF file to retrieve, with two special cases. “time” will return the time variable from the netCDF file, but converted to matplotlib date numbers for faster plotting. “datetime” will instead return the time variable converted to Python datetime instances.
flag_category – Which subset of data to return.
- Returns
The data from the netCDF dataset.
- Return type
np.ma.masked_array
- property default_category: FlagCategory
The default subset of data that
get_flag0_or_all_data()would return.
- get_flag0_or_all_data(varname) MaskedArray
Get the best “default” subset of data for this dataset
This method behaves similarly to
get_data(), expect that it will return flag = 0 data if allowed, otherwise it returns all data.
- get_label(flag_category: FlagCategory) str
Get the label to use in the legend for a subset of data from this dataset
- Parameters
flag_category – Which subset of data the label is for.
- Returns
The legend label. This will be the TCCON site long name, followed by a string describing the subset of data.
- Return type
- get_flag0_or_all_label() str
Get the label to use in the legend for the default subset of data.
This is analgous to
get_flag0_or_all_data()in that it returns the legend label for flag = 0 if it can, other wise all data.
- static nctime_to_pytime(nc_time_var: Variable)
Convert time in a netCDF variable to an array of Python datetime objects.
- static pytime_to_mpltime(pytimes)
Convert time from a sequence of Python datetime objects to an array of matplotlib date numbers.
- static nctime_to_mpltime(nc_time_var: Variable)
Convert time from a netCDF variable to an array of matplotlib date numbers.
- class qc_plots.qc_plots2.Limits(limits_file)
A class that provides an interface to retrieve desired plot limits for a given variable.
- Parameters
limits_file – A path to a TOML file containing information on desired limits for different variables in different plots. See the Limits file section in the configuration page for details on this file format.
- get_limit(varname: str, data: Union[TcconData, Sequence[TcconData]], plot_kind: Optional[str] = None) Tuple[float, float, bool]
Retrieve the desired plot axis limits for a given variable.
This function will try to get limits from:
The plot-specific section of the limits configuration
The default section of the limits configuration
The “vmin” and “vmax” attributes in the netCDF datasets contained in
data. If >1 dataset, then the min and max, respectively, across all files is used.
If either the upper or lower limit is not set by any of these methods, the third return value will be
True. This third value can be passed as theautokeyword for theset_xlimorset_ylimmethods of a matplotlib axes handle, and will ensure that the axis scales automatically if a manual limit could not be determined.- Parameters
varname – Which variable in the
datainstance(s) to get limits for.data – A
TcconDatainstance or sequence of instances that will be included on the plot.plot_kind – The string identifying the kind of plot to get limits for.
- Returns
float – The lower limit for the plot axis.
float – The upper limit for the plot axis.
bool – Whether or not the axis should continue to automatically scale. This will be
Trueif autoscale should be kept on for this axis,Falseotherwise.
- class qc_plots.qc_plots2.AbstractPlot(other_plots, default_style: dict, limits: Limits, key: Optional[str] = None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
The abstract parent class for all concrete plotting classes.
Any plotting class should inherit directly or indirectly (ie. through intermediate parent classes) from this class. In addition to implemented all abstract classes, child classes must ensure that they have a unique string for the
plot_kindclass attribute. This attribute will be used as the “kind” argument in the plotting configuration file. If a class usesNoneasplot_kind, then it cannot be instantiated from the configuration file. (This may be useful to create an intermediate abstract class.)- Parameters
other_plots – A sequence of other
AbstractPlotsubclass instances that represent all other plots to be made, based on the configuration. Used if one plot needs to look up another plot to, for example, ensure that their main plot areas’ sizes match. This will need to be passed as a list reference (i.e. do not make a copy) so that you can append plots to that list and plots added after this one is instantiated are accessible to it.default_style – The dictionary with the default styles for all plot kinds.
limits – The
Limitsinstance to use when setting axis limits for this plot.key – A string to use to refer to this plot from other plots.
name – A name to use for this plot along with the plot number in the upper left corner of the page. If not provided, then the automatic save name for this plot (without the file extension) is used.
bookmark – The value to use as the bookmark for this page. Will only matter if the overall configuration
bookmark_all(for the main program) isNoneorFalse. This input can be a string to use as the bookmark name orTrueto indicate that this plot should use the value fornameas its bookmark.width – Width of the plot in centimeters.
height – Height of the plot in centimeters.
legend_kws – Dictionary of keywords to set the style of the legend for this plot specifically.
- classmethod from_config_section(section: dict, other_plots, full_config: dict, limits_file)
Create an
AbstractPlotinstance from one[[plots]]section of the configuration file.- Parameters
section – The dictionary representing one
[[plots]]section in the configuration file.other_plots – The list of other plot instances required by the class
__init__method, see class docstring.full_config – The dictionary representing the full configuration files.
limits_file – The path to the limits configuration file.
- property name
Return the name for this plot; preferring the user-specified one if present and falling back on the automatic file name
- get_plot_by_key(key)
Find another plot by its key.
If two plots have the same key, the first one is returned.
- Raises
KeyError – If no plot has the specified key.
- get_plot_args(data: TcconData, flag0_only: bool = False) Sequence[dict]
Return a list of dictionaries providing the data and style keywords for each series to plot.
This default implementation will always return flag = 0 data and style keywords as the first dictionary. If flag > 0 data is permitted from the input
data, a second dictionary with that data and its style is also included. The first dictionary will also include legend keywords.Note
For consistency, any subclass overriding this method should return a list of dictionaries using the keys “data”, “kws”, and “legend_kws”.
- Parameters
data –
TcconDatainstance to extract data subsets from.flag0_only – Whether the QC plots program was requested to show only flag = 0 data. If so, the returned list will only have one element.
- Returns
A list of dictionaries with keywords “data”, “kws”, and (in the first) “legend_kws”, pointing to data to plot, plot style keywords, and legend style keywords, respectively.
- Return type
Sequence[dict]
- get_plot_kws(data: TcconData, flag_category: Optional[FlagCategory], _format_label: bool = True) dict
Get the style keywords to use when plotting a given subset of data.
- Parameters
data –
TcconDatainstance data is subset from.flag_category – Which subset of data to get the style for.
_format_label – Whether to apply the formatting to the “label” keyword (replacing “{data}” with the label for this subset of data). Can be set to
Falseif this should be delayed so that a subclass can format the label.
- Returns
A dictionary of style keywords, to pass to the plotting function as
fxn(.., **kws).- Return type
- get_legend_kws() dict
Get legend style keywords to use for this plot.
- Returns
A dictionary of legend keyword to pass to the
legendcall aslegend(..., **kws).- Return type
- make_plot(data: Sequence[TcconData], extra_data: dict, flag0_only: bool = False, show_all: bool = False, img_path: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/tccon-qc-plots/checkouts/latest/outputs'), tight=True) Path
Setup, create, and save this plot as an image.
- Parameters
data – The
TcconDatainstance(s) to draw data from to plot. Depending on the plot kind, only a subset of them may be used.flag0_only – Set to
Trueto limit the plotted data to flag = 0 only.show_all – Set to
Trueto ignore specified plot limits and automatically scale the plots to include all data.img_path – Where to save the plot as an image.
tight – Set to
Trueto trim extra whitespace from the plot using matplotlib’s tight layout.
- Returns
Path to where the image was saved.
- Return type
Path
- add_qc_lines(ax, axis: str, nc_var: Variable)
Add lines giving the allowed limits for a variable, ultimately derived in the
??_qc.datfile.- Parameters
ax – Axes handle to plot on.
axis – Either “x” or “y”, which axis these lines give the limits for. “x” means the lines are drawn vertically, “y” mean horizontally.
nc_var – Handle to the netCDF variable instance that is the variable being plotted on this axis.
- classmethod get_label_string(main_data, variable)
Get an axis label with the variable name and (if available) units.
- abstract setup_figure(data: Sequence[TcconData], show_all: bool = False, fig=None, axs=None)
Set up the figure and axes for this plot.
This method must be implemented in child classes and must return a handle to the figure itself plus a handle to the axes or an array of axes handles if >1 panel created. (These are the same return values as
matplotlib.pyplot.subplots().)- Parameters
data – The
TcconDatainstance(s) data will be taken from, to use for plot limits.show_all – If
True, plots will automatically scale their axes to include all data, rather than use fixed limits.fig – A handle to an existing matplotlib figure to use, if the figure and axes needed set up outside this function, but their limits/labels/etc need set by this function.
axs – A handle or array of handles to axes; same use case as
fig.
- Returns
matplotlib.figure.Figure – Handle to created figure.
matplotlib.axes.Axes or array of such – Handle(s) to created axes.
- abstract get_plot_data(data: TcconData, flagged_category: FlagCategory)
Method that obtains and preprocesses data to plot.
- Parameters
data – The
TcconDatainstance to get data to plot from.flagged_category – Which subset of data to get.
- Returns
A collection of data to be plotted. The type may vary depending on the subclass implementation; a dictionary of numpy arrays is preferred, but some subclasses may return a
pandas.DataFrameor other collection instead.- Return type
plot_data
- abstract get_save_name()
Returns the base file name to use when saving this figure as an image, including the extension.
Warning
Make sure that each plot created returns a unique save name, or some plots will be overwritten and lost! It’s usually good to include the names of the variables being plotted, as well as any other important instance variables, in the name to ensure that different instances of the same class will have unique file names.
- class qc_plots.qc_plots2.TimeseriesMixin
Mixin class that provides common utilities for timeseries plots
This class is not intented to be instantiated, instead it would be an extra parent class to a concrete plotting class. The concrete class would therefore get all the methods defined on this class.
- format_time_axis(ax, data: Sequence[TcconData], xvar='time', buffer_days=2, show_all: bool = False)
Format the x-axis of a plot as a time axis, including limits, name, and tick format.
- Parameters
ax – Matplotlib axes handle to format
data –
TcconDatainstances to be plotted; used to determine first and last times.xvar – Variable to use for the x-axis, if the time is not called “time” in the
TcconDatainstances, use this to give the correct variable name.buffer_days – How many days to leave before the first and after the last data point so that they are not smooshed against the edge of the plot.
show_all – Whether to leave the axis alone to automatically scale as the data is plotted.
- static format_time_axis_custom_times(ax, first_time, last_time, buffer_days=2, show_all: bool = False)
Format the x-axis of a plot as a time axis (limits, name, and ticks) with specified first and last times
- Parameters
ax – Matplotlib axes handle to format
first_time – Earliest time to include on the axis (excluding the buffer). Expected to be a matplotlib date number.
last_time – Latest time to include on the axis (excluding the buffer). Expected to be a matplotlib date number.
buffer_days – How many days to leave before the first time and after the last time so that they are not smooshed against the edge of the plot.
show_all – Whether to leave the axis alone to automatically scale as the data is plotted.
- static resample_data(times, yvals, freq, op) Series
Apply an arbitrary operation to resample time series data to a coarser time resolution.
- Parameters
times – A
pandas.DatetimeIndexlike sequence of datetimes giving the times of the data.yvals – The data to resample
freq – A Pandas frequency string that specifies the temporal frequency to resample to.
op – The name of the operation to apply; usual values are “mean”, “median”, “std”, etc.
- Returns
The resampled
yvals.- Return type
pd.Series
- classmethod roll_data(xvals: ndarray, yvals: ndarray, npts: int, ops: Sequence[str], gap: str, times=None)
Compute rolling statistics on data
- Parameters
xvals – array of x values
yvals – array of y values
npts – number of points to use in the rolling window
ops – name of an operation to do on the rolling windows, or a list of such names
gap – a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling operation applied to each separately.
times – if
xvalsis not a time variable, then this input must be the times corresponding to thexvalsandyvals. It is used to split on gaps.
- Returns
If
opswas a single string (e.g. “median”), then a single dataframe with “x”, “y”, and (iftimes` was given) "time" columns that has the result of the rolling operation. If ``opswas a list, then the output is a list of dataframes, each one with the result of the corresponding operation.- Return type
outputs
- static split_by_gaps(df: DataFrame, gap: str, time)
Split an input dataframe with a datetime variable into a groupby dataframe with each group having data without gaps larger than the “gap” variable
- Parameters
df – pandas dataframe with a datetime column
gap – minimum gap length, a string compatible with pandas Timedelta
time – column name of the datetime variable
- Returns
groupby object with each group having data without gaps larger than the “gap” variable
- Return type
df_by_gaps
- class qc_plots.qc_plots2.FlagAnalysisPlot(other_plots, default_style: dict, limits: Limits, key=None, min_percent: float = 1.0, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
Concrete plotting class that generates bar graphs for the number/percent of spectra flagged by different variables
Configuration plot kind =
"flag-analysis"For parameters not listed here, see
AbstractPlot.- Parameters
min_percent – Minimum percent of spectrum removed by a flag for that flag to be included in the plot.
- class qc_plots.qc_plots2.NanCheckPlot(other_plots, default_style: dict, limits: Limits, vsw_windows: Optional[Sequence[str]] = None, groups: Optional[Sequence[Sequence[str]]] = None, percentage: bool = True, window_font_size: int = 6, sharey: bool = True, key: Optional[str] = None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
Concrete plotting class that creates plots to check for NaNs for fill values by window
Configuration plot kind =
"nan-check"For parameters not listed here, see
AbstractPlot.- Parameters
vsw_windows – A list of the VSW column variables (e.g.
["vsw_co2_6220", "vsw_co2_6339"]) to include in the plot. If not given, then all variables following the name patternvsw_<gas>_<window>will be included. Usually best to leave this asNoneand usegroupsto limit the gases plotted.groups –
If
None, all windows will be plotted on one axes. To split across multiple axes, pass a list of lists to this argument. Each inner list must be a list of gas names (e.g. “co2”). All gases listed in one inner list will be plotted on its own axes. To exclude a gas/window instead, start the name with a “!”. An example of this argument is[["!h2o", "!hdo"], ["h2o"], ["hdo"]]. This would make 3 axes, the first with all gases except H2O and HDO, the second with H2O only, and the third with HDO only.Note
If you have a mix of excludes and includes, such as
["ch4", "!h2o"], then a window must be allowed by the includes and not forbidden by the excludes. This is effectively the same as giving only the includes.percentage – Whether to plot the amount of NaNs/fills as a percentage (
True) or number of spectra (False).window_font_size – The size of the font to use when labelling which window each bar refers to.
sharey – Whether the y-axes for every group should have the same limits or not.
- class qc_plots.qc_plots2.NegativeTimeJumpPlot(other_plots, default_style: dict, limits: Limits, key: Optional[str] = None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, thresholds: Optional[Sequence[dict]] = None)
Concrete plotting class to check for negative time differences between adjacent spectra
TCCON files should usually be monotonically increasing in time for one site. If we see small negative time differences, that’s probably okay, but if we see bigger ones, that may indicate that some spectra were duplicated.
For parameters not listed here, see
AbstractPlot.- Parameters
thresholds –
A list of dictionaries containing the following keys:
”ll”, “ul” - the lower and upper limits for time deltas to plot for this group. Setting
Nonefor one will remove that limit, e.g.Nonefor “ll” will plot everything < “ul””label” - tick label to give this group
”color” - color to use for this group
The timeline plot will show data falling in each of these ll to ul bins, with the first one at y = 0, the second at y = 1 and so on.
- class qc_plots.qc_plots2.TimingErrorAbstractPlot(other_plots, default_style: dict, sza_ranges: Sequence[Sequence[float]], limits: Limits, yvar: str = 'xluft', freq: str = 'W', op: str = 'median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, flag_cat_override: Optional[Union[str, FlagCategory]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
Intermediate abstract plot class for timing error plots
- class qc_plots.qc_plots2.TimingErrorAMvsPM(other_plots, default_style: dict, sza_range: Sequence[float], limits: Limits, yvar: str = 'xluft', freq: str = 'W', op: str = 'median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, flag_cat_override: Optional[Union[str, FlagCategory]] = None, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
Concrete plotting class that creates plots to detect timing error by morning/afternoon differences
Configuration plot kind =
"timing-error-am-pm"For parameters not listed here, see
AbstractPlot.- Parameters
sza_range – Two element list giving the lower and upper SZA limits to average morning and afternoon data between. Data outside these SZA limits are not used.
yvar – Variable to average for morning and afternoon to plot on the y-axis.
freq – Frequency string that specifies the temporal resolution to average to.
op – What operation to apply to the morning & afternoon data. Usually “median”, “mean”, etc.
time_buffer_days – How many days before the first and after the last data point to push the axis x-limits to make the plot nicer to read.
- class qc_plots.qc_plots2.TimingErrorAMvsPMWithViolin(other_plots, violin_data_file, default_style: dict, sza_range: Sequence[float], limits: Limits, yvar: str = 'xluft', freq: str = 'W', op: str = 'median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, flag_cat_override: Optional[Union[str, FlagCategory]] = None, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class that creates plots to detect timing error by morning/afternoon differences
Configuration plot kind =
"timing-error-am-pm+violin"For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
sza_range – Two element list giving the lower and upper SZA limits to average morning and afternoon data between. Data outside these SZA limits are not used.
yvar – Variable to average for morning and afternoon to plot on the y-axis.
freq –
Frequency string that specifies the temporal resolution to average to.
op – What operation to apply to the morning & afternoon data. Usually “median”, “mean”, etc.
time_buffer_days – How many days before the first and after the last data point to push the axis x-limits to make the plot nicer to read.
- class qc_plots.qc_plots2.TimingErrorAMvsPMDelta(other_plots, default_style: dict, sza_range: Sequence[float], limits: Limits, yvar: str = 'xluft', freq: str = 'W', op: str = 'median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, flag_cat_override: Optional[Union[str, FlagCategory]] = None, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
Concrete plotting class that creates plots to detect timing error by morning/afternoon differences
Configuration plot kind =
"delta-timing-error-am-pm"Unlike
TimingErrorAMvsPM, which plots both morning and afternoon values, this class plots a difference (afternoon - morning).For parameters not listed here, see
AbstractPlot.- Parameters
sza_range – Two element list giving the lower and upper SZA limits to average morning and afternoon data between. Data outside these SZA limits are not used.
yvar – Variable to average for morning and afternoon to plot on the y-axis.
freq –
Frequency string that specifies the temporal resolution to average to.
op – What operation to apply to the morning & afternoon data. Usually “median”, “mean”, etc.
time_buffer_days – How many days before the first and after the last data point to push the axis x-limits to make the plot nicer to read.
- class qc_plots.qc_plots2.TimingErrorAMvsPMDeltaWithViolin(other_plots, violin_data_file, default_style: dict, sza_range: Sequence[float], limits: Limits, yvar: str = 'xluft', freq: str = 'W', op: str = 'median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, flag_cat_override: Optional[Union[str, FlagCategory]] = None, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class that creates plots to detect timing error by morning/afternoon differences
Configuration plot kind =
"delta-timing-error-am-pm+violin"Unlike
TimingErrorAMvsPMWithViolin, which plots both morning and afternoon values, this class plots a difference (afternoon - morning).For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
sza_range – Two element list giving the lower and upper SZA limits to average morning and afternoon data between. Data outside these SZA limits are not used.
yvar – Variable to average for morning and afternoon to plot on the y-axis.
freq –
Frequency string that specifies the temporal resolution to average to.
op – What operation to apply to the morning & afternoon data. Usually “median”, “mean”, etc.
time_buffer_days – How many days before the first and after the last data point to push the axis x-limits to make the plot nicer to read.
- class qc_plots.qc_plots2.TimingErrorMultipleSZAs(other_plots, default_style: dict, sza_ranges: Sequence[Sequence[float]], limits: Limits, am_or_pm, yvar='xluft', freq='W', op='median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, flag_cat_override: Optional[Union[str, FlagCategory]] = None, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None)
Concrete plot to identify timing errors from averages in different SZA ranges.
Configuration plot kind =
"timing-error-szas"For parameters not listed here, see
AbstractPlot.- Parameters
sza_ranges – List of two element lists giving the lower and upper SZA limits to average data between. Data outside these SZA limits are not used.
am_or_pm – Whether to look at morning (“am”) or afternoon (“pm”) data.
yvar – Variable to average for morning and afternoon to plot on the y-axis.
freq –
Frequency string that specifies the temporal resolution to average to.
op – What operation to apply to the morning & afternoon data. Usually “median”, “mean”, etc.
time_buffer_days – How many days before the first and after the last data point to push the axis x-limits to make the plot nicer to read.
- class qc_plots.qc_plots2.TimingErrorMultipleSZAsWithViolin(other_plots, default_style: dict, sza_ranges: Sequence[Sequence[float]], limits: Limits, am_or_pm, violin_data_file, yvar='xluft', freq='W', op='median', time_buffer_days: int = 2, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, flag_cat_override: Optional[Union[str, FlagCategory]] = None, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plot to identify timing errors from averages in different SZA ranges.
Configuration plot kind =
"timing-error-szas+violin"For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
sza_ranges – List of two element lists giving the lower and upper SZA limits to average data between. Data outside these SZA limits are not used.
am_or_pm – Whether to look at morning (“am”) or afternoon (“pm”) data.
yvar – Variable to average for morning and afternoon to plot on the y-axis.
freq –
Frequency string that specifies the temporal resolution to average to.
op – What operation to apply to the morning & afternoon data. Usually “median”, “mean”, etc.
time_buffer_days – How many days before the first and after the last data point to push the axis x-limits to make the plot nicer to read.
- class qc_plots.qc_plots2.ScatterPlot(other_plots, xvar: str, yvar: str, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, add_fit: bool = True, fit_flag_category: Optional[FlagCategory] = None, match_axes_size=None, show_out_of_range_data: bool = True)
Concrete plotting class for plotting one variable against another
Configuration plot kind =
"scatter"For parameters not listed here, see
AbstractPlot.- Parameters
xvar – Variable to plot along the x-axis
yvar – Variable to plot along the y-axis
add_fit – Whether or not to add a linear fit to the y vs. x data
fit_flag_category – Which subset of data to calculate the linear fit to. If
None, then the “default” subset (flag = 0 if available, all data if not) is used for each data type.show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Points outside the plot limits on two axes are marked with a diamond.
- class qc_plots.qc_plots2.HexbinPlot(other_plots, xvar: str, yvar: str, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, hexbin_flag_category: Optional[FlagCategory] = None, fit_flag_category: Optional[FlagCategory] = None, show_reference=False, show_context=True)
Concrete plotting class for a 2D histogram of one variable vs. another
Configuration plot kind =
"hexbin"For parameters not listed here, see
AbstractPlot.- Parameters
xvar – Variable to plot on the x-axis
yvar – Variable to plot on the y-axis
hexbin_flag_category – Which subset of data to include in the 2D histogram. If
None, then the “default” (flag = 0 if available, all data if not) subset from each data type is plotted.fit_flag_category – Which subset of data to calculate the linear fit to. If
None, then the “default” (flag = 0 if available, all data if not) subset from each data type is plotted.show_reference – Whether or not to show reference data as an additional histogram on the plot.
show_context – Whether or not to show context data as an additional histogram on the plot.
- class qc_plots.qc_plots2.TimeseriesPlot(other_plots, yvar: str, default_style: dict, limits: Limits, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, key=None, time_buffer_days=2, extra_qc_lines: Optional[Sequence[dict]] = None, show_out_of_range_data: bool = True)
Concrete plotting class for simple timeseries of data
Configuration plot kind =
"timeseries"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable to plot on the y-axis.
time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.Timeseries3PanelPlot(other_plots, yvar: str, default_style: dict, limits: Limits, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, key=None, time_buffer_days=2, extra_qc_lines: Optional[Sequence[dict]] = None, show_out_of_range_data: bool = True, plot_height_ratios: Sequence[float] = (1.0, 1.0, 1.0), height_space: float = 0.01, bottom_limit=None, top_limit=None, even_top_bottom=False)
Concrete plotting class for a timeseries of data with 3 panels (data in, below, and above limits)
This plot is good for showing data where there is a fairly narrow range where data is useful, but potentially a large dynamic range. The middle panel shows the range of data defined by the
limitsinput (which usually will return either the limits for that plot type set in the limits config file or the min/max values listed in the netCDF file). The bottom panel shows value from the lower limit of the middle panel down to the minimum data value or the limit set bybottom_limit. The top panel is similar, it covers from the upper limit of the middle panel to the data maximum ortop_limit.Configuration plot kind =
"timeseries-3panel"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable to plot on the y-axis.
time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data –
Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.For this 3-panel plot, points above the upper limit of the top plot and below the lower limit of the bottom plot are shown this way.
plot_height_ratios – What fraction of the plottable area each of the three panels uses. This must be a three element sequence; the values correspond to the top, middle, and bottom panels, respectively.
height_space – Fraction of vertical space reserved for gap between plots, between 0 and 1. This is pass as the
hspaceparameter tomatplotlib.pyplot.subplots().bottom_limit – The lower limit of the bottom panel. If not specified, it will be left to the plotting code to determine, which will do its best to include all data that should be plotted in the bottom panel.
top_limit – As
bottom_limit, but the upper limit of the top panel.even_top_bottom – Set this to
Trueto automatically makebottom_limitandtop_limitequal in magnitude but opposite in sign. Intended for plots centered on 0. This cannot be used if eitherbottom_limitortop_limitare given. Doing so will raise aValueError
- class qc_plots.qc_plots2.Timeseries3PanelPlotWithViolin(other_plots, yvar: str, violin_data_file: str, default_style: dict, limits: Limits, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, key=None, time_buffer_days=2, extra_qc_lines: Optional[Sequence[dict]] = None, show_out_of_range_data: bool = True, plot_height_ratios: Sequence[float] = (1.0, 1.0, 1.0), height_space: float = 0.01, bottom_limit=None, top_limit=None, even_top_bottom=False, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class for a three-panel plot (extrema and main data), with violin plots to the side
Configuration plot kind =
"timeseries-3panel+violin"For all parameters, see
AbstractPlot,Timeseries3PanelPlot, orViolinAuxPlotMixin.
- class qc_plots.qc_plots2.TimeseriesDeltaPlot(other_plots, yvar1: str, yvar2: str, default_style: dict, limits: Limits, name: Optional[str] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, key=None, time_buffer_days=2, show_out_of_range_data: bool = True)
Concrete plotting class for time series that plot the difference of two variables.
Configuration plot kind =
"delta-timeseries"For parameters not listed here, see
AbstractPlot.- Parameters
yvar1 – Variables to take the difference of to plot on the y-axis. Difference will be
yvar1 - yvar2.yvar2 – Variables to take the difference of to plot on the y-axis. Difference will be
yvar1 - yvar2.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.Timeseries2PanelPlot(other_plots, yvar: str, yerror_var: str, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, time_buffer_days=2, show_out_of_range_data: bool = True)
Concrete plotting class for a two-panel plot, with a second time series in a smaller upper plot
Configuration plot kind =
"timeseries-2panel"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable to plot on the lower, large y-axis.
yerror_var – Variable to plot on the upper, small y-axis.
time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.Timeseries2PanelPlotWithViolins(other_plots, yvar: str, yerror_var: str, violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, time_buffer_days=2, show_out_of_range_data: bool = True, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class for a two-panel plot, with a second time series in a smaller upper plot and violin plots to the side
Configuration plot kind =
"timeseries-2panel+violin"For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
yvar – Variable to plot on the lower, large y-axis.
yerror_var – Variable to plot on the upper, small y-axis.
time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.ResampledTimeseriesPlot(other_plots, yvar: str, freq: str, op: str, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, time_buffer_days=2, show_out_of_range_data: bool = True)
Concrete plotting class to plot a timeseries of data resampled to a coarser temporal frequency.
Configuration plot kind =
"resampled-timeseries"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable to plot on the y-axis.
freq –
Frequency string that determines the temporal resolution of the resampled data.
op – The operation to apply to resample the data. Usually “median”, “mean”, “std”, etc.
time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.ResampledTimeseriesPlotWithViolin(other_plots, yvar: str, freq: str, op: str, violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, time_buffer_days=2, show_out_of_range_data: bool = True, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class to plot a timeseries of data resampled to a coarser temporal frequency.
Configuration plot kind =
"resampled-timeseries+violin"For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
yvar – Variable to plot on the y-axis.
freq –
Frequency string that determines the temporal resolution of the resampled data.
op – The operation to apply to resample the data. Usually “median”, “mean”, “std”, etc.
time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.RollingDerivativePlot(other_plots, yvar: str, dvar: str, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, derivative_order: int = 1, gap: str = '20000 days', rolling_window: int = 500, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True)
Concrete plotting class to plot a derivative of one variable vs. another over a rolling window.
Configuration plot kind =
"rolling-derivative"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable in the numerator of the derivative.
dvar – Variable in the denominator of the derivative.
derivative_order – What order derivative to calculate; 1 = slope, 2 = curvature, etc. Currently only order 1 is implemented.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling derivatives applied to each separately.
rolling_window – How many spectra to use to calculate the derivative at each time.
flag_category – What subset of data to use to compute the derivative. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.RollingDerivativePlotWithViolins(other_plots, yvar: str, dvar: str, violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, derivative_order: int = 1, gap: str = '20000 days', rolling_window: int = 500, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class to plot a derivative of one variable vs. another over a rolling window.
Configuration plot kind =
"rolling-derivative+violin"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable in the numerator of the derivative.
dvar – Variable in the denominator of the derivative.
derivative_order – What order derivative to calculate; 1 = slope, 2 = curvature, etc. Currently only order 1 is implemented.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling derivatives applied to each separately.
rolling_window – How many spectra to use to calculate the derivative at each time.
flag_category – What subset of data to use to compute the derivative. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.RollingTimeseriesPlot(other_plots, yvar: str, ops: Union[str, Sequence[str]], default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True)
Concrete plotting class to plot a rolling mean/median/etc timeseries.
Configuration plot kind =
"rolling-timeseries"For parameters not listed here, see
AbstractPlot.- Parameters
yvar – Variable to plot on the y-axis and compute the rolling value of.
ops – A single operation name (e.g. “mean”, “median”, “std” etc.) or list of names to apply to the rolling window. A list will cause multiple rolling values to be plotted; each can have a different style applied to it. Quantile operations require special note: since computing the quantile on data requires an extra argument to specify which quantile, a string like “quantile0.25” is required to give both the operation and quantile value.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling operation applied to each separately.
rolling_window – How many spectra to use to calculate the rolling value at each time.
uncertainty – Whether to include uncertainty on median or mean operations. Median values will have the interquartile range as the uncertainty; mean values will have the 1-sigma standard deviation.
flag_category – What subset of data to use to compute the rolling value. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.RollingTimeseriesPlotWithViolin(other_plots, yvar: str, ops: Union[str, Sequence[str]], violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class to plot a rolling mean/median/etc timeseries.
Configuration plot kind =
"rolling-timeseries+violin"For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
yvar – Variable to plot on the y-axis and compute the rolling value of.
ops – A single operation name (e.g. “mean”, “median”, “std” etc.) or list of names to apply to the rolling window. A list will cause multiple rolling values to be plotted; each can have a different style applied to it. Quantile operations require special note: since computing the quantile on data requires an extra argument to specify which quantile, a string like “quantile0.25” is required to give both the operation and quantile value.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling operation applied to each separately.
rolling_window – How many spectra to use to calculate the rolling value at each time.
uncertainty – Whether to include uncertainty on median or mean operations. Median values will have the interquartile range as the uncertainty; mean values will have the 1-sigma standard deviation.
flag_category – What subset of data to use to compute the rolling value. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.RollingTimeseries3PanelPlot(other_plots, yvar: str, ops: Union[str, Sequence[str]], default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, plot_height_ratios: Sequence[float] = (1.0, 1.0, 1.0), height_space: float = 0.01, bottom_limit=None, top_limit=None, even_top_bottom=False)
Concrete plotting class for a rolling timeseries of data with 3 panels (data in, below, and above limits)
Like
Timeseries3PanelPlotexcept it performs rolling operations (mean, medians, etc) and plots the rolling op result on top of flag == 0 data.Configuration plot kind =
"rolling-timeseries-3panel"For all parameters not listed here, see
AbstractPlot,RollingTimeseriesPlot, orTimeseries3PanelPlot.
- class qc_plots.qc_plots2.RollingTimeseries3PanelPlotWithViolin(other_plots, yvar: str, ops: Union[str, Sequence[str]], violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, plot_height_ratios: Sequence[float] = (1.0, 1.0, 1.0), height_space: float = 0.01, bottom_limit=None, top_limit=None, even_top_bottom=False, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class for a rolling timeseries of data with 3 panels (data in, below, and above limits)
Like
RollingTimeseries3PanelPlotexcept with violin plots to the side of each panel.Configuration plot kind =
"rolling-timeseries-3panel+violin"For all parameters not listed here, see
AbstractPlot,RollingTimeseriesPlot,Timeseries3PanelPlot, orViolinAuxPlotMixin.
- class qc_plots.qc_plots2.TimeseriesRollingDeltaPlot(other_plots, yvar1: str, yvar2: str, ops: Union[str, Sequence[str]], default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True)
Concrete plotting class for time series that plots the difference of two variables with rolling operations.
Configuration plot kind =
"delta-rolling-timeseries"For parameters not listed here, see
AbstractPlot.- Parameters
yvar1 – Variables to take the difference of to plot on the y-axis. Difference will be
yvar1 - yvar2.yvar2 – Variables to take the difference of to plot on the y-axis. Difference will be
yvar1 - yvar2.ops – A single operation name (e.g. “mean”, “median”, “std” etc.) or list of names to apply to the rolling window. A list will cause multiple rolling values to be plotted; each can have a different style applied to it. Quantile operations require special note: since computing the quantile on data requires an extra argument to specify which quantile, a string like “quantile0.25” is required to give both the operation and quantile value.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling operation applied to each separately.
rolling_window – How many spectra to use to calculate the rolling value at each time.
uncertainty – Whether to include uncertainty on median or mean operations. Median values will have the interquartile range as the uncertainty; mean values will have the 1-sigma standard deviation.
flag_category – What subset of data to use to compute the rolling value. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.TimeseriesRollingDeltaZmin(other_plots, ops: Union[str, Sequence[str]], default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, annotation_font_size: int = 6)
Concrete plotting class for time series that plots the difference of zmin and zobs with rolling operations.
Configuration plot kind =
"zmin-zobs-delta-rolling-timeseries". This plot adds two elements to the normal rolling plot:The estimated differences in pressure will be assigned to ticks on the right hand side
The usual GEOS-FP IT bottom level and the site GPS altitude will be written in the top left corner. If the latter is below the former, it will be colored red to indicate that GGG must extrapolate.
For parameters not listed here, see
AbstractPlot.- Parameters
ops – A single operation name (e.g. “mean”, “median”, “std” etc.) or list of names to apply to the rolling window. A list will cause multiple rolling values to be plotted; each can have a different style applied to it. Quantile operations require special note: since computing the quantile on data requires an extra argument to specify which quantile, a string like “quantile0.25” is required to give both the operation and quantile value.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling operation applied to each separately.
rolling_window – How many spectra to use to calculate the rolling value at each time.
uncertainty – Whether to include uncertainty on median or mean operations. Median values will have the interquartile range as the uncertainty; mean values will have the 1-sigma standard deviation.
flag_category – What subset of data to use to compute the rolling value. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.annotation_font_size – Font size for the site/GEOS altitude annotation.
- class qc_plots.qc_plots2.TimeseriesRollingDeltaWithViolinPlot(other_plots, yvar1: str, yvar2: str, ops: Union[str, Sequence[str]], violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=0.5, violin_plot_hide_yticks=False)
Concrete plotting class for time series that plots the difference of two variables with rolling operations.
Configuration plot kind =
"delta-rolling-timeseries+violin"For parameters not listed here, see
AbstractPlotorViolinAuxPlotMixin.- Parameters
yvar1 – Variables to take the difference of to plot on the y-axis. Difference will be
yvar1 - yvar2.yvar2 – Variables to take the difference of to plot on the y-axis. Difference will be
yvar1 - yvar2.ops – A single operation name (e.g. “mean”, “median”, “std” etc.) or list of names to apply to the rolling window. A list will cause multiple rolling values to be plotted; each can have a different style applied to it. Quantile operations require special note: since computing the quantile on data requires an extra argument to specify which quantile, a string like “quantile0.25” is required to give both the operation and quantile value.
gap –
a Pandas Timedelta string specifying the longest time difference between adjacent points that a rolling window can operate over. That is, if this is set to “7 days” and there is a data gap a 14 days, the data before and after that gap will have the rolling operation applied to each separately.
rolling_window – How many spectra to use to calculate the rolling value at each time.
uncertainty – Whether to include uncertainty on median or mean operations. Median values will have the interquartile range as the uncertainty; mean values will have the 1-sigma standard deviation.
flag_category – What subset of data to use to compute the rolling value. If this is
None, then the “default” subset (flag = 0 if available, all data if not) is used.time_buffer_days – Number of days before the first and after the last time to push the axis limits out to make the plot nicer to read.
show_out_of_range_data – Whether or not to include data points that would fall outside the plot limits on the edge of the plot, using triangle markers to indicate which direction outside the plot limits the point is. Only points outside the y-limits will be shown when this is
True, as we assume that points outside the x-axis (time) are intentionally hidden.
- class qc_plots.qc_plots2.TimeseriesRollingDeltaZminWithViolin(other_plots, ops: Union[str, Sequence[str]], violin_data_file, default_style: dict, limits: Limits, key=None, name: Optional[str] = None, bookmark: Optional[Union[str, bool]] = None, width=20, height=10, legend_kws: Optional[dict] = None, extra_qc_lines: Optional[Sequence[dict]] = None, gap: str = '20000 days', rolling_window: int = 500, uncertainty: bool = False, flag_category: Optional[FlagCategory] = None, time_buffer_days: int = 2, show_out_of_range_data: bool = True, annotation_font_size: int = 6, violin_plot_side='right', violin_plot_size='10%', violin_plot_pad=1.0, violin_plot_hide_yticks=True)
Concrete plotting class for time series that plots the difference of zmin and zobs with rolling operations.
Configuration plot kind =
"zmin-zobs-delta-rolling-timeseries+violin". This plot adds two elements to the normal rolling plot:The estimated differences in pressure will be assigned to ticks on the right hand side
The usual GEOS-FP IT bottom level and the site GPS altitude will be written in the top left corner. If the latter is below the former, it will be colored red to indicate that GGG must extrapolate.
For all parameters, see
TimeseriesRollingDeltaZminorViolinAuxPlotMixin.