Commit 70e9d10d authored by jonas's avatar jonas
Browse files

mk output dir if not exist, readme download suggestions

parent d42bfed0
......@@ -25,6 +25,18 @@ Reduction software for SO/PHI-HRT instrument on the ESA Solar Orbiter
## DOWNLOAD FILES
EITHER: download from the PHI Image Database (recommended): https://www2.mps.mpg.de/services/proton/phi/imgdb/ <br />
Suggested filters for HRT science data:
- KEYWORD DETECTOR = 'HRT' <br />
- Filename* like \*L1_phi-hrt-ilam\*
To download via the command line (eg if you want to save the files on a server and not locally)
```
wget --user yourusername --password yourpassword the_web_address_of_the_file_you_want_from_the_database
gunzip file.gz
```
Gunzip used to unpack the .gz to the file you want <br />
OR : use download_files.py to download images from the attic repository
## SETUP
......
......@@ -792,6 +792,11 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr
if out_demod_file:
#check if the output directory exists, if not, create it
if not os.path.exists(out_dir):
print(f"{out_dir} does not exist, creating it now")
os.makedirs(out_dir)
if isinstance(data_f, list):
print(" ")
printc('Saving demodulated data to one _reduced.fits file per scan')
......@@ -812,7 +817,7 @@ def phihrt_pipe(data_f, dark_f = '', flat_f = '', scale_data = True, norm_f = Tr
for x in uniq_scan_DIDs:
number = scan_name_list.count(x)
if number > 1: #if more than one
print(f"The DID: {x} is repeated {number} times.")
print(f"The DID: {x} is repeated {number} times")
i = 1
for index, name in enumerate(scan_name_list):
if name == x:
......
from hrt_pipe import phihrt_pipe
import numpy as np
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']
sciencedata_fits_filenames = ['solo_L1_phi-hrt-ilam_20210223T170002_V202106111612C_0142230201.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_20210427T120002_V202106162052C_0144270101.fits', 'solo_L0_phi-hrt-ilam_20210427T120002_V202106171444C_0144270101.fits',
# 'solo_L0_phi-hrt-ilam_20210427T120002_V202106171517C_0144270101.fits']
......@@ -10,8 +10,8 @@ sciencedata_fits_filenames = ['nestor_intermediate_result_masked.fits']#['solo_L
#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']
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'
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'
sciencedata_fits_filenames = ['../fits_files/' + i for i in sciencedata_fits_filenames]
......@@ -43,10 +43,10 @@ c_talk_params[1,0] = q_int
c_talk_params[1,1] = u_int
c_talk_params[1,2] = v_int
phihrt_pipe(sciencedata_fits_filenames, flat_f = '', dark_f = '', scale_data = False, norm_f = False, clean_f = False,
sigma = 59, flat_states = 24, norm_stokes = True, prefilter_f = None, dark_c = False, flat_c = False,
phihrt_pipe(sciencedata_fits_filenames, flat_f = flatfield_fits_filename, dark_f = darkfield_fits_filename, scale_data = True, norm_f = True, clean_f = True,
sigma = 59, flat_states = 24, norm_stokes = True, prefilter_f = prefilter_f, dark_c = True, flat_c = True,
fs_c = True, demod = False, ctalk_params = c_talk_params, ItoQUV = True, out_demod_file = True,
out_dir = '/data/slam/home/sinjan/hrt_pipe_results/nestor_compar/', rte = 'RTE')
out_dir = '/data/slam/home/sinjan/hrt_pipe_results/L1_test/', rte = 'RTE')
"""
Input Parameters:
----------
......
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