API docs¶
- class chandra_limits.thermal.base.ACALimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking ACA limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- alt_names = {'planning.penalty.high': 'penalty_hi', 'planning.warning.high': 'planning_hi'}¶
- class chandra_limits.thermal.base.CEALimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking CEA limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- alt_names = {'odb.caution.high': 'yellow_hi', 'planning.warning.high': 'planning_hi'}¶
- class chandra_limits.thermal.base.LimitLine(msid, units, limit_info, which, margin, names, alt_names)[source]¶
Bases:
object
LimitLine object which characterizes a single limit line as a function of time. This class also contains information about the reason for the limit. This class will never be called independently, but will always be constructed by ThermalLimit.get_limit_line
- Parameters:
- msidstring
The MSID that this limit corresponds to.
- unitsstring
The units of the temperature for this limit, “degC” or “degF”.
- timesNumPy array
An array of seconds (defined as cxcsec) that the limit is defined at.
- valuesNumPy array
An array of floats which corresponds to the limit at the given times.
- reasonsNumPy array of strings
An array of strings giving the reason for the limit value at each given time.
- whichstring
Whether this is a “high” or “low” limit.
- marginfloat
The allowed margin over/under the limit before a violation is flagged.
- namesNumPy array of strings
The possible options for the limit reasons.
- alt_namesdict
Alternative, shorter names for the limit reasons.
- Attributes:
- plotting_values
Methods
check_violations
(model[, start_time])Check violations of a limit against a specific thermal model run.
plot
([use_colors, show_changes, fig_ax, ...])Plot the limit line.
- check_violations(model, start_time=None)[source]¶
Check violations of a limit against a specific thermal model run.
- Parameters:
- modelXijaModel object
The thermal model run which will be used to check violations of.
- start_timeCxoTime input, optional
The time after which to check for violations. If not specified, the time will be the beginning of the limit line.
- Returns:
- list of dicts
Each dictionary in the list contains the start time of the violation, the stop time of the violation, the duration of the violation, and the maximum or minimum temperature of the violation
- plot(use_colors=False, show_changes=True, fig_ax=None, figsize=(10, 10), no_label=False, **kwargs)[source]¶
Plot the limit line.
- Parameters:
- use_colorsboolean, optional
Whether or not to use different colors for the different limit lines. If not, a single color will be used. Default: False
- show_changesboolean, optional
Whether or not to show the changes in the limit line with a dashed gray line, if use_colors is True. No effect if use_colors is False. Default: True
- fig_axtuple of (Figure, Axes)
A Matplotlib Figure and Axes instance to use when plotting the line. If unspecified, a new Figure and Axes will be created and returned by the method. Default: None
- figsize2-tuple of ints
The (width, height) of the figure in inches. Only used if fig_ax is None. Default: (10,10)
- no_labelboolean, optional
If True, don’t automatically show a label for the line if use_colors = True. Default: False
- kwargs
All other keyword arguments are passed to plot_cxctime.
- Returns:
- A tuple containing the Matplotlib (Figure, Axes) used.
- property plotting_values¶
- class chandra_limits.thermal.base.ThermalLimit(msid, model_spec=None, margin=0.04999)[source]¶
Bases:
object
Base class for defining individual ThermalLimit objects for a given xija thermal model. These objects can be used to obtain thermal limit lines as a function of time for individual models.
This object will normally be subclassed.
- Parameters:
- msidstring
The MSID name corresponding to this thermal limit.
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- alt_names = {'odb.caution.high': 'yellow_hi', 'odb.warning.high': 'red_hi', 'planning.warning.high': 'planning_hi'}¶
- get_limit_line(states, which='high')[source]¶
Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- Parameters:
- stateskadi CommandTable or NumPy structured array
The commanded states to be used to help construct the limit line.
- whichstring, optional
Which limit to evaluate, the “high” or “low” limit. Default: “high”
- class chandra_limits.thermal.acis.ACISFPLimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking ACIS FP limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
set_obs_info
(obs_list[, orlist, cfg_file, ...])Set the observation info to determine the limit line.
- alt_names = {'planning.data_quality.high.acis_0': 'acis_0', 'planning.data_quality.high.acis_1': 'acis_1', 'planning.data_quality.high.acis_2': 'acis_2', 'planning.data_quality.high.cold_ecs': 'cold_ecs', 'planning.data_quality.high.grating_0': 'grating_0', 'planning.data_quality.high.grating_1': 'grating_1', 'planning.warning.high': 'planning_hi', 'safety.caution.high': 'yellow_hi'}¶
- set_obs_info(obs_list, orlist=None, cfg_file=None, dat_file=None)[source]¶
Set the observation info to determine the limit line.
- Parameters:
- obs_listdict of lists
Dictionary of lists of obsids, startScience, and stopScience commands.
- orlist: string or Path object, optional
Path to an OR list file to obtain information about observations. If not specified, this information will be obtained from the obscat.
- cfg_filestring or Path object, optional
The ACIS tables CFG file to use. Default is “current.cfg”.
- dat_filestring or Path object, optional
The ACIS tables CFG file to use. Default is “current.dat”.
- class chandra_limits.thermal.acis.BEPPCBLimit(model_spec=None, margin=0.04999)[source]¶
Bases:
DPABoardLimit
Class for checking BEP PCB limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- class chandra_limits.thermal.acis.DEALimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking 1DEAMZT limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- class chandra_limits.thermal.acis.DPALimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking 1DPAMZT limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- class chandra_limits.thermal.acis.DPAMYTLimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking 1DPAMYT limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- class chandra_limits.thermal.acis.FEP1ActelLimit(model_spec=None, margin=0.04999)[source]¶
Bases:
DPABoardLimit
Class for checking FEP1 Actel limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- class chandra_limits.thermal.acis.FEP1MongLimit(model_spec=None, margin=0.04999)[source]¶
Bases:
DPABoardLimit
Class for checking FEP1 Mongoose limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.
- class chandra_limits.thermal.acis.PSMCLimit(model_spec=None, margin=0.04999)[source]¶
Bases:
ThermalLimit
Class for checking 1PDEAAT limit violations
- Parameters:
- model_specstring or Path object, optional
The thermal model specification file to use when obtaining the limits. If not specified, the one from the chandra_models repository will be used.
- marginfloat, optional
Allowed extra margin for this model above/below a planning limit, in the temperature units of the model. Default: 0.04999
Methods
get_limit_line
(states[, which])Obtain a LimitLine object from a set of commanded states and an optional set of times at which the limit will be evaluated at.