Commit 34f9bb57 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

updated rules for L1 file names

parent c45eec07
...@@ -278,17 +278,21 @@ def get_psf(fitsfile, outdir=None, psf_size=101, degree=2, variability=0.3, fwhm ...@@ -278,17 +278,21 @@ def get_psf(fitsfile, outdir=None, psf_size=101, degree=2, variability=0.3, fwhm
raise OSError('No sex or psfex SHELL command found! Please install') raise OSError('No sex or psfex SHELL command found! Please install')
rootname, _ = os.path.splitext(fitsfile) rootname, _ = os.path.splitext(fitsfile)
indpos = str.rfind(rootname, '_img') # indpos = str.rfind(rootname, '_img')
flagfile = rootname[:indpos] + '_flg.fits' # flagfile = rootname[:indpos] + '_flg.fits'
weightfile = rootname[:indpos] + '_wht.fits' # weightfile = rootname[:indpos] + '_wht.fits'
flagfile = fitsfile.replace("_img", "_flg")
weightfile = fitsfile.replace("_img", "_wht")
head = fits.getheader(fitsfile, 0) head = fits.getheader(fitsfile, 0)
gain = head['exptime'] gain = head['exptime']
saturate = 50000.0 / gain saturate = 50000.0 / gain
# fitsname,_=os.path.splitext(fitsfile) # fitsname,_=os.path.splitext(fitsfile)
if outdir is not None: if outdir is not None:
_, filename = os.path.split(rootname[:indpos]) # _, filename = os.path.split(rootname[:indpos])
fitsname = os.path.join(outdir, filename) # fitsname = os.path.join(outdir, filename)
fitsname = os.path.join(outdir, os.path.basename(fitsfile))
sexfile = os.path.join(CONFIG_PATH, 'csst_psfex.sex') sexfile = os.path.join(CONFIG_PATH, 'csst_psfex.sex')
covfile = os.path.join(CONFIG_PATH, filter_name) covfile = os.path.join(CONFIG_PATH, filter_name)
...@@ -383,10 +387,14 @@ def photometry(fitsfile, outdir=None, detect_thresh=1.0, analysis_thresh=1.0, cl ...@@ -383,10 +387,14 @@ def photometry(fitsfile, outdir=None, detect_thresh=1.0, analysis_thresh=1.0, cl
# get flag and weight images # get flag and weight images
# flagfile,weightfile=get_flagweght(date,ccd) # flagfile,weightfile=get_flagweght(date,ccd)
rootname, _ = os.path.splitext(fitsfile)
indpos = str.rfind(rootname, '_img') # rootname, _ = os.path.splitext(fitsfile)
flagfile = rootname[:indpos] + '_flg.fits' # indpos = str.rfind(rootname, '_img')
weightfile = rootname[:indpos] + '_wht.fits' # flagfile = rootname[:indpos] + '_flg.fits'
# weightfile = rootname[:indpos] + '_wht.fits'
flagfile = fitsfile.replace("_img", "_flg")
weightfile = fitsfile.replace("_img", "_wht")
gain = head['exptime'] gain = head['exptime']
types = {'sky': 'BACKGROUND', 'seg': 'SEGMENTATION', 'mod': 'MODELS', 'res': '-MODELS'} types = {'sky': 'BACKGROUND', 'seg': 'SEGMENTATION', 'mod': 'MODELS', 'res': '-MODELS'}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment