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

no WISE_VAR_QSO secondary targets in SV2 #150

Open
moustakas opened this issue Jan 4, 2025 · 0 comments
Open

no WISE_VAR_QSO secondary targets in SV2 #150

moustakas opened this issue Jan 4, 2025 · 0 comments

Comments

@moustakas
Copy link
Member

This line and this line in qso_cat_utils will crash because there were no WISE_VAR_QSO secondary targets in SV2.

from desitarget.sv2.sv2_targetmask import scnd_mask as sv2_scnd_mask
sv2_scnd_mask.mask('WISE_VAR_QSO')
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[2], line 1
----> 1 sv2_scnd_mask.mask('WISE_VAR_QSO')

File /global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/desiutil/main/py/desiutil/bitmask.py:215, in BitMask.mask(self, name_or_num)
    213 mask = 0
    214 for name in name_or_num.split('|'):
--> 215     mask |= self._bits[name].mask
    216 return mask

KeyError: 'WISE_VAR_QSO'

It's a low-priority fix, but I tripped on it because I copied the logic used here into FastSpecFit in desihub/fastspecfit#201.

FWIW, the fix I propose is something like:

if 'WISE_VAR_QSO' in sv2_scnd_mask.names():
    # do stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant