SPICE_CREATE_L3_DRIVER - ITA-Solar/solo-spice-ql GitHub Wiki
Description
This function creates multiple level 3 files and optionally images. SPICE_FIND_FILE is used to find all level 2 files that should be used to create level 3 files.
The input can be a time, in which case the closest level 2 file will be used, or the user can provide a time window in which to search for level 2 files. Alternatively, it is possible to provide a list of level 2 files.
The level 3 files will be saved under $SPICE_DATA/user/ or if TOP_DIR is provided under TOP_DIR/user/ or if PIPELINE_DIR is provided under PIPELINE_DIR/.
Syntax
spice_create_l3_driver, time_start [, time_end=time_end] [, l2_files = l2_files] [, top_dir=top_dir] [, path_index=path_index] [, count_file=count_file] [, count_seq=count_seq] [, /all] [, /sequence] [, /no_level] [, /no_tree_struct] [, /user_dir] [, /search_subdir] [, /ignore_time] [, /no_masking] [, /approximated_slit] [, /no_fitting] [, /no_widget] [, /show_xcfit_block] [, /position] [, velocity=velocity] [, pipeline_dir = pipeline_dir] [, /create_images] [, images_top_dir=images_top_dir] [, files_l3=files_l3] [, /search_level3] [, /no_overwrite]
Return value
This procedure will create SPICE FITS level 3 files and move them to the correct directory. Optionally, it can also create level 3 images.
Arguments
time_start
This can be in any format accepted by the ANYTIM suite of routines. For example, '1-jan-2010', '2010-01-01 05:00'. This is either the time for which the level 2 file closest to it is returned, or the start of the time window to be searched, in case 'time_end' is also provided.
Optional Input
TIME_END
This can be in any format accepted by the ANYTIM suite of routines. For example, '1-jan-2010', '2010-01-01 05:00'. This is the end of the time window to be searched.
L2_FILES
Instead of providing a time (range), a list of level 2 files can be provided here.
TOP_DIR
Top directory in which the SPICE data lies. If not provided the path given in $SPICE_DATA is searched.
PATH_INDEX
If $SPICE_DATA or TOP_DIR contains multiple paths, then this keyword allows you to specify which path should be searched. Default is 0.
VELOCITY
Set this equal to the initial velocity if you want the line position represented by the velocity relative to a lab wavelength - the lab wavelength is taken from the supplied POSITION, i.e., INT_POS_FWHM(1), which is calculated/estimated within the procedure 'generate_adef'. This input is ignored if /POSITION is set. Default is zero.
IMAGES_TOP_DIR
Top directory in which to save the level 3 images. The data-tree structure will be appended to this directory. If not provided, the path is the same as the level 3 file, except that the 'level3' part of the path will be replaced by 'images'. This input is ignored, if /CREATE_IMAGES is not set.
pipeline_dir
path to output directory used by the pipeline where L3 file is saved
Optional Output
COUNT_FILE
An integer containing the number of matching files.
COUNT_SEQ
An integer containing the number of matching sequences, only non-zero if SEQUENCE is set.
FILES_L3
A string array containing the full paths and names of the created level 3 files.
Keywords
SEQUENCE
If set, then all files of the sequence that the found level 2 files belong to will be returned, i.e. the time window to be searched is expanded to include files outside of the given time window, but only sequences (= Spice observations) that have at least one file in the given time window are returned.
If set and 'time_end' is provided, the returned value will be a LIST in which each element is a string or string array with paths to SPICE FITS files that belong to the same sequence.
ALL
If set, then all filenames for the specified day will be returned. Ignored if TIME_END is provided or if NO_TREE_STRUCT or SEQUENCE is set.
NO_LEVEL
If set, then the level part of the default path is omitted (e.g. $SPICE_DATA/2020/06/21/ instead of $SPICE_DATA/level2/2020/06/21/). This keyword is ignored for the calculation of the resulting level 3 filepath.
NO_TREE_STRUCT
If set, then the tree structure won't be appended to TOP_DIR (e.g. TOP_DIR/level2/ instead of TOP_DIR/level2/2020/06/21/)
USER_DIR
If set, the procedure searches and saves in TOP_DIR/user/ instead of TOP_DIR/.
SEARCH_SUBDIR
If set then the program looks for spice level 2 files recurrently, i.e. in all subdirectories
IGNORE_TIME
If set, TIME_START and TIME_END are ignored, and all files will be returned. Ignored if NO_TREE_STRUCT is not set. This keyword is used by spice_xfiles, it makes it possible to return all files that are stored locally
no_line_list
If set, then no predefined line list will be used to define gaussian fit components. By default, the list returned by the function spice_line_list() will be used.
IMPORTANT NOTE: For now, this keyword is set by default. One has to set it explicitly to zero if one wants to use the predefined line list. This implementation may change in the future.
Due to instrument temperature variations the wavelength scale changes significantly during the Solar Orbiter orbit, and this variation is not accounted for in L2 files. The wavelength shift is so large that using the line list when fitting fails in many cases.
no_masking
If set, then SPICE_DATA::mask_regions_outside_slit will NOT be called on the data. This procedure masks any y regions in a narrow slit data cube that don't contain slit data, i.e. pixels with contributions from parts of the detector that lie above/below the dumbbells, in the gap between the slit ends and the dumbbells, and the dumbbell regions themselves. The masking procedure is not called for wide-slit observations or if window_index corresponds to a regular dumbbell extension.
approximated_slit
If set, routine uses a fixed (conservative) value for the slit range, i.e. does not estimate the slit length based on the position of the dumbbells.
no_fitting:
If set, fitting won't be computed. This can still be done manually in xcfit_block.
no_widget
If set, xcfit_block and small window to stopp fitting will not be called.
show_xcfit_block
If set, xcfit_block will be called, for each data window before saving. This is ignored if NO_WIDGET has been set.
position
If set, then the line position is NOT represented by the velocity relative to a lab wavelength, but as the wavelength.
CREATE_IMAGES
If set, then images from the level 3 data will be created. This will call SPICE_CREATE_L3_IMAGES.
SEARCH_LEVEL3
If set, the procedure will search level 3 SPICE FITS files, instead of level 2, and not create level 3 file, but only the images, if CREATE_IMAGES has been set.
NO_OVERWRITE
Ignored! If set, then level 3 files won't be regenerated if they already exist. Contact [email protected] if you want this keyword to work.