Commit b1469e02 authored by jonas's avatar jonas
Browse files

cleaning option for v, uv, quv

parent b3421fb1
...@@ -69,7 +69,7 @@ json.dump(input_dict, open(f"./input_jsons/april_2020_L1.txt", "w")) ...@@ -69,7 +69,7 @@ json.dump(input_dict, open(f"./input_jsons/april_2020_L1.txt", "w"))
# CAN also do the L1 files - but must set bit_convert_scale to false, and scale data to False for the flat fields, and presumably same for the input data # CAN also do the L1 files - but must set bit_convert_scale to false, and scale data to False for the flat fields, and presumably same for the input data
science_nov = ['solo_L1_phi-hrt-ilam_20201117T170209_V202107060747C_0051170001.fits'] science_nov = ['solo_L1_phi-hrt-ilam_20201117T170209_V202108301639C_0051170001.fits']#['solo_L1_phi-hrt-ilam_20201117T170209_V202107060747C_0051170001.fits']
flatfield_fits_filename = '/data/slam/home/sinjan/fits_files/april_avgd_2020_flat.fits' #solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits' flatfield_fits_filename = '/data/slam/home/sinjan/fits_files/april_avgd_2020_flat.fits' #solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'
...@@ -86,6 +86,30 @@ input_dict = { ...@@ -86,6 +86,30 @@ input_dict = {
json.dump(input_dict, open(f"./input_jsons/nov_2020_L1.txt", "w")) json.dump(input_dict, open(f"./input_jsons/nov_2020_L1.txt", "w"))
""" """
#Nov 17 2020 L1 Feb Flats
# CAN also do the L1 files - but must set bit_convert_scale to false, and scale data to False for the flat fields, and presumably same for the input data
science_nov = ['solo_L1_phi-hrt-ilam_20201117T170209_V202107060747C_0051170001.fits']
flatfield_fits_filename = '/data/slam/home/sinjan/fits_files/solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits' #solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'
darkfield_fits_filename = '../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V202002281636_0022210004_000.fits'
science_nov = ['/data/slam/home/sinjan/fits_files/' + i for i in science_nov]
input_dict = {
'data_f': science_nov,
'flat_f' : flatfield_fits_filename,
'dark_f' : darkfield_fits_filename
}
json.dump(input_dict, open(f"./input_jsons/nov_2020_L1_feb_flats.txt", "w"))
"""
#Feb 2021 L1 #Feb 2021 L1
...@@ -103,4 +127,6 @@ input_dict = { ...@@ -103,4 +127,6 @@ input_dict = {
'dark_f' : darkfield_fits_filename 'dark_f' : darkfield_fits_filename
} }
json.dump(input_dict, open(f"./input_jsons/feb_2k_2021_L1.txt", "w")) json.dump(input_dict, open(f"./input_jsons/feb_2k_2021_L1.txt", "w"))
\ No newline at end of file
"""
\ No newline at end of file
...@@ -76,7 +76,7 @@ def demod_hrt(data,pmp_temp): ...@@ -76,7 +76,7 @@ def demod_hrt(data,pmp_temp):
def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate = False, scale_data = True, accum_scaling = True, def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate = False, scale_data = True, accum_scaling = True,
bit_conversion = True, norm_f = True, clean_f = False, sigma = 59, flat_states = 24, prefilter_f = None,flat_c = True, bit_conversion = True, norm_f = True, clean_f = False, sigma = 59, clean_mode = "V", flat_states = 24, prefilter_f = None,flat_c = True,
dark_c = True, fs_c = True, demod = True, norm_stokes = True, out_dir = './', out_demod_file = False, out_demod_filename = None, dark_c = True, fs_c = True, demod = True, norm_stokes = True, out_dir = './', out_demod_file = False, out_demod_filename = None,
ItoQUV = False, ctalk_params = None, rte = False, out_rte_filename = None, p_milos = True, config_file = True): ItoQUV = False, ctalk_params = None, rte = False, out_rte_filename = None, p_milos = True, config_file = True):
...@@ -125,7 +125,9 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate ...@@ -125,7 +125,9 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate
clean_f: bool, DEFAULT: False clean_f: bool, DEFAULT: False
clean the flat field with unsharp masking clean the flat field with unsharp masking
sigma: int, DEFAULT: 59 sigma: int, DEFAULT: 59
sigma of the gaussian convolution used for unsharp masking if clean_f == True sigma of the gaussian convolution used for unsharp masking if clean_f == True
clean_mode: str, DEFAULT: "V"
The polarisation states of the flat field to be unsharp masked, options are "V", "UV" and "QUV"
flat_states: int, DEFAULT: 24 flat_states: int, DEFAULT: 24
Number of flat fields to be applied, options are 4 (one for each pol state), 6 (one for each wavelength), 24 (one for each image) Number of flat fields to be applied, options are 4 (one for each pol state), 6 (one for each wavelength), 24 (one for each image)
prefilter_f: str, DEFAULT None prefilter_f: str, DEFAULT None
...@@ -495,7 +497,14 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate ...@@ -495,7 +497,14 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', L1_input = True, L1_8_generate
elif cpos_arr[0] == 5: elif cpos_arr[0] == 5:
wv_range = range(5) wv_range = range(5)
for pol in range(3,4): if clean_mode == "QUV":
start_clean_pol = 1
elif clean_mode == "UV":
start_clean_pol = 2
elif clean_mode == "V":
start_clean_pol = 3
for pol in range(start_clean_pol,4):
for wv in wv_range: #not the continuum for wv in wv_range: #not the continuum
......
{"data_f": ["/data/slam/home/sinjan/fits_files/solo_L1_phi-hrt-ilam_20201117T170209_V202107060747C_0051170001.fits"], "flat_f": "/data/slam/home/sinjan/fits_files/april_avgd_2020_flat.fits", "dark_f": "../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V202002281636_0022210004_000.fits"} {"data_f": ["/data/slam/home/sinjan/fits_files/solo_L1_phi-hrt-ilam_20201117T170209_V202108301639C_0051170001.fits"], "flat_f": "/data/slam/home/sinjan/fits_files/april_avgd_2020_flat.fits", "dark_f": "../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V202002281636_0022210004_000.fits"}
\ No newline at end of file \ No newline at end of file
...@@ -15,7 +15,7 @@ import json ...@@ -15,7 +15,7 @@ import json
# flatfield_fits_filename = '/data/slam/home/sinjan/fits_files/solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'#solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'#solo_L0_phi-hrt-ilam_20200417T174529_V202004241516C_0024150020000.fits' #solo_L0_phi-hrt-ilam_20200417T174529_V202004241516C_0024150020000.fits'#solo_L1_phi-hrt-ilam_20200417T174538_V202106111549C_0024150020.fits'#solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits' # flatfield_fits_filename = '/data/slam/home/sinjan/fits_files/solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'#solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'#solo_L0_phi-hrt-ilam_20200417T174529_V202004241516C_0024150020000.fits' #solo_L0_phi-hrt-ilam_20200417T174529_V202004241516C_0024150020000.fits'#solo_L1_phi-hrt-ilam_20200417T174538_V202106111549C_0024150020.fits'#solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'
input_json_file = './input_jsons/feb_2k_2021_L1.txt' input_json_file = './input_jsons/nov_2020_L1.txt'
input_dict = json.load(open(input_json_file)) input_dict = json.load(open(input_json_file))
...@@ -35,13 +35,13 @@ prefilter_f = '../fits_files/fitted_prefilter.fits' ...@@ -35,13 +35,13 @@ prefilter_f = '../fits_files/fitted_prefilter.fits'
c_talk_params = np.zeros((2,3)) c_talk_params = np.zeros((2,3))
q_slope = 0.0038#-0.0140##-0.0098# q_slope = -0.0263#0.0038#-0.0140##-0.0098#
u_slope = -0.0077#-0.0008##-0.0003# u_slope = 0.0023#-0.0077#-0.0008##-0.0003#
v_slope = -0.0009#-0.0073##-0.0070# v_slope = -0.0116#-0.0009#-0.0073##-0.0070#
q_int = -0.0056#0.0016#-0.0056#-0.0015# #the offset, normalised to I_c q_int = 0.0138#-0.0056#0.0016#-0.0056#-0.0015# #the offset, normalised to I_c
u_int = 0.0031#0.0016##0.0007# u_int = -0.0016#0.0031#0.0016##0.0007#
v_int = -0.0002#0.0007##0.0006# v_int = 0.0057#-0.0002#0.0007##0.0006#
c_talk_params[0,0] = q_slope c_talk_params[0,0] = q_slope
c_talk_params[0,1] = u_slope c_talk_params[0,1] = u_slope
...@@ -53,11 +53,11 @@ c_talk_params[1,2] = v_int ...@@ -53,11 +53,11 @@ c_talk_params[1,2] = v_int
#out_names = ['nov_17_0051170001']#, '0024160032000_noflat', '0024160033000_noflat', '0024160034000_noflat', '0024160035000_noflat', '0024160036000_noflat', '0024160037000_noflat', '0024160038000_noflat', '0024160039000_noflat'] #out_names = ['nov_17_0051170001']#, '0024160032000_noflat', '0024160033000_noflat', '0024160034000_noflat', '0024160035000_noflat', '0024160036000_noflat', '0024160037000_noflat', '0024160038000_noflat', '0024160039000_noflat']
phihrt_pipe(data_f, flat_f = flat_f, dark_f = dark_f, scale_data = True, bit_conversion = True, accum_scaling = True, norm_f = True, phihrt_pipe(data_f, flat_f = flat_f, dark_f = dark_f, scale_data = False, bit_conversion = False, accum_scaling = True, norm_f = True,
clean_f = False, sigma = 59, flat_states = 24, norm_stokes = True, prefilter_f = None, clean_f = True, sigma = 49, flat_states = 24, norm_stokes = True, prefilter_f = None,
dark_c = True, flat_c = True, fs_c = True, demod = True, ctalk_params = c_talk_params, dark_c = True, flat_c = True, fs_c = True, demod = True, ctalk_params = c_talk_params,
ItoQUV = False, out_demod_file = True, out_demod_filename = None, ItoQUV = True, out_demod_file = True, out_demod_filename = None,
out_dir = '/data/slam/home/sinjan/hrt_pipe_results/stp-136_ctalk_no_us/', rte = 'RTE', out_dir = '/data/slam/home/sinjan/hrt_pipe_results/nov_17_april_flats_uv_clean/', rte = 'False',
out_rte_filename=None, p_milos = False, config_file = True) out_rte_filename=None, p_milos = False, config_file = True)
""" """
Input Parameters: Input Parameters:
...@@ -96,6 +96,9 @@ clean_f: bool, DEFAULT: False ...@@ -96,6 +96,9 @@ clean_f: bool, DEFAULT: False
sigma: int, DEFAULT: 59 sigma: int, DEFAULT: 59
sigma of the gaussian convolution used for unsharp masking if clean_f == True sigma of the gaussian convolution used for unsharp masking if clean_f == True
clean_mode: str, DEFAULT: "V"
The polarisation states of the flat field to be unsharp masked, options are "V", "UV" and "QUV"
flat_states: int, DEFAULT: 24 flat_states: int, DEFAULT: 24
Number of flat fields to be applied, options are 4 (one for each pol state), 6 (one for each wavelength), 24 (one for each image) Number of flat fields to be applied, options are 4 (one for each pol state), 6 (one for each wavelength), 24 (one for each image)
......
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