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

More FIBERSTATUS bits #2313

Merged
merged 5 commits into from
Aug 8, 2024
Merged

More FIBERSTATUS bits #2313

merged 5 commits into from
Aug 8, 2024

Conversation

julienguy
Copy link
Contributor

This PR addresses issue #2304

  • Add desispec.maskbits.fibermask bits NEARCHARGETRAP ("Fiber trace near charge trap in one of the CCDs") and VARIABLETHRU ("Fiber has throughput variations we cannot model well")
  • Add NEARCHARGETRAPFIBERS and VARIABLETHRUFIBERS to the list of keywords of calibfinder.badfibers
  • Add code in desispec.io.fibermap.assemble_fibermap to set NEARCHARGETRAP and VARIABLETHRU fibermask bits by parsing the DESI_SPECTRO_CALIB configs of all cameras using the calibfinder.badfibers function and the raw fits file headers.

Example:

from desispec.io.fibermap import assemble_fibermap
from desispec.maskbits import fibermask

hdulist = assemble_fibermap(night=20220102, expid=116442)
# INFO:fibermap.py:1147:assemble_fibermap: Bad fibers from DESI_SPECTRO_CALIB: NEARCHARGETRAPFIBERS:[551 552 553]

fmap = hdulist["FIBERMAP"].data
print(fmap["FIBER"][(fmap["FIBERSTATUS"] & fibermask.NEARCHARGETRAP) > 0])
# [551 552 553]

To run this, you need an updated version of DESI_SPECTRO_CALIB svn and you need the environment variable FIBER_ASSIGN_DIR=/global/cfs/cdirs/desi/target/fiberassign/tiles/trunk. It is set by the 'main' version of the DESI environment source /global/cfs/cdirs/desi/software/desi_environment.sh main but not the default one.

So far, DESI_SPECTRO_CALIB has been updated only for the problematic fibers 551,552,553 of SM10 r1. I will work on flagging more bad fibers in the yaml files (but we don't need to wait for those changes to the calibrations to merge this PR).

Copy link
Member

@akremin akremin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Julien, for both the code and for updating the changes.rst. As usual, the changes look good. I'll merge and do further testing as you update more calibration files.

@akremin akremin merged commit 8533a04 into main Aug 8, 2024
26 checks passed
@akremin akremin deleted the more-fiberstatus-bits branch August 8, 2024 20:11
This was referenced Aug 12, 2024
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

Successfully merging this pull request may close these issues.

2 participants