Skip to content

Commit 023f1ae

Browse files
authored
Merge pull request #72 from acisops/New_1DPAMYT_Model
First version of the 1DPAMYT model and setup.py mods
2 parents 684e767 + 45c286a commit 023f1ae

File tree

4 files changed

+150
-4
lines changed

4 files changed

+150
-4
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ repos:
77
rev: 23.7.0
88
hooks:
99
- id: black
10-
language_version: python3.10
10+
language_version: python3.11
1111

1212
- repo: https://github.com/astral-sh/ruff-pre-commit
1313
rev: v0.0.282
1414
hooks:
1515
- id: ruff
1616
args: ["--fix", "--format=github"]
17-
language_version: python3.10
17+
language_version: python3.11
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
3+
Change Description
4+
==================
5+
6+
The 1PIN1AT and 1CRBT transducer failures had minimal mission impact.
7+
8+
1DPAMZT is used as a proxy for the internal BEP and FEP PC board temperatures.
9+
As such, it is an important value in determining the health and performance
10+
of the instrument.
11+
12+
If the 1DPAMZT transducer fails, we could switch to using the 1DPAMYT
13+
transducer values to substitute for the 1DPAMZT values. A new 1DPAMYT
14+
thermal model was created and fitted. Limits were selected so that the 1DPAMYT
15+
limits reflect the same FEP and BEP board temperatures as the 1DPAMZT limits.
16+
17+
The new model uses the new Chandra Limits.
18+
19+
20+
Files Changed:
21+
==============
22+
23+
The changed and added files can be seen in this PR:
24+
25+
https://github.com/acisops/acis_thermal_check/pull/72
26+
https://github.com/sot/chandra_models/pull/124
27+
https://github.com/sot/chandra_limits/pull/14
28+
29+
30+
31+
Testing:
32+
========
33+
34+
The model and the updated Chandra Limits code was tested, using the
35+
following loads:
36+
37+
JAN2224
38+
JAN2324
39+
FEB1124
40+
FEB1924
41+
FEB2624
42+
MAR0424
43+
MAR1124
44+
MAR1824
45+
APR0124
46+
APR0824
47+
APR1524
48+
APR2024
49+
50+
The predicted vs actual temperatures were compared and found to agree
51+
within acceptable limits.
52+
53+
The ACIS load review software will be modified to execute this new model
54+
in order to continue the test of the model and the fit. But it will not be used
55+
to plan missions.
56+
57+
58+
Interface impacts
59+
=================
60+
61+
None
62+
63+
64+
Review
65+
======
66+
67+
ACIS Ops
68+
69+
70+
Deployment Plan
71+
===============
72+
73+
Deploy as soon as FSDS approval given.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
========================
5+
1dpamyt_check
6+
========================
7+
8+
This code generates backstop load review outputs for checking the ACIS
9+
DPA temperature 1DPAMYT. It also generates 1DPAMYT model validation
10+
plots comparing predicted values to telemetry for the previous three
11+
weeks.
12+
"""
13+
import sys
14+
15+
import matplotlib
16+
from chandra_limits import DPAMYTLimit
17+
18+
from acis_thermal_check import ACISThermalCheck, get_options
19+
20+
# Matplotlib setup
21+
# Use Agg backend for command-line (non-interactive) operation
22+
matplotlib.use("Agg")
23+
24+
25+
class DPAMYTCheck(ACISThermalCheck):
26+
_limit_class = DPAMYTLimit
27+
28+
def __init__(self):
29+
valid_limits = [(1, 2.0), (50, 1.0), (99, 2.0)]
30+
31+
# Specify the temperature where only those temps greater
32+
# than this temperature will be displayed on the histogram.
33+
hist_limit = [20.0]
34+
35+
# Call the superclass' __init__ with the arguments
36+
super().__init__("1dpamyt", "dpamyt", valid_limits, hist_limit)
37+
38+
def _calc_model_supp(self, model, state_times, states, ephem, state0):
39+
"""
40+
Update to initialize the dpa0 pseudo-node. If 1dpamyt
41+
has an initial value (T_dpa) - which it does at
42+
prediction time (gets it from state0), then T_dpa0
43+
is set to that. If we are running the validation,
44+
T_dpa is set to None so we use the dvals in model.comp
45+
46+
NOTE: If you change the name of the dpa0 pseudo node you
47+
have to edit the new name into the if statement
48+
below.
49+
"""
50+
if "dpa0" in model.comp:
51+
if state0 is None:
52+
T_dpa0 = model.comp["1dpamyt"].dvals
53+
else:
54+
T_dpa0 = state0["1dpamyt"]
55+
model.comp["dpa0"].set_data(T_dpa0, model.times)
56+
57+
58+
def main():
59+
args = get_options()
60+
dpamyt_check = DPAMYTCheck()
61+
try:
62+
dpamyt_check.run(args)
63+
except Exception as msg:
64+
if args.traceback:
65+
raise
66+
else:
67+
print("ERROR:", msg)
68+
sys.exit(1)
69+
70+
71+
if __name__ == "__main__":
72+
main()

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"console_scripts": [
1515
"dea_check = acis_thermal_check.apps.dea_check:main",
1616
"dpa_check = acis_thermal_check.apps.dpa_check:main",
17+
"dpamyt_check = acis_thermal_check.apps.dpamyt_check:main",
1718
"psmc_check = acis_thermal_check.apps.psmc_check:main",
1819
"acisfp_check = acis_thermal_check.apps.acisfp_check:main",
1920
"fep1_mong_check = acis_thermal_check.apps.fep1_mong_check:main",
@@ -29,8 +30,8 @@
2930
use_scm_version=True,
3031
setup_requires=["setuptools_scm", "setuptools_scm_git_archive"],
3132
description="ACIS Thermal Model Library",
32-
author="John ZuHone",
33-
author_email="john.zuhone@cfa.harvard.edu",
33+
author="ACIS Ops",
34+
author_email="acisdude@cfa.harvard.edu",
3435
url="https://github.com/acisops/acis_thermal_check",
3536
data_files=[("templates", templates), ("data", data)],
3637
include_package_data=True,

0 commit comments

Comments
 (0)