; docformat = 'rst' ;+ ; This function finds the list of fits files to be processed, according to specified keys; ; all must be in a given directory ;- ;+ ; Used to select the list of fits files to be processed; all must be in the same directory ; :Categories: ; JWST Data Processing - NIRCam Cryo tests ; :Examples: ; find_files, data_path, obs_id, detector, files ; :Params: ; data_path: in, required, type=string ; e.g. data_path='/Volumes/witserv/witserv/data14/nrc/nrc_cryo2' ; obs_id: in, required, type=string ; e.g. obs_id='NRC_2D6-DARK' ; detector: in, required, type=string ; e.g. detector='486' ; files: out, required, type=strarr ; string array of fits files with names matching the obs_id and detector strings ; :Requires: ; Common blocks:: ; ; COMMON DETECTOR_PARAMS,gain,h,h1mask,h2mask,h3mask,h4mask; ; ; COMMON SYSTEM_PARAMS,st,DIR_OUT ; ; :File_comments: ; The detector parameters are transmitted out through the common block ; ; :Examples: ; ; A call to this routine may be done with:: ; ; IDL> DATA_PATH = '/Volumes/witserv/witserv/data14/nrc/nrc_cryo2' ; ; IDL> OBS_ID = 'NRC_2D6-DARK' ; ; IDL> DETECTOR = '486' ; ; IDL> FIND_FILES,DATA_PATH,OBS_ID,DETECTOR,FILES ; ; :History: created by M. Robberto, 25 Apr. 201 ;- PRO FIND_FILES,DATA_PATH,OBS_ID,DETECTOR,FILES COMMON DETECTOR_PARAMS,gain,h,h1mask,h2mask,h3mask,h4mask st=systime(1) print,'begin searching the specified files: ',systime(1)-st,' sec ',memory(/high)/1e9,' GB' cd, DATA_PATH ;for test purposes ; OBS_ID = 'NRC_2D6-DARK' ; DETECTOR = '486' files = FILE_SEARCH(OBS_ID+'*'+'/*'+DETECTOR+'*.fits',count=nfiles) ; ;;read datacube, assume gain=2 ;;jf = 0 ; data0 = float(readfits(file,/silent))*gain ;print,' end reading ramp: ',systime(1)-st,' sec ',memory(/high)/1e9,' GB' print,' done searching files: ',systime(1)-st,' sec ',memory(/high)/1e9,' GB' END ;x INPUTS: ; data_path: Directory where the fits files are stored ; obs_id: Initial String common to all filenames, e.g. 'NRC_2D6-DARK' ; detector: Detector ID number, e.g. '485' (string)