Commit fe4c0736 authored by jonas's avatar jonas
Browse files

readme update + doc in run.py

parent 52dcdbd0
...@@ -20,6 +20,9 @@ Reduction software for SO/PHI-HRT instrument on the ESA Solar Orbiter ...@@ -20,6 +20,9 @@ Reduction software for SO/PHI-HRT instrument on the ESA Solar Orbiter
(if required) b) ghost correction - **not implemented yet** <br /> (if required) b) ghost correction - **not implemented yet** <br />
14. rte inversion with cmilos <br /> 14. rte inversion with cmilos <br />
a) output rte data products to fits file <br /> a) output rte data products to fits file <br />
## NOTE
At the moment it cannot process compressed data (5 or 6 bit compression)
## SETUP ## SETUP
1. Compile milos: 1. Compile milos:
......
...@@ -74,7 +74,7 @@ def demod_hrt(data,pmp_temp): ...@@ -74,7 +74,7 @@ def demod_hrt(data,pmp_temp):
def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = True, clean_f = False, def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = True, clean_f = False,
sigma = 59, flat_states = 24, prefilter_f = None,flat_c = True, dark_c = True, field_stop = True, sigma = 59, 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, demod = True, norm_stokes = True, out_dir = './', out_demod_file = False,
correct_ghost = False, ItoQUV = False, ctalk_params = None, rte = False): correct_ghost = False, ItoQUV = False, ctalk_params = None, rte = False):
...@@ -103,7 +103,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr ...@@ -103,7 +103,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr
---------- ----------
Input: Input:
data_f : list or string data_f : list or string
list containing paths to fits files of the raw HRT data OR string of path to one file list containing paths to fits files of the raw HRT data OR string of path to one file - must have last 10 characters before .fits as the DID - for naming purposes of output files
dark_f : string, DEFAULT '' dark_f : string, DEFAULT ''
Fits file of a dark file (ONLY ONE FILE) Fits file of a dark file (ONLY ONE FILE)
flat_f : string, DEFAULT '' flat_f : string, DEFAULT ''
...@@ -126,7 +126,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr ...@@ -126,7 +126,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr
apply flat field correction apply flat field correction
dark_c: bool, DEFAULT: True dark_c: bool, DEFAULT: True
apply dark field correction apply dark field correction
field_stop: bool, DEFAULT True fs_c: bool, DEFAULT True
apply HRT field stop apply HRT field stop
demod: bool, DEFAULT: True demod: bool, DEFAULT: True
apply demodulate to the stokes apply demodulate to the stokes
...@@ -628,7 +628,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr ...@@ -628,7 +628,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr
# FIELD STOP # FIELD STOP
#----------------- #-----------------
if field_stop: if fs_c:
print(" ") print(" ")
printc("-->>>>>>> Applying field stop",color=bcolors.OKGREEN) printc("-->>>>>>> Applying field stop",color=bcolors.OKGREEN)
...@@ -802,8 +802,8 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr ...@@ -802,8 +802,8 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr
seen = set() seen = set()
uniq_scan_DIDs = [x for x in scan_name_list if x in seen or seen.add(x)] #creates list of unique DIDs from the list uniq_scan_DIDs = [x for x in scan_name_list if x in seen or seen.add(x)] #creates list of unique DIDs from the list
print(uniq_scan_DIDs) #print(uniq_scan_DIDs)
print(scan_name_list) #print(scan_name_list)
if uniq_scan_DIDs == []: if uniq_scan_DIDs == []:
print("The scan's DIDs are all unique") print("The scan's DIDs are all unique")
......
from hrt_pipe import phihrt_pipe from hrt_pipe import phihrt_pipe
import numpy as np import numpy as np
sciencedata_fits_filenames = ['solo_L0_phi-hrt-ilam_20210421T120003_V202106080929C_0144210101.fits', 'solo_L0_phi-hrt-ilam_20210424T120003_V202106141014C_0144240101.fits'] sciencedata_fits_filenames = ['nestor_intermediate_result_masked.fits']#['solo_L0_phi-hrt-ilam_20210421T120003_V202106080929C_0144210101.fits', 'solo_L0_phi-hrt-ilam_20210424T120003_V202106141014C_0144240101.fits']
# 'solo_L0_phi-hrt-ilam_20210425T120002_V202106141020C_0144250101.fits', 'solo_L0_phi-hrt-ilam_20210426T120002_V202106162118C_0144260101.fits', # 'solo_L0_phi-hrt-ilam_20210425T120002_V202106141020C_0144250101.fits', 'solo_L0_phi-hrt-ilam_20210426T120002_V202106162118C_0144260101.fits',
# 'solo_L0_phi-hrt-ilam_20210427T120002_V202106162052C_0144270101.fits', 'solo_L0_phi-hrt-ilam_20210427T120002_V202106171444C_0144270101.fits', # 'solo_L0_phi-hrt-ilam_20210427T120002_V202106162052C_0144270101.fits', 'solo_L0_phi-hrt-ilam_20210427T120002_V202106171444C_0144270101.fits',
# 'solo_L0_phi-hrt-ilam_20210427T120002_V202106171517C_0144270101.fits'] # 'solo_L0_phi-hrt-ilam_20210427T120002_V202106171517C_0144270101.fits']
...@@ -10,8 +10,8 @@ sciencedata_fits_filenames = ['solo_L0_phi-hrt-ilam_20210421T120003_V20210608092 ...@@ -10,8 +10,8 @@ sciencedata_fits_filenames = ['solo_L0_phi-hrt-ilam_20210421T120003_V20210608092
#sciencedata_fits_filenames = ['solo_L0_phi-hrt-ilam_0667414748_V202103221851C_0142230201.fits'] #sciencedata_fits_filenames = ['solo_L0_phi-hrt-ilam_0667414748_V202103221851C_0142230201.fits']
#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'] #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']
flatfield_fits_filename = '../fits_files/solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits' flatfield_fits_filename = '' #'../fits_files/solo_L0_phi-hrt-flat_0667134081_V202103221851C_0162201100.fits'
darkfield_fits_filename = '../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V202002281636_0022210004_000.fits' darkfield_fits_filename = ''#../fits_files/solo_L0_phi-fdt-ilam_20200228T155100_V202002281636_0022210004_000.fits'
sciencedata_fits_filenames = ['../fits_files/' + i for i in sciencedata_fits_filenames] sciencedata_fits_filenames = ['../fits_files/' + i for i in sciencedata_fits_filenames]
...@@ -19,9 +19,9 @@ prefilter_f = '../fits_files/fitted_prefilter.fits' ...@@ -19,9 +19,9 @@ 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 q_slope = 0#0.0038
u_slope = -0.0077 u_slope = 0#-0.0077
v_slope = -0.0009 v_slope = 0#-0.0009
q_int = -0.0056 #the offset, normalised to I_c q_int = -0.0056 #the offset, normalised to I_c
u_int = 0.0031 u_int = 0.0031
...@@ -35,6 +35,71 @@ c_talk_params[1,0] = q_int ...@@ -35,6 +35,71 @@ c_talk_params[1,0] = q_int
c_talk_params[1,1] = u_int c_talk_params[1,1] = u_int
c_talk_params[1,2] = v_int c_talk_params[1,2] = v_int
phihrt_pipe(sciencedata_fits_filenames, darkfield_fits_filename, flatfield_fits_filename, flat_states = 24, norm_stokes = True, prefilter_f = prefilter_f, phihrt_pipe(sciencedata_fits_filenames, flat_f = '', dark_f = '', scale_data = False, norm_f = False, clean_f = False,
clean_f = True, ctalk_params = c_talk_params, ItoQUV = True, out_demod_file = True, out_dir = '/data/slam/home/sinjan/hrt_pipe_results/stp-144_ctalk_prefilter/', rte = 'False') sigma = 59, flat_states = 24, norm_stokes = True, prefilter_f = None, dark_c = False, flat_c = False,
#keyword IMGDIRX YES OR NO - image mirrored in y axis - for all HRT images fs_c = True, demod = False, ctalk_params = c_talk_params, ItoQUV = True, out_demod_file = True,
\ No newline at end of file out_dir = '/data/slam/home/sinjan/hrt_pipe_results/nestor_compar/', rte = 'RTE')
"""
Input Parameters:
----------
data_f : list or string
list containing paths to fits files of the raw HRT data OR string of path to one file
dark_f : string, DEFAULT ''
Fits file of a dark file (ONLY ONE FILE)
flat_f : string, DEFAULT ''
Fits file of a HRT flatfield (ONLY ONE FILE)
** Options:
read_scale_data: bool, DEFAULT True
reads in science data and performs appropriate scaling
norm_f: bool, DEFAULT: True
to normalise the flat fields before applying
clean_f: bool, DEFAULT: False
clean the flat field with unsharp masking
sigma: int, DEFAULT: 59
sigma of the gaussian convolution used for unsharp masking if clean_f == True
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)
prefilter_f: str, DEFAULT None
file path location to prefilter fits file, apply prefilter correction
flat_c: bool, DEFAULT: True
apply flat field correction
dark_c: bool, DEFAULT: True
apply dark field correction
field_stop: bool, DEFAULT True
apply HRT field stop
demod: bool, DEFAULT: True
apply demodulate to the stokes
norm_stokes: bool, DEFAULT: True
normalise the stokes vector to the quiet sun (I_continuum)
out_dir : string, DEFUALT: './'
directory for the output files
out_demod_file: bool, DEFAULT: False
output file with the stokes vectors to fits file
correct_ghost: bool, DEFAULT: False
correct the ghost in bottom left corner
ItoQUV: bool, DEFAULT: False
apply I -> Q,U,V correction
ctalk_params: numpy arr, DEFAULT: None
cross talk parameters for ItoQUV, (2,3) numpy array required: first axis: Slope, Offset (Normalised to I_c) - second axis: Q,U,V
rte: str, DEFAULT: False
invert using cmilos, options: 'RTE' for Milne Eddington Inversion, 'CE' for Classical Estimates, 'CE+RTE' for combined
"""
\ No newline at end of file
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