From 2d8a5b22665fc0ed32d434a7c2e24123155fcbbe Mon Sep 17 00:00:00 2001 From: Ziyao Zhang Date: Sat, 13 Apr 2019 01:27:03 -0700 Subject: [PATCH 1/3] Fix target labels --- map/cats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/map/cats.py b/map/cats.py index ab4c8a32..d0a056d9 100644 --- a/map/cats.py +++ b/map/cats.py @@ -577,10 +577,10 @@ def desitarget_color_names(T): 1: 'ELG', 2: 'QSO', # 8: 'LRG_NORTH', - # 9: 'ELG_NORTH', + 9: 'ELG_NORTH', # 10: 'QSO_NORTH', # 16: 'LRG_SOUTH', - # 17: 'ELG_SOUTH', + 17: 'ELG_SOUTH', # 18: 'QSO_SOUTH', 32: 'SKY', 33: 'STD_FSTAR', @@ -593,7 +593,7 @@ def desitarget_color_names(T): # 60: 'BGS_ANY', # 61: 'MWS_ANY', 62: 'ANCILLARY_ANY', - }.get(b) for b in desibits] + }.get(b) for b in desibits][:1] # Ony display one name to prevent clutter bgsnames = [{ 0: 'BGS_FAINT', 1: 'BGS_BRIGHT', From d300608ef724b01d39abd77a963af18b3fa4d90a Mon Sep 17 00:00:00 2001 From: Ziyao Zhang Date: Sat, 13 Apr 2019 20:54:10 -0700 Subject: [PATCH 2/3] Implement bitnames_veto mechanism --- map/cats.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/map/cats.py b/map/cats.py index d0a056d9..ae839da7 100644 --- a/map/cats.py +++ b/map/cats.py @@ -576,7 +576,7 @@ def desitarget_color_names(T): 0: 'LRG', 1: 'ELG', 2: 'QSO', - # 8: 'LRG_NORTH', + 8: 'LRG_NORTH', 9: 'ELG_NORTH', # 10: 'QSO_NORTH', # 16: 'LRG_SOUTH', @@ -593,7 +593,7 @@ def desitarget_color_names(T): # 60: 'BGS_ANY', # 61: 'MWS_ANY', 62: 'ANCILLARY_ANY', - }.get(b) for b in desibits][:1] # Ony display one name to prevent clutter + }.get(b) for b in desibits] bgsnames = [{ 0: 'BGS_FAINT', 1: 'BGS_BRIGHT', @@ -614,6 +614,30 @@ def desitarget_color_names(T): }.get(b) for b in mwsbits] bitnames = [n for n in desinames + bgsnames + mwsnames if n is not None] + # If any of the names in value exists, remove the key in bitnames + # Example: if 'ELG' exists, remove 'ELG_SOUTH' and 'ELG_NORTH' + bitnames_veto = { + 'ELG_SOUTH': ['ELG'], + 'ELG_NORTH': ['ELG'], + 'QSO_SOUTH': ['QSO'], + 'QSO_NORTH': ['QSO'], + 'LRG_NORTH': ['LRG'], + 'LRG_SOUTH': ['LRG'], + 'BGS_FAINT_NORTH': ['BGS_FAINT'], + 'BGS_FAINT_SOUTH': ['BGS_FAINT'], + 'BGS_BRIGHT_NORTH': ['BGS_BRIGHT'], + 'BGS_BRIGHT_SOUTH': ['BGS_BRIGHT'], + 'BGS_ANY': ['BGS_FAINT', 'BGS_BRIGHT', 'BGS_FAINT_NORTH', + 'BGS_BRIGHT_NORTH', 'BGS_FAINT_SOUTH', 'BGS_BRIGHT_SOUTH', + 'BGS_KNOWN_ANY', 'BGS_KNOWN_COLLIDED', 'BGS_KNOWN_SDSS', + 'BGS_KNOWN_BOSS'], + 'MWS_ANY': ['MWS_MAIN', 'MWS_WD', 'MWS_NEARBY', 'MWS_MAIN_VERY_FAINT'], + } + for name in bitnames[:]: + # As described in the comment above, if any of the better_names + # exist in bitnames, remove the current name + if any([better_name in bitnames for better_name in bitnames_veto.get(name, [])]): + bitnames.remove(name) names.append(', '.join(bitnames)) From 7ea1c903ea746074349b4ecb790db2cd51974aa3 Mon Sep 17 00:00:00 2001 From: Ziyao Zhang Date: Sat, 13 Apr 2019 20:54:26 -0700 Subject: [PATCH 3/3] Enable additional target names --- map/cats.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/map/cats.py b/map/cats.py index ae839da7..52265edc 100644 --- a/map/cats.py +++ b/map/cats.py @@ -578,10 +578,10 @@ def desitarget_color_names(T): 2: 'QSO', 8: 'LRG_NORTH', 9: 'ELG_NORTH', - # 10: 'QSO_NORTH', - # 16: 'LRG_SOUTH', + 10: 'QSO_NORTH', + 16: 'LRG_SOUTH', 17: 'ELG_SOUTH', - # 18: 'QSO_SOUTH', + 18: 'QSO_SOUTH', 32: 'SKY', 33: 'STD_FSTAR', 34: 'STD_WD', @@ -590,17 +590,17 @@ def desitarget_color_names(T): 50: 'BRIGHT_OBJECT', 51: 'IN_BRIGHT_OBJECT', 52: 'NEAR_BRIGHT_OBJECT', - # 60: 'BGS_ANY', - # 61: 'MWS_ANY', + 60: 'BGS_ANY', + 61: 'MWS_ANY', 62: 'ANCILLARY_ANY', }.get(b) for b in desibits] bgsnames = [{ 0: 'BGS_FAINT', 1: 'BGS_BRIGHT', - # 8: 'BGS_FAINT_NORTH', - # 9: 'BGS_BRIGHT_NORTH', - # 16: 'BGS_FAINT_SOUTH', - # 17: 'BGS_BRIGHT_SOUTH', + 8: 'BGS_FAINT_NORTH', + 9: 'BGS_BRIGHT_NORTH', + 16: 'BGS_FAINT_SOUTH', + 17: 'BGS_BRIGHT_SOUTH', 40: 'BGS_KNOWN_ANY', 41: 'BGS_KNOWN_COLLIDED', 42: 'BGS_KNOWN_SDSS',