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

subpriority overrides, take 2 #740

Merged
merged 8 commits into from May 27, 2021
Merged

subpriority overrides, take 2 #740

merged 8 commits into from May 27, 2021

Conversation

sbailey
Copy link
Contributor

@sbailey sbailey commented May 27, 2021

This PR replaces #736 which I will close after submitting this.

This provides tools for overriding SUBPRIORITY when generating target files, to work around the accidental SUBPRIORITY reassignments from fiberassign in May 2021:

  • desitarget.subpriority.override_subpriority(targets, override) - override targets['SUBPRIORITY'] in-place, for those TARGETIDs that appear in the override table.
  • desitarget.subpriority.get_fiberassign_subpriorities used to scrape fiberassign TARGETS HDUs to build override lists for dark, bright, and sky.
    • examples in /global/cscratch1/sd/sjbailey/desi/targets/subpriorities*.fits
    • this can be called from the command line but purposefully isn't put into the default desitarget installation path, e.g.
fadir=/global/cfs/cdirs/desi/target/fiberassign/tiles/trunk
python $DESITARGET/py/desitarget/subpriority.py -o . \
    -i $fadir/001/*.fits.gz $fadir/002/*.fits.gz \
       $fadir/020/*.fits.gz $fadir/021/*.fits.gz
  • select_targets --dark-subpriorities ... --bright-subpriorities ... options to provide override lists
  • select_skies --sky-subpriorities ... and supplement_skies --sky-subpriorities subpriorities-sky.fits options to provide sky SUBPRIORITY override lists
  • more unit tests related to subpriority overrides and writing files

One change of behavior in write_targets et al:

  • subpriority=True means set any SUBPRIORITY==0.0, but leave any SUBPRIOITY>0.0 alone (different than current master which overrides all or nothing)
  • if you really want to override all, set input SUBPRIORITY==0.0 before calling write_targets(..., subpriority=True).

Examples in /global/cscratch1/sd/sjbailey/desi/targets/default and override/. I believe I have tested the following but would appreciate additional checks:

  • targets appear in the same order regardless of override options
  • targets that differ in SUBPRIORITY are in the override list
  • targets with the same SUBPRIORITY are not in the override list
  • TARGETIDs in the override list have the SUBPRIORITIES from that list

@araichoor @geordie666

@coveralls
Copy link

coveralls commented May 27, 2021

Coverage Status

Coverage decreased (-0.04%) to 58.939% when pulling 7715f8b on subpriority2 into b2b3f21 on master.

@dstndstn
Copy link
Contributor

This all looks reasonable to me

@sbailey sbailey merged commit d0ff95a into master May 27, 2021
@sbailey sbailey deleted the subpriority2 branch May 27, 2021 20:14
sbailey added a commit that referenced this pull request May 27, 2021
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.

None yet

3 participants