Commit 1f0ade8b authored by niejuzi's avatar niejuzi
Browse files

update code

parent 7eaa4054
......@@ -66,7 +66,7 @@ class CsstProcMscPositionCalibration(CsstProcessor):
hdul_flg.append(h1)
hdul_flg.writeto(output_flgnm, overwrite=True)
def run_sextractor(self, ccd_ids):
def run_sextractor(self, fn_list, ccd_ids):
"""
Run sextractor
......@@ -86,14 +86,14 @@ class CsstProcMscPositionCalibration(CsstProcessor):
fn = self.dm.l1_sci(ccd_id=this_ccd_id, suffix="img", ext="fits")
cat_list.append(sex_cat)
# config_sextractor = CONFIG_PATH + "new_csst_realtime.no.weight.sex"
# sex_comd1 = 'sex -c ' + config_sextractor + ' '
# sex_comd2 = fn_list + ' -CATALOG_NAME ' + cat_list
# sex_comd3 = ' -PARAMETERS_NAME ' + CONFIG_PATH + 'csst_realtime.param' + ' -FILTER_NAME ' + CONFIG_PATH + 'csst_realtime.conv' + ' -STARNNW_NAME ' + CONFIG_PATH + 'csst_realtime.nnw'
# sex_comd = sex_comd1 + sex_comd2 + sex_comd3
# print(sex_comd)
# p = Popen(sex_comd, shell=True)
# p.wait()
config_sextractor = CONFIG_PATH + "new_csst_realtime.no.weight.sex"
sex_comd1 = 'sex -c ' + config_sextractor + ' '
sex_comd2 = fn_list + ' -CATALOG_NAME ' + cat_list
sex_comd3 = ' -PARAMETERS_NAME ' + CONFIG_PATH + 'csst_realtime.param' + ' -FILTER_NAME ' + CONFIG_PATH + 'csst_realtime.conv' + ' -STARNNW_NAME ' + CONFIG_PATH + 'csst_realtime.nnw'
sex_comd = sex_comd1 + sex_comd2 + sex_comd3
print(sex_comd)
p = Popen(sex_comd, shell=True)
p.wait()
def combine_catalog(self, ccd_ids):
"""
......@@ -438,11 +438,11 @@ class CsstProcMscPositionCalibration(CsstProcessor):
print('preparing files for position calibration....')
#self.join_data(img_list, wht_list, flg_list)
print('################## run sextractor ###################')
#p = Pool()
#prod_x = partial(self.run_sextractor)
#result = p.map(prod_x, fn_list)
#p.close()
#p.join()
p = Pool()
prod_x = partial(self.run_sextractor,ccd_ids)
result = p.map(prod_x, fn_list)
p.close()
p.join()
self.run_sextractor(ccd_ids)
print('################## sextractor done ###################')
print('############### combine sextractor catalog ###############')
......
......@@ -121,6 +121,7 @@ def do_one_exposure(ver_sim="C5.1", dir_l0="", dir_l1="", dir_pcref="", path_aux
img_list.append(img)
wht_list.append(wht)
flg_list.append(flg)
fn_list.append(dm.l1_sci(ccd_id=this_ccd_id, suffix="img",ext="fits"))
pcProc.run(img_list, wht_list, flg_list, ccd_ids, dir_pcref, 2.0, pm_correct=True, wcs_refine=True, plot=True)
pcProc.cleanup()
......
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