Chandra thermal model guideline limits¶
This module provides a mechanism to maintain and access the history of guideline thermal
limit values. For example, you might want to plot the time history of the ACA planning
limit which constrains the value of the ACA CCD temperature (AACCCDPT MSID).
This combines manual (hand-curated) inputs of limit changes with automatically-generated limit changes from the history of
chandra_modelsxija model spec files.Everything is keyed by the relevant MSID to which the limit applies.
The source and dates of limit changes is a hand-curated file.
Effective date is the date when a model is first used in loads. This is scraped from starcheck outputs.
Accessing and using data products¶
Limit history by MSID¶
The data product you are most likely use is the
Limit history as tables per MSID.
Each of these tables provides the date at which a limit update was effective
(date_eff) along with relevant information about the limit values. For example, the
DEA limit (1deamzt) is as follows:
source model_name date_eff planning.warning.high unit version odb.caution.high odb.warning.high
-------------- ---------- ---------- --------------------- ---- ------- ---------------- ----------------
manual -- 2016-03-03 35.5 degC -- -- --
manual -- 2019-08-28 36.5 degC -- -- --
manual -- 2020-12-17 37.5 degC -- -- --
chandra_models dea_spec 2021-07-09 37.5 degC 3.35.2 39.5 42.5
chandra_models dea_spec 2022-06-20 38.5 degC 3.40.1 40.5 42.5
You can access the limit history data in a few different ways. First, simply navigate to the tables in a browser using the link above, and then click on the particular MSID table of interest to you.
Second, in Python you can read the table with the following code, which by default reads the table from the CXC website:
>>> import chandra_limits.guidelines as gl
>>> msid = "1deamzt"
>>> limit_hist = gl.read_chandra_models_limit_history_by_msid(msid)
>>> limit_hist
<Table length=5>
source model_name date_eff planning.warning.high unit version odb.caution.high odb.warning.high
str14 str8 str10 float64 str4 str6 float64 float64
-------------- ---------- ---------- --------------------- ---- ------- ---------------- ----------------
manual -- 2016-03-03 35.5 degC -- -- --
manual -- 2019-08-28 36.5 degC -- -- --
manual -- 2020-12-17 37.5 degC -- -- --
chandra_models dea_spec 2021-07-09 37.5 degC 3.35.2 39.5 42.5
chandra_models dea_spec 2022-06-20 38.5 degC 3.40.1 40.5 42.5
If you are on the HEAD network you can also access local files:
>>> from pathlib import Path
>>> import os
>>> SKA = Path(os.environ["SKA"])
>>> data_dir = SKA / "www" / "chandra_limits" / "guidelines" / "limit_history"
>>> limit_hist = gl.read_chandra_models_limit_history_by_msid(msid, data_dir)
The -- entries represent missing values where the limit or model did not yet exist.
Finally, if the code above gives you an ModuleNotFoundError, you can also get the
data using this code:
>>> from astropy.table import Table
>>> msid = "1deamzt"
>>> url_base = "https://cxc.cfa.harvard.edu/mta/ASPECT/chandra_limits/guidelines/limit_history/"
>>> url = url_base + f"{msid}.dat"
>>> limit_hist = Table.read(url, format="ascii.fixed_width_two_line", fill_values=[("--", "0")])
Effective date of chandra_models versions¶
The Effective date of chandra_models versions
is the load name date when a chandra_models version was first used in load products.
You can read this with the
read_chandra_models_effective_dates() function.
- ::
>>> dates_eff = gl.read_chandra_models_effective_dates()
Limit history of chandra_models as single JSON file¶
The Limit history of chandra_models as a JSON file contains the complete history of all limits applied to the chandra_models in a single dictionary data structure.
This can be read using
read_chandra_models_limit_history():
>>> limit_hist = gl.read_chandra_models_limit_history()
The output is a dictionary of limit changes in chandra_models by msid and
model_name.
Manual inputs¶
The Manual inputs directory
contains hand-curated limit changes that are not in the chandra_models history. These
can be read using read_manual_inputs():
>>> manual_inputs = gl.read_manual_inputs()
Sources of history¶
The Sources of history (e.g. chandra_models model_name or manual inputs) directory
contains the source of limit history information for each MSID. This can be read using
read_history_sources():
>>> history_sources = gl.read_history_sources("aaccccdpt")
>>> history_sources
<Table length=2>
date_eff source model_name
str10 str14 str8
---------- -------------- ----------
1999-01-01 manual --
2021-07-09 chandra_models aca_spec