Commit b254888e authored by jonas's avatar jonas
Browse files

str data fix + rm npz save

parent 7158b475
......@@ -245,16 +245,16 @@ def phihrt_pipe(data_f,dark_f,flat_f,norm_f = True, clean_f = False, sigma = 59,
print("The data continuum wavelength position is at index: ", cpos)
cpos_arr = list(cpos)
cpos_arr = [cpos]
if cpos_arr[0] != 0 and cpos_arr[0] != 5:
print("Data continuum position not at 0 or 5th index. Please reconcile. \n Ending Process")
exit()
hdr_arr = list(header)
voltagesData_arr = list(voltagesData)
tuning_constant_arr = list(tuning_constant)
hdr_arr = [header]
voltagesData_arr = [voltagesData]
tuning_constant_arr = [tuning_constant]
else:
printc("ERROR, data_f argument is neither a string nor list containing strings: {} \n Ending Process",data_f,color=bcolors.FAIL)
......@@ -637,7 +637,7 @@ def phihrt_pipe(data_f,dark_f,flat_f,norm_f = True, clean_f = False, sigma = 59,
if ItoQUV:
print(" ")
printc('-->>>>>>> Cross-talk correction from Stokes I to Stokes Q,U,V ',color=bcolors.OKGREEN)
printc('-->>>>>>> Cross-talk correction I to Q,U,V ',color=bcolors.OKGREEN)
start_time = time.time()
......@@ -696,7 +696,9 @@ def phihrt_pipe(data_f,dark_f,flat_f,norm_f = True, clean_f = False, sigma = 59,
data[:,:,3,i,:] = before_ctalk_data[:,:,3,i,:] - before_ctalk_data[:,:,0,i,:]*v_slope - v_int*stokes_i_wv_avg
print(f"--- Cross talk correction time: {np.round(time.time() - start_time,3)} seconds ---")
printc('--------------------------------------------------------------',bcolors.OKGREEN)
printc(f"------------- I -> Q,U,V cross talk correction time: {np.round(time.time() - start_time,3)} seconds ",bcolors.OKGREEN)
printc('--------------------------------------------------------------',bcolors.OKGREEN)
data *= field_stop[start_row:start_row + data_size[0],start_col:start_col + data_size[1], np.newaxis, np.newaxis, np.newaxis]
......@@ -851,7 +853,7 @@ def phihrt_pipe(data_f,dark_f,flat_f,norm_f = True, clean_f = False, sigma = 59,
rte_invs[3,low_values_flags] = 0
rte_invs[4,low_values_flags] = 0
np.savez_compressed(out_dir+'_RTE', rte_invs=rte_invs, rte_invs_noth=rte_invs_noth)
#np.savez_compressed(out_dir+'_RTE', rte_invs=rte_invs, rte_invs_noth=rte_invs_noth)
del_dummy = subprocess.call("rm dummy_out.txt",shell=True)
#print(del_dummy)
......
from hrt_pipe import phihrt_pipe
import numpy as np
sciencedata_fits_filenames = ['solo_L0_phi-hrt-ilam_0667414905_V202103221851C_0142230602.fits', 'solo_L0_phi-hrt-ilam_0667415054_V202103221851C_0142230603.fits', 'solo_L0_phi-hrt-ilam_0667415205_V202103221851C_0142230604.fits', 'solo_L0_phi-hrt-ilam_0667415354_V202103221851C_0142230605.fits', 'solo_L0_phi-hrt-ilam_0667415505_V202103221851C_0142230606.fits', 'solo_L0_phi-hrt-ilam_0667415654_V202103221851C_0142230607.fits', 'solo_L0_phi-hrt-ilam_0667415805_V202103221851C_0142230608.fits']#['../fits_files/solo_L0_phi-hrt-ilam_0667414748_V202103221851C_0142230201.fits']
flatfield_fits_filename = '../fits_files/solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'
......@@ -6,5 +7,23 @@ darkfield_fits_filename = '../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V2
sciencedata_fits_filenames = ['../fits_files/' + i for i in sciencedata_fits_filenames]
data = phihrt_pipe(sciencedata_fits_filenames, darkfield_fits_filename, flatfield_fits_filename, norm_stokes = True,
clean_f = True, out_demod_file = True, out_dir = '/data/slam/home/sinjan/hrt_pipe_results/stp-136/', rte = 'RTE')
\ No newline at end of file
c_talk_params = np.zeros((2,3))
q_slope = 0.0038
u_slope = -0.0077
v_slope = -0.0009
q_int = -0.0056
u_int = 0.0031
v_int = -0.0002
c_talk_params[0,0] = q_slope
c_talk_params[0,1] = u_slope
c_talk_params[0,2] = v_slope
c_talk_params[1,0] = q_int
c_talk_params[1,1] = u_int
c_talk_params[1,2] = v_int
data = phihrt_pipe(sciencedata_fits_filenames[1:], darkfield_fits_filename, flatfield_fits_filename, norm_stokes = True,
clean_f = True, ctalk_params = c_talk_params, ItoQUV = True, out_demod_file = True, out_dir = '/data/slam/home/sinjan/hrt_pipe_results/stp-136_ctalk/', rte = 'RTE')
\ No newline at end of file
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