Hi,
I have a bit of a puzzle. I have two coadd files that are identical (i.e. FLUX,MASK,IVAR's are the same) with the exception of the resolution matrices. When the files are run through redrock, NPIXELS in the redrock files are different by 2000 or so. (the script is given below). I don't quite see how this could happen. I could see that the NPIXELS comes from ivar>0 count in redrock, but I don't see anywhere in the code where the resolution matrix is used to mask the ivar. Also the resolution matrix is sensible everywhere I believe.
Do you have any theories of what could be going on ?
I tried to look here
But, it's not easy to figure out what's going on there with all the arrays on different mpi ranks.
Thanks
Script (to be run on nersc)
import astropy.io.fits as pyfits
import numpy as np
import os
f1 = '/global/cfs/cdirs/desi/spectro/redux/koposov/fluxcalib_withfix/tiles/cumulative/80658/20210220/coadd-3-80658-thru20210220.fits'
f2 = '/global/cfs/cdirs/desi/spectro/redux/koposov/fluxcalib_nofix/tiles/cumulative/80658/20210220/coadd-3-80658-thru20210220.fits'
for a in 'BRZ':
for k in ['FLUX', 'IVAR', 'MASK']:
A1, A2 = [pyfits.getdata(_, a + '_' + k) for _ in [f1, f2]]
# checking equality
print(np.all(A1 == A2))
outputs = ['tmp1.fits', 'tmp2.fits']
cmds = [
f'rrdesi -i {_} --targetids 39633220106454453 --outfile {__}'
for _, __ in zip([f1, f2], outputs)
]
[os.system(_) for _ in cmds]
print('npix1', pyfits.getdata(outputs[0])['NPIXELS'])
print('npix2', pyfits.getdata(outputs[1])['NPIXELS'])
Script output:
True
True
....
Total run time: 15.2 seconds
npix1 [6026]
npix2 [7928]
Hi,
I have a bit of a puzzle. I have two coadd files that are identical (i.e. FLUX,MASK,IVAR's are the same) with the exception of the resolution matrices. When the files are run through redrock, NPIXELS in the redrock files are different by 2000 or so. (the script is given below). I don't quite see how this could happen. I could see that the NPIXELS comes from ivar>0 count in redrock, but I don't see anywhere in the code where the resolution matrix is used to mask the ivar. Also the resolution matrix is sensible everywhere I believe.
Do you have any theories of what could be going on ?
I tried to look here
redrock/py/redrock/external/desi.py
Line 574 in 98e0b4f
But, it's not easy to figure out what's going on there with all the arrays on different mpi ranks.
Thanks
Script (to be run on nersc)
Script output: