SWIMS Wiki
sample_recipe をテンプレートにして作成
開始行:
[[Data_Reduction/Imaging_Data_Reduction]]
&COLOR(red){[Fix] Apr 7, 2022: 'FileNotFoundError...
#pre{{
import os
import glob
# input files with the absolute path.
infiles = {
"J1": {
"b1": ["/data/det_b/SWSB00008031.fits", "/data/de...
"b2": ["/data/det_b/SWSB00008032.fits", "/data/de...
},
"H1": {
"r1": ["/data/det_r/SWSR00009021.fits", "/data/de...
"r2": ["/data/det_r/SWSR00009022.fits", "/data/de...
}
}
#########################################################...
# essential parameters
n_iter=2; n_start=0; mag_min_wcs=14; mag_max_wcs=20; dete...
mag_min_thrus = {"J1": 15.0, "H1": 16.0}
mag_max_thrus = {"J1": 17.0, "H1": 17.5}
pwd = os.getcwd()
for band in infiles.keys():
# prepare a directory for each band data.
work_dir = os.path.join(pwd, band)
if not os.path.exists(work_dir):
os.makedirs(work_dir)
os.chdir(work_dir)
mag_min_thru = mag_min_thrus[band.upper()]
mag_max_thru = mag_max_thrus[band.upper()]
# reduce data for each detector.
for armch in infiles[band].keys():
in_arr = infiles[band][armch]
exec(open("/work/swsred/reduce_all.py").read())
# -> flat-fielded, sky-subtracted, and wcs-correc...
# collect all the indiviaual frames reduced for all d...
wc_arr = glob.glob("wcSWS*.fits")
wc_arr.sort()
# filenames of the corresponding weight maps.
wht_arr = [in_fits.replace("wcSWS", "SWS").replace("....
# filenames for the mosaicked products to be created.
out_fits = "fs12_{}.fits".format(band.lower())
out_wht_fits = out_fits.replace(".fits", "_wht.fits")
out_exp_fits = out_fits.replace(".fits", "_exp.fits")
out_clip_log = out_fits.replace(".fits", "_clip.log")
# mosaic the 'wc' frames.
swarp_config = swsred.swarp.get_default_config()
swarp_config["IMAGEOUT_NAME"] = out_fits
swarp_config["WEIGHTOUT_NAME"] = out_wht_fits
swarp_config["WEIGHT_TYPE"] = "MAP_WEIGHT"
swarp_config["WEIGHT_IMAGE"] = wht_arr
swarp_config["RESCALE_WEIGHTS"] = "N"
swarp_config["WRITE_FILEINFO"] = "N"
swarp_config["CLIP_LOGNAME"] = out_clip_log
swsred.swarp.swarp(wc_arr, swarp_config)
# make an exposure map for the mosaicked frame.
swsred.make_exposure_map.make_exposure_map(wc_arr, ou...
swsred.hedit.hedit_1(out_fits, {"EXP_TOT": (astropy.i...
frame = swsred.frame_info.FrameInfo(out_fits)
# fetch 2MASS catalog.
refcat_thru = swsred.tmc.TMC()
refcat_thru.keep_file = False
refcat_thru.fetch_by_fits(out_fits, crop=True)
refcat_thru.clean()
refcat_thru.poserr_cut()
refcat_thru.ra.unit = astropy.units.degree
refcat_thru.dec.unit = astropy.units.degree
refcat_thru_ra = refcat_thru.ra.copy()
refcat_thru_dec = refcat_thru.dec.copy()
refcat_thru_mag = refcat_thru.magAB_at(frame.lam_c).c...
refcat_thru_e_mag = refcat_thru.e_magAB_at(frame.lam_...
# correct for positional offset (not sure but exists).
refcat_thru_ra -= 0.1 / 3600
refcat_thru_dec -= 0.2 / 3600
# evaluate a throughput of the mosaicked frame.
sex_params = swsred.evaluate.SEX_PARAMS_THRU
sex_config = swsred.sextractor.get_default_config()
sex_config["DETECT_THRESH"] = detect_thresh_thru
sex_config["CATALOG_TYPE"] = "ASCII_HEAD"
sex_config["WEIGHT_TYPE"] = "MAP_WEIGHT"
sex_config["PHOT_APERTURES"] = d_aper
sex_config["WEIGHT_IMAGE"] = out_wht_fits
sex_tbl = swsred.sextractor.sextractor_1(out_fits, pa...
sex_tbl.remove_rows(sex_tbl["FLAGS"] > 4)
sex_tbl.remove_rows(sex_tbl["FLAGS"] == 2) # blended ...
tbl = swsred.evaluate.thru_1(out_fits, sex_tbl["XWIN_...
# evaluate a limiting magnitude of the mosaicked frame.
swsred.calc_lim_mag.calc_lim_mag(out_fits, mask_fits=...
}}
終了行:
[[Data_Reduction/Imaging_Data_Reduction]]
&COLOR(red){[Fix] Apr 7, 2022: 'FileNotFoundError...
#pre{{
import os
import glob
# input files with the absolute path.
infiles = {
"J1": {
"b1": ["/data/det_b/SWSB00008031.fits", "/data/de...
"b2": ["/data/det_b/SWSB00008032.fits", "/data/de...
},
"H1": {
"r1": ["/data/det_r/SWSR00009021.fits", "/data/de...
"r2": ["/data/det_r/SWSR00009022.fits", "/data/de...
}
}
#########################################################...
# essential parameters
n_iter=2; n_start=0; mag_min_wcs=14; mag_max_wcs=20; dete...
mag_min_thrus = {"J1": 15.0, "H1": 16.0}
mag_max_thrus = {"J1": 17.0, "H1": 17.5}
pwd = os.getcwd()
for band in infiles.keys():
# prepare a directory for each band data.
work_dir = os.path.join(pwd, band)
if not os.path.exists(work_dir):
os.makedirs(work_dir)
os.chdir(work_dir)
mag_min_thru = mag_min_thrus[band.upper()]
mag_max_thru = mag_max_thrus[band.upper()]
# reduce data for each detector.
for armch in infiles[band].keys():
in_arr = infiles[band][armch]
exec(open("/work/swsred/reduce_all.py").read())
# -> flat-fielded, sky-subtracted, and wcs-correc...
# collect all the indiviaual frames reduced for all d...
wc_arr = glob.glob("wcSWS*.fits")
wc_arr.sort()
# filenames of the corresponding weight maps.
wht_arr = [in_fits.replace("wcSWS", "SWS").replace("....
# filenames for the mosaicked products to be created.
out_fits = "fs12_{}.fits".format(band.lower())
out_wht_fits = out_fits.replace(".fits", "_wht.fits")
out_exp_fits = out_fits.replace(".fits", "_exp.fits")
out_clip_log = out_fits.replace(".fits", "_clip.log")
# mosaic the 'wc' frames.
swarp_config = swsred.swarp.get_default_config()
swarp_config["IMAGEOUT_NAME"] = out_fits
swarp_config["WEIGHTOUT_NAME"] = out_wht_fits
swarp_config["WEIGHT_TYPE"] = "MAP_WEIGHT"
swarp_config["WEIGHT_IMAGE"] = wht_arr
swarp_config["RESCALE_WEIGHTS"] = "N"
swarp_config["WRITE_FILEINFO"] = "N"
swarp_config["CLIP_LOGNAME"] = out_clip_log
swsred.swarp.swarp(wc_arr, swarp_config)
# make an exposure map for the mosaicked frame.
swsred.make_exposure_map.make_exposure_map(wc_arr, ou...
swsred.hedit.hedit_1(out_fits, {"EXP_TOT": (astropy.i...
frame = swsred.frame_info.FrameInfo(out_fits)
# fetch 2MASS catalog.
refcat_thru = swsred.tmc.TMC()
refcat_thru.keep_file = False
refcat_thru.fetch_by_fits(out_fits, crop=True)
refcat_thru.clean()
refcat_thru.poserr_cut()
refcat_thru.ra.unit = astropy.units.degree
refcat_thru.dec.unit = astropy.units.degree
refcat_thru_ra = refcat_thru.ra.copy()
refcat_thru_dec = refcat_thru.dec.copy()
refcat_thru_mag = refcat_thru.magAB_at(frame.lam_c).c...
refcat_thru_e_mag = refcat_thru.e_magAB_at(frame.lam_...
# correct for positional offset (not sure but exists).
refcat_thru_ra -= 0.1 / 3600
refcat_thru_dec -= 0.2 / 3600
# evaluate a throughput of the mosaicked frame.
sex_params = swsred.evaluate.SEX_PARAMS_THRU
sex_config = swsred.sextractor.get_default_config()
sex_config["DETECT_THRESH"] = detect_thresh_thru
sex_config["CATALOG_TYPE"] = "ASCII_HEAD"
sex_config["WEIGHT_TYPE"] = "MAP_WEIGHT"
sex_config["PHOT_APERTURES"] = d_aper
sex_config["WEIGHT_IMAGE"] = out_wht_fits
sex_tbl = swsred.sextractor.sextractor_1(out_fits, pa...
sex_tbl.remove_rows(sex_tbl["FLAGS"] > 4)
sex_tbl.remove_rows(sex_tbl["FLAGS"] == 2) # blended ...
tbl = swsred.evaluate.thru_1(out_fits, sex_tbl["XWIN_...
# evaluate a limiting magnitude of the mosaicked frame.
swsred.calc_lim_mag.calc_lim_mag(out_fits, mask_fits=...
}}
ページ名: