Skip to content

Commit

Permalink
Two bug fixes- how the rejection rate is calculated, and mounting iss…
Browse files Browse the repository at this point in the history
…ues for OSX Monterey
  • Loading branch information
jotaylor committed Sep 21, 2022
1 parent 5a4183d commit c6a7e1d
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions ullyses/calibrate_stis_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env python
import platform
import datetime
import argparse
import os
Expand All @@ -16,9 +17,24 @@

from ullyses_utils.readwrite_yaml import read_config, write_config
from ullyses import plot_stis_data
os.environ["oref"] = "/grp/hst/cdbs/oref/"

OREF_DIR = "/grp/hst/cdbs/oref"
# There are known issues with OSX Monterey and central store.
# The snippet below addresses them for applicable users.
system = platform.system()
if system == "Darwin":
osx_full = platform.release()
osx = float(osx_full[:2])
tester = glob.glob("/grp/hst/cdbs/*")
if osx >= 21 and len(tester) == 0:
monterey = True
os.environ["oref"] = "/Volumes/cdbs/oref/"
OREF_DIR = "/Volumes/cdbs/oref"
else:
monterey = False

if monterey is False:
os.environ["oref"] = "/grp/hst/cdbs/oref/"
OREF_DIR = "/grp/hst/cdbs/oref"
SYM = "~"
NCOLS = 72
SEP = f"\n!{'~'*70}!\n"
Expand Down Expand Up @@ -524,7 +540,7 @@ def check_crrej(self):
# Calculate the rejection fraction and the rate of rejected pixels per sec
n_pix_rej = np.sum(np.array(n_rej))
frac_rej = n_pix_rej/float(n_tot)
rej_rate = n_pix_rej * 1024.0**2 / (t_exp * n_tot)
#rej_rate = n_pix_rej * 1024.0**2 / (t_exp * n_tot)

# Calculate the expected rejection fraction rate given the rate in header
# This is the rej_rate * ratio of number of pixels in full CCD vs extract region (n_tot /CRSPLIT)
Expand Down

0 comments on commit c6a7e1d

Please sign in to comment.