Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of the 1DPAMYT model and setup.py mods #72

Merged
merged 11 commits into from
Apr 29, 2024
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ repos:
rev: 23.7.0
hooks:
- id: black
language_version: python3.10
language_version: python3.11

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.282
hooks:
- id: ruff
args: ["--fix", "--format=github"]
language_version: python3.10
language_version: python3.11
73 changes: 73 additions & 0 deletions acis_thermal_check/ReleaseNotes_1DPAMYT_V1.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@


Change Description
==================

The 1PIN1AT and 1CRBT transducer failures had minimal mission impact.

1DPAMZT is used as a proxy for the internal BEP and FEP PC board temperatures.
As such, it is an important value in determining the health and performance
of the instrument.

If the 1DPAMZT transducer fails, we could switch to using the 1DPAMYT
transducer values to substitute for the 1DPAMZT values. A new 1DPAMYT
thermal model was created and fitted. Limits were selected so that the 1DPAMYT
limits reflect the same FEP and BEP board temperatures as the 1DPAMZT limits.

The new model uses the new Chandra Limits.


Files Changed:
==============

The changed and added files can be seen in this PR:

https://github.com/acisops/acis_thermal_check/pull/72
https://github.com/sot/chandra_models/pull/124
https://github.com/sot/chandra_limits/pull/14



Testing:
========

The model and the updated Chandra Limits code was tested, using the
following loads:

JAN2224
JAN2324
FEB1124
FEB1924
FEB2624
MAR0424
MAR1124
MAR1824
APR0124
APR0824
APR1524
APR2024

The predicted vs actual temperatures were compared and found to agree
within acceptable limits.

The ACIS load review software will be modified to execute this new model
in order to continue the test of the model and the fit. But it will not be used
to plan missions.


Interface impacts
=================

None


Review
======

ACIS Ops


Deployment Plan
===============

Deploy as soon as FSDS approval given.
72 changes: 72 additions & 0 deletions acis_thermal_check/apps/dpamyt_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env python

"""
========================
1dpamyt_check
========================

This code generates backstop load review outputs for checking the ACIS
DPA temperature 1DPAMYT. It also generates 1DPAMYT model validation
plots comparing predicted values to telemetry for the previous three
weeks.
"""
import sys

import matplotlib
from chandra_limits import DPAMYTLimit

from acis_thermal_check import ACISThermalCheck, get_options

# Matplotlib setup
# Use Agg backend for command-line (non-interactive) operation
matplotlib.use("Agg")


class DPAMYTCheck(ACISThermalCheck):
_limit_class = DPAMYTLimit

def __init__(self):
valid_limits = [(1, 2.0), (50, 1.0), (99, 2.0)]

# Specify the temperature where only those temps greater
# than this temperature will be displayed on the histogram.
hist_limit = [20.0]

# Call the superclass' __init__ with the arguments
super().__init__("1dpamyt", "dpamyt", valid_limits, hist_limit)

def _calc_model_supp(self, model, state_times, states, ephem, state0):
"""
Update to initialize the dpa0 pseudo-node. If 1dpamyt
has an initial value (T_dpa) - which it does at
prediction time (gets it from state0), then T_dpa0
is set to that. If we are running the validation,
T_dpa is set to None so we use the dvals in model.comp

NOTE: If you change the name of the dpa0 pseudo node you
have to edit the new name into the if statement
below.
"""
if "dpa0" in model.comp:
if state0 is None:
T_dpa0 = model.comp["1dpamyt"].dvals
else:
T_dpa0 = state0["1dpamyt"]
model.comp["dpa0"].set_data(T_dpa0, model.times)


def main():
args = get_options()
dpamyt_check = DPAMYTCheck()
try:
dpamyt_check.run(args)
except Exception as msg:
if args.traceback:
raise
else:
print("ERROR:", msg)
sys.exit(1)


if __name__ == "__main__":
main()
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"console_scripts": [
"dea_check = acis_thermal_check.apps.dea_check:main",
"dpa_check = acis_thermal_check.apps.dpa_check:main",
"dpamyt_check = acis_thermal_check.apps.dpamyt_check:main",
"psmc_check = acis_thermal_check.apps.psmc_check:main",
"acisfp_check = acis_thermal_check.apps.acisfp_check:main",
"fep1_mong_check = acis_thermal_check.apps.fep1_mong_check:main",
Expand All @@ -29,8 +30,8 @@
use_scm_version=True,
setup_requires=["setuptools_scm", "setuptools_scm_git_archive"],
description="ACIS Thermal Model Library",
author="John ZuHone",
author_email="john.zuhone@cfa.harvard.edu",
author="ACIS Ops",
author_email="acisdude@cfa.harvard.edu",
url="https://github.com/acisops/acis_thermal_check",
data_files=[("templates", templates), ("data", data)],
include_package_data=True,
Expand Down
Loading