Closed geordie666 closed 2 months ago
This PR replaces any NaN TARGET_RA/TARGET_DEC values with the associated FIBER_RA/FIBER_DEC values via assemble_fibermap().
NaN
TARGET_RA
TARGET_DEC
FIBER_RA
FIBER_DEC
assemble_fibermap()
This should address #1711.
An example of the behavior before and after the update, running:
assemble_fibermap --night 20210422 --outfile $SCRATCH/blat.fits --expid 86004 --overwrite
is in:
fitsio.read("/pscratch/sd/a/adamyers/foo.fits") (before)
fitsio.read("/pscratch/sd/a/adamyers/foo.fits")
fitsio.read("/pscratch/sd/a/adamyers/blat.fits") (after)
fitsio.read("/pscratch/sd/a/adamyers/blat.fits")
Testing:
import numpy as np import fitsio a = fitsio.read("/pscratch/sd/a/adamyers/foo.fits") b = fitsio.read("/pscratch/sd/a/adamyers/blat.fits") ii = np.isnan(a["TARGET_RA"]) print(a[ii][["TARGET_RA", "TARGET_DEC", "FIBER_RA", "FIBER_DEC"]]) print("----") print(b[ii][["TARGET_RA", "TARGET_DEC", "FIBER_RA", "FIBER_DEC"]]) [(nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077) (nan, nan, 170.3261077, -50.3261077)] ---- [(170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077) (170.3261077, -50.3261077, 170.3261077, -50.3261077)]
Looks good, thanks. I slightly expanded the comment to help our future selves remember why this was even necessary. Will merge when tests re-pass.
This PR replaces any
NaN
TARGET_RA
/TARGET_DEC
values with the associatedFIBER_RA
/FIBER_DEC
values viaassemble_fibermap()
.This should address #1711.
An example of the behavior before and after the update, running:
assemble_fibermap --night 20210422 --outfile $SCRATCH/blat.fits --expid 86004 --overwrite
is in:
fitsio.read("/pscratch/sd/a/adamyers/foo.fits")
(before)fitsio.read("/pscratch/sd/a/adamyers/blat.fits")
(after)Testing: