Commit ac2b0ff2 authored by jonas.sinjan's avatar jonas.sinjan
Browse files

keyword i-quv ctalk in output header

parent c2681504
......@@ -75,7 +75,7 @@ flatfield_fits_filename = '/data/slam/home/sinjan/fits_files/april_avgd_2020_fla
darkfield_fits_filename = '../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V202002281636_0022210004_000.fits'
science_april = ['/data/slam/home/sinjan/fits_files/' + i for i in science_nov]
science_nov = ['/data/slam/home/sinjan/fits_files/' + i for i in science_nov]
input_dict = {
'data_f': science_nov,
......
l1/2021-04-21/solo_L1_phi-hrt-ilam_20210421T120003_V202107221049C_0144210101.fits.gz
l1/2021-04-24/solo_L1_phi-hrt-ilam_20210424T120003_V202107221049C_0144240101.fits.gz
l1/2021-04-25/solo_L1_phi-hrt-ilam_20210425T120002_V202107221049C_0144250101.fits.gz
l1/2021-04-26/solo_L1_phi-hrt-ilam_20210426T120002_V202107221049C_0144260101.fits.gz
l1/2021-04-27/solo_L1_phi-hrt-ilam_20210427T120002_V202107221049C_0144270101.fits.gz
l1/2021-04-28/solo_L1_phi-hrt-ilam_20210428T120003_V202107221050C_0144280101.fits.gz
l1/2021-04-28/solo_L1_phi-hrt-ilam_20210428T130238_V202107221050C_0164281001.fits.gz
l1/2020-04-20/solo_L1_phi-hrt-ilam_20200420T141802_V202108011112C_0024160030.fits.gz
......@@ -747,6 +747,17 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate
except AssertionError:
print("ctalk_params is not in the required (2,3) shape, please reconcile")
for scan_hdr in hdr_arr:
if 'CAL_CRT0' in scan_hdr: #check to make sure the keywords exist
scan_hdr['CAL_CRT0'] = ctalk_params[0,0] #I-Q slope
scan_hdr['CAL_CRT2'] = ctalk_params[0,1] #I-U slope
scan_hdr['CAL_CRT4'] = ctalk_params[0,2] #I-V slope
scan_hdr['CAL_CRT1'] = ctalk_params[1,0] #I-Q offset
scan_hdr['CAL_CRT3'] = ctalk_params[1,1] #I-U offset
scan_hdr['CAL_CRT5'] = ctalk_params[1,2] #I-V offset
ctalk_params = np.repeat(ctalk_params[:,:,np.newaxis], num_of_scans, axis = 2)
cont_stokes = np.mean(data[512:1536,512:1536,0,cpos_arr[0],:], axis = (0,1))
......@@ -873,6 +884,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate
with fits.open(scan) as hdu_list:
print(f"Writing out demod file as: {scan_name_list[count]}_reduced.fits")
hdu_list[0].data = data[:,:,:,:,count]
hdu_list[0].header = hdr_arr[count] #update the calibration keywords
hdu_list.writeto(out_dir + scan_name_list[count] + '_reduced.fits', overwrite=True)
# if isinstance(data_f, str):
......
......@@ -275,18 +275,22 @@ def cmilos(data_f, hdr_arr, wve_axis_arr, data_shape, cpos_arr, data, rte, field
print(f"out_rte_filename neither string nor list, reverting to default: {filename_root}")
with fits.open(file_path) as hdu_list:
hdu_list[0].header = hdr
hdu_list[0].data = rte_data_products
hdu_list.writeto(out_dir+filename_root+'_rte_data_products.fits', overwrite=True)
with fits.open(file_path) as hdu_list:
hdu_list[0].header = hdr
hdu_list[0].data = rte_data_products[5,:,:]
hdu_list.writeto(out_dir+filename_root+'_blos_rte.fits', overwrite=True)
with fits.open(file_path) as hdu_list:
hdu_list[0].header = hdr
hdu_list[0].data = rte_data_products[4,:,:]
hdu_list.writeto(out_dir+filename_root+'_vlos_rte.fits', overwrite=True)
with fits.open(file_path) as hdu_list:
hdu_list[0].header = hdr
hdu_list[0].data = rte_data_products[0,:,:]
hdu_list.writeto(out_dir+filename_root+'_Icont_rte.fits', overwrite=True)
......
Markdown is supported
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