forked from xmm/arches
revanshe
This commit is contained in:
@@ -29,7 +29,7 @@ events_dir=root_path+'/data/processed'
|
||||
products_dir=root_path+'/products/sas'
|
||||
ds9reg_dir=root_path+'/data/ds9reg'
|
||||
|
||||
imos=1
|
||||
imos=2
|
||||
|
||||
|
||||
create_folder(products_dir)
|
||||
@@ -42,14 +42,17 @@ files = glob.glob(archive_dir+'/*')
|
||||
|
||||
for obsid in files:
|
||||
obsid = os.path.basename(obsid)
|
||||
if(obsid in skip):
|
||||
|
||||
if not (obsid in good):
|
||||
continue
|
||||
|
||||
|
||||
|
||||
work_dir = init_work_dir(obsid, products_dir=products_dir)
|
||||
|
||||
os.chdir(work_dir)
|
||||
|
||||
search_str = f'{events_dir}/{obsid}/????_{obsid}_EMOS{imos}_S???_ImagingEvts.ds'
|
||||
search_str = f'{events_dir}/{obsid}/????_{obsid}_EMOS{imos}_????_ImagingEvts.ds'
|
||||
print(search_str)
|
||||
emfiles = glob.glob(search_str)
|
||||
if not (emfiles):
|
||||
@@ -312,33 +315,34 @@ for obsid in files:
|
||||
|
||||
# Create Clean Events image
|
||||
|
||||
xmax=np.amax(gti_evt_data['X'])
|
||||
xmin=np.amin(gti_evt_data['X'])
|
||||
xmid=(xmax-xmin)/2.+xmin
|
||||
ymax=np.amax(gti_evt_data['Y'])
|
||||
ymin=np.amin(gti_evt_data['Y'])
|
||||
xbin_size=80
|
||||
ybin_size=80
|
||||
NBINS = (int((xmax-xmin)/xbin_size),int((ymax-ymin)/ybin_size))
|
||||
if(len(gti_evt_data['X'])>10):
|
||||
xmax=np.amax(gti_evt_data['X'])
|
||||
xmin=np.amin(gti_evt_data['X'])
|
||||
xmid=(xmax-xmin)/2.+xmin
|
||||
ymax=np.amax(gti_evt_data['Y'])
|
||||
ymin=np.amin(gti_evt_data['Y'])
|
||||
xbin_size=80
|
||||
ybin_size=80
|
||||
NBINS = (int((xmax-xmin)/xbin_size),int((ymax-ymin)/ybin_size))
|
||||
|
||||
plt.subplot(1, 2, pl)
|
||||
plt.subplot(1, 2, pl)
|
||||
|
||||
img_zero_mpl = plt.hist2d(gti_evt_data['X'], gti_evt_data['Y'], NBINS, cmap='GnBu', norm=LogNorm())
|
||||
img_zero_mpl = plt.hist2d(gti_evt_data['X'], gti_evt_data['Y'], NBINS, cmap='GnBu', norm=LogNorm())
|
||||
|
||||
cbar = plt.colorbar(ticks=[10.,100.,1000.])
|
||||
cbar.ax.set_yticklabels(['10','100','1000'])
|
||||
cbar = plt.colorbar(ticks=[10.,100.,1000.])
|
||||
cbar.ax.set_yticklabels(['10','100','1000'])
|
||||
|
||||
plt.title(out_clean_evtFile)
|
||||
plt.xlabel('x')
|
||||
plt.ylabel('y')
|
||||
plt.title(out_clean_evtFile)
|
||||
plt.xlabel('x')
|
||||
plt.ylabel('y')
|
||||
|
||||
plt.text(xmid, ymin-0.1*(ymax-ymin), expression, ha='center')
|
||||
plt.text(xmid, ymin-0.1*(ymax-ymin), expression, ha='center')
|
||||
|
||||
pl=pl+1
|
||||
pl=pl+1
|
||||
|
||||
gti_hdu_list.close()
|
||||
hdu_list.close()
|
||||
plt.show()
|
||||
gti_hdu_list.close()
|
||||
hdu_list.close()
|
||||
plt.show()
|
||||
|
||||
###############################################################################
|
||||
# Define some parameters to produce the image and the name of the output file #
|
||||
|
||||
Reference in New Issue
Block a user