Skip to content

Commit

Permalink
Merge pull request #55 from jzuhone/fix_ha_criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
jzuhone committed Dec 2, 2022
2 parents 614c1e6 + 0659cc0 commit 23ca731
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 47 deletions.
11 changes: 4 additions & 7 deletions acis_thermal_check/acis_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,10 @@ def acis_filter(obsid_interval_list):
low_ct = eachobs["spectra_max_count"] <= 1000
elif eachobs["instrument"] == "ACIS-S":
low_ct = eachobs["spectra_max_count"] <= 2000
elif eachobs["ccd_count"] <= 2 and eachobs["instrument"] == "ACIS-S":
# otherwise, fall back to "old" criteria
# S3 with low counts
low_ct = eachobs["num_counts"] < 300 and "S3" in eachobs["ccds"]
# Is there another chip on? Make sure it's not S1
if eachobs["ccd_count"] == 2:
low_ct &= "S1" not in eachobs["ccds"]
else:
# otherwise, fall back to modified "old" criterion
# of less than 300 total expected counts
low_ct = eachobs["num_counts"] < 300
# Also check grating status
hot_acis = (eachobs["grating"] == "HETG") or low_ct
eachobs['hot_acis'] = hot_acis
Expand Down
2 changes: 1 addition & 1 deletion acis_thermal_check/apps/acisfp_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def make_prediction_plots(self, outdir, states, temps, load_start):

plots['default'] = plots[f"{self.name}_3"]

# Now write all of the plots after possible
# Now write all the plots after possible
# customizations have been made
for key in plots:
if key != self.msid:
Expand Down
28 changes: 4 additions & 24 deletions acis_thermal_check/tests/acisfp/answers/DEC0919A_viol.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,30 @@
"2019:345:04:41:02.816",
"2019:346:17:40:30.816",
"2019:349:09:05:18.816",
"2019:343:04:40:06.816",
"2019:344:02:10:14.816",
"2019:345:22:48:54.816",
"2019:347:15:32:30.816",
"2019:348:17:03:10.816"
"2019:343:04:40:06.816"
],
"datestops": [
"2019:345:08:47:02.816",
"2019:346:21:24:38.816",
"2019:349:12:27:34.816",
"2019:343:07:35:02.816",
"2019:344:04:21:26.816",
"2019:346:01:32:54.816",
"2019:347:18:21:58.816",
"2019:348:19:58:06.816"
"2019:343:07:35:02.816"
],
"temps": [
"-112.16",
"-112.86",
"-112.24",
"-111.28",
"-111.88",
"-111.75",
"-111.69",
"-111.29"
"-111.28"
],
"obsids": [
"23094",
"22727",
"23096",
"23098",
"22515",
"22293",
"22305",
"22499"
"23098"
],
"duration": [
"14.76",
"13.45",
"12.14",
"10.50",
"7.87",
"9.84",
"10.17",
"10.50"
]
}
80 changes: 80 additions & 0 deletions acis_thermal_check/tests/acisfp/answers/FEB2122A_hot_acis.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,78 @@
"22",
"0"
],
[
"23585",
"I1,I3",
"81",
"NONE",
"22",
"100"
],
[
"23700",
"I3,S2,S3,S4",
"199",
"NONE",
"22",
"0"
],
[
"26312",
"I0,I1,I3",
"81",
"NONE",
"22",
"100"
],
[
"24393",
"I2,I3,S2,S3,S4",
"9",
"NONE",
"22",
"0"
],
[
"26333",
"S2,S3,S4",
"160",
"NONE",
"23",
"0"
],
[
"26276",
"S2,S3,S4",
"225",
"NONE",
"23",
"0"
],
[
"25553",
"S2,S3,S4",
"3",
"NONE",
"23",
"0"
],
[
"25544",
"S2,S3,S4",
"3",
"NONE",
"23",
"0"
],
[
"25456",
"I3,S2,S3,S4",
"0",
"NONE",
"23",
"0"
],
[
"25556",
"S3",
Expand All @@ -30,5 +102,13 @@
"NONE",
"23",
"0"
],
[
"25276",
"I2,I3,S1,S2,S3",
"10",
"NONE",
"23",
"0"
]
]
88 changes: 88 additions & 0 deletions acis_thermal_check/tests/acisfp/answers/FEB2822A_hot_acis.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"23",
"0"
],
[
"25141",
"I0,I1,I2,I3",
"135",
"NONE",
"23",
"300"
],
[
"23653",
"S2,S3",
Expand All @@ -15,6 +23,22 @@
"22",
"0"
],
[
"26342",
"S2,S3,S4",
"160",
"NONE",
"23",
"0"
],
[
"26348",
"I0,I1,I2,I3",
"135",
"NONE",
"23",
"300"
],
[
"24705",
"S2,S3",
Expand All @@ -39,12 +63,76 @@
"22",
"0"
],
[
"26349",
"I0,I1,I2,I3",
"135",
"NONE",
"23",
"300"
],
[
"24108",
"I0,I1,I2,I3",
"259",
"NONE",
"22",
"20000"
],
[
"24109",
"I0,I1,I2,I3",
"259",
"NONE",
"22",
"20000"
],
[
"24110",
"I0,I1,I2,I3",
"259",
"NONE",
"22",
"20000"
],
[
"24111",
"I0,I1,I2,I3",
"259",
"NONE",
"22",
"20000"
],
[
"24112",
"I0,I1,I2,I3",
"259",
"NONE",
"22",
"20000"
],
[
"24113",
"I0,I1,I2,I3",
"259",
"NONE",
"22",
"20000"
],
[
"25291",
"S3",
"61",
"NONE",
"23",
"0"
],
[
"26035",
"I3,S1,S2,S3",
"130",
"NONE",
"23",
"0"
]
]

0 comments on commit 23ca731

Please sign in to comment.