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

remove special case anomalies and make all caps #1438

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions jwql/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
"cosmic_ray_shower": ["miri"],
"column_pull_up": ["miri"],
"column_pull_down": ["miri"],
"Noticeable_MSA_Leakage": ["nirspec"],
"noticeable_msa_leakage": ["nirspec"],
"dragons_breath": ["nircam"],
"MRS_Glow": ["miri"],
"MRS_Zipper": ["miri"],
"mrs_glow": ["miri"],
"mrs_zipper": ["miri"],
"internal_reflection": ["miri"],
"new_short": ["nirspec"], # Only for MOS observations
"row_pull_up": ["miri"],
"row_pull_down": ["miri"],
"LRS_Contamination": ["miri"],
"lrs_contamination": ["miri"],
"tree_rings": ["miri"],
"scattered_light": ["niriss", "nircam", "nirspec"],
"claws": ["nircam"],
Expand All @@ -107,47 +107,40 @@
"other": ["fgs", "miri", "nircam", "niriss", "nirspec"],
"needs_discussion": ["fgs", "miri", "nircam", "niriss", "nirspec"],
}
# anomalies that shouldn't be 'titleized'
special_cases = ["Noticeable_MSA_Leakage", "MRS_Glow", "MRS_Zipper", "LRS_Contamination"]

# Defines the possible anomalies to flag through the web app
ANOMALY_CHOICES = [
(anomaly, inflection.titleize(anomaly))
if anomaly not in special_cases
else (anomaly, anomaly.replace("_", " "))
(anomaly, anomaly.replace("_", " ").upper())
for anomaly in ANOMALIES_PER_INSTRUMENT
for anomaly in ANOMALIES_PER_INSTRUMENT
]

ANOMALY_CHOICES_FGS = [
(anomaly, inflection.titleize(anomaly))
(anomaly, inflection.titleize(anomaly).upper())
for anomaly in ANOMALIES_PER_INSTRUMENT
if "fgs" in ANOMALIES_PER_INSTRUMENT[anomaly]
]

ANOMALY_CHOICES_MIRI = [
(anomaly, inflection.titleize(anomaly))
if anomaly not in special_cases
else (anomaly, anomaly.replace("_", " "))
(anomaly, anomaly.replace("_", " ").upper())
for anomaly in ANOMALIES_PER_INSTRUMENT
if "miri" in ANOMALIES_PER_INSTRUMENT[anomaly]
]

ANOMALY_CHOICES_NIRCAM = [
(anomaly, inflection.titleize(anomaly))
(anomaly, anomaly.replace("_", " ").upper())
for anomaly in ANOMALIES_PER_INSTRUMENT
if "nircam" in ANOMALIES_PER_INSTRUMENT[anomaly]
]

ANOMALY_CHOICES_NIRISS = [
(anomaly, inflection.titleize(anomaly))
(anomaly, anomaly.replace("_", " ").upper())
for anomaly in ANOMALIES_PER_INSTRUMENT
if "niriss" in ANOMALIES_PER_INSTRUMENT[anomaly]
]

ANOMALY_CHOICES_NIRSPEC = [
(anomaly, inflection.titleize(anomaly))
if anomaly not in special_cases
else (anomaly, anomaly.replace("_", " "))
(anomaly, anomaly.replace("_", " ").upper())
for anomaly in ANOMALIES_PER_INSTRUMENT
if "nirspec" in ANOMALIES_PER_INSTRUMENT[anomaly]
]
Expand Down