-
Notifications
You must be signed in to change notification settings - Fork 1
SPICE_INGEST
This routine takes as input a SPICE filename (or list of files, or a directory) and correctly places them in the SPICE data tree, creating new directories if necessary. The environment variable SPICE_DATA needs to be defined.
spice_ingest [, filename] [, path_index= path_index] [, /force] [, /nolevel] [, /search_subdir] [, /help] [, /user_dir] [, top_dir=top_dir] [, dry_run=dry_run] [, destination=destination] [, file_moved=file_moved] [, files_found=files_found]
The name and path of a SPICE file. Can be an array of names. Or a directory (scalar), then all spice files in this directory will be moved. If not provided, all files from the current directory will be moved.
If $SPICE_DATA or TOP_DIR contains multiple paths, then this keyword allows you to specify to which path you send the file(s). Default is 0.
A path to a directory in which the file should be saved. The necessary subdirectories will be created (e.g. level2/2020/03/26).
By default the routine will not overwrite a file that already exists in the destination directory. Setting 'force' allows the file to be overwritten.
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/).
If set and 'filename' is a directory, then the program looks for spice files recurrently, i.e. in all subdirectories.
If set, then a help message is printed.
If set, the file(s) will be moved into $SPICE_DATA/user/ instead of $SPICE_DATA/
If set, the file won't be moved, no directories will be created. The optional outputs will be the same as if this keyword was not set.
Set this keyword to a named variable that receives a string array of same length than 'filename' or, in case 'filename' is a directory, of length of the number of files found in that directory. Contains the paths of each file after the move. This path is identical to its origin if the file hasn't been moved.
Set this keyword to a named variable that receives an integer array of same length than 'destination'. Indicates which files have been moved (1=moved, 0=not moved).
Set this keyword to a named variable that receives a string array of same length than 'destination'. Contains all files that have been found, if input was a directory. Else it is identical to 'filename'.
This would move all SPICE FITS files from the current directory into the $SPICE_DATA directory:
spice_ingest