desihub / desitarget

DESI Targeting
BSD 3-Clause "New" or "Revised" License
18 stars 23 forks source link

Modified read_mtl_ledger to change datamodel for different survey types #756

Closed jalasker closed 3 years ago

jalasker commented 3 years ago

While creating the code for the alternate MTLs (currently in https://github.com/desihub/LSS/tree/AltFATools/py/LSS/SV3/altmtltools), I had trouble with getting desitarget.io to read the SV3 MTLs in a way that would not cause errors involving the code later searching for "DESI_TARGET" columns rather than "SV3_DESI_TARGET" columns. This minor change appears to fix the issue.

geordie666 commented 3 years ago

Can you point me to an example sv3 MTL ledger for which the code is failing? This seems to work fine in the master branch, for instance:

from desitarget import io
a = io.read_mtl_ledger("/global/cfs/cdirs/desi/target/surveyops/mtl/sv3/dark/sv3mtl-dark-hp-2850.ecsv")
[col for col in a.dtype.names if "TARGET" in col] 
Out[]:
['TARGETID',
 'SV3_DESI_TARGET',
 'SV3_BGS_TARGET',
 'SV3_MWS_TARGET',
 'SV3_SCND_TARGET',
 'TARGET_STATE']
jalasker commented 3 years ago

Issue was with environment variables not code. Closing without merging.