From 5cc7f85b8deba4ebc11dc1dc0354d7296e79d0a4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 10 Jul 2019 09:43:42 -0700 Subject: [PATCH 1/3] Allow util.desi_convert_transmission_to_delta_files to read both transmission*.fits and transmission*.fits.gz files --- py/picca/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py/picca/utils.py b/py/picca/utils.py index 37ec3f9a9..299650308 100644 --- a/py/picca/utils.py +++ b/py/picca/utils.py @@ -486,7 +486,10 @@ 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'): + fi = sp.sort(sp.array(['{}/{}/{}/transmission-{}-{}.fits.gz'.format(indir,int(f//100),f,in_nside,f) for f in sp.unique(in_pixs)])) + else: + fi = sp.sort(sp.array(['{}/{}/{}/transmission-{}-{}.fits'.format(indir,int(f//100),f,in_nside,f) for f in sp.unique(in_pixs)])) else: fi = sp.sort(sp.array(infiles)) print('INFO: Found {} files'.format(fi.size)) From 5012ff23cadf12b04a2ec8c1439dbfb05ddce7c8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 11 Jul 2019 13:52:19 -0700 Subject: [PATCH 2/3] Improved the way to treat .fits.gz files --- py/picca/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/picca/utils.py b/py/picca/utils.py index 299650308..edf45296c 100644 --- a/py/picca/utils.py +++ b/py/picca/utils.py @@ -487,9 +487,10 @@ def desi_convert_transmission_to_delta_files(zcat,outdir,indir=None,infiles=None h.close() in_pixs = healpy.ang2pix(in_nside, sp.pi/2.-zcat_dec, zcat_ra, nest=nest) if fi[0].endswith('.gz'): - fi = sp.sort(sp.array(['{}/{}/{}/transmission-{}-{}.fits.gz'.format(indir,int(f//100),f,in_nside,f) for f in sp.unique(in_pixs)])) + endoffile = '.gz' else: - fi = sp.sort(sp.array(['{}/{}/{}/transmission-{}-{}.fits'.format(indir,int(f//100),f,in_nside,f) for f in sp.unique(in_pixs)])) + 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)) From 18f9db583b8e2d068e6c7d569edefe29eba3d563 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 11 Jul 2019 14:23:50 -0700 Subject: [PATCH 3/3] Removed a coma --- py/picca/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/picca/utils.py b/py/picca/utils.py index edf45296c..e1f4bb2d6 100644 --- a/py/picca/utils.py +++ b/py/picca/utils.py @@ -490,7 +490,7 @@ def desi_convert_transmission_to_delta_files(zcat,outdir,indir=None,infiles=None 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)],)) + 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))