diff --git a/py/picca/utils.py b/py/picca/utils.py index 37ec3f9a9..e1f4bb2d6 100644 --- a/py/picca/utils.py +++ b/py/picca/utils.py @@ -486,7 +486,11 @@ def desi_convert_transmission_to_delta_files(zcat,outdir,indir=None,infiles=None nest = h['METADATA'].read_header()['HPXNEST'] h.close() in_pixs = healpy.ang2pix(in_nside, sp.pi/2.-zcat_dec, zcat_ra, nest=nest) - fi = sp.sort(sp.array(['{}/{}/{}/transmission-{}-{}.fits'.format(indir,int(f//100),f,in_nside,f) for f in sp.unique(in_pixs)])) + if fi[0].endswith('.gz'): + endoffile = '.gz' + else: + endoffile = '' + fi = sp.sort(sp.array(['{}/{}/{}/transmission-{}-{}.fits{}'.format(indir,int(f//100),f,in_nside,f,endoffile) for f in sp.unique(in_pixs)])) else: fi = sp.sort(sp.array(infiles)) print('INFO: Found {} files'.format(fi.size))