gedfunction
GED
Ged function provides the main interface to the ged system.
NOTE: The filename(s) set via keyword FILENAMES, should be of the form:
<path+filename>+'.l0n.fm0.datatype
where:
● n: level, 2 or 3
● m: format, 1, 3, 4 or 5
● datatype: see the quick reference tables on the main page
IDL doc_library comment
Function GED - Get Erne Data (lev-2 and lev-3) Version: 1.5 Description: This is a general envelope routine for reading and pre-processing of various ERNE data. Typically GED will open various GUI-windows to let user interactively specify data and preprocessing. This can be modified by keywords. Calling sequence: d=ged() Output: Typically an array of structures. The exact structure type depends on the input data type in question and the set of possible filter functions. Keywords: FILENAMES = List of input file names If not set the 'datafilename'-procedure is started letting the user select the files interactively. GED_FFUNCS = List of filter functions After the data is read we have an array of data records of a specific ERNE data type. If required this data set will be fed through series of caller supplied filter functions. The filtering is done stepwise by feeding each filter function with the output of the previous one. The first filter function in the list must naturally accept an array of records of the nominal ERNE data type as read from the data files. The return of the last filter function is used as the output of this ged -function. Each filter function has to be of the type: ff(din,[KEYWORDS]), where din is the input data (typically an array of records). Keywords (if any) are relayed to the filter functions using IDL:s '_REF_EXTRA'-keyword. Thus they can be issued in the ged-function call as any other keyword. Requirement is of course that the keyword identifiers are unique (or compatible) between various procedures that will be called. There are two schemes for filter function execution: 1) 'PHA-schema' - filtering is done after each file is read. There is a memory problem when analysing long periods of PHA-data. With a suitable filter, unnecessary PHA-events can be discarded at this stage keeping the resulting output data array at a reasonable size. 2) 'Spectral-schema' - filtering is done only after the whole data set has been read. Spectral data usually needs to cross file boundaries when time- integrating data. The typical filtering in this case consists of energy-integration, which will be done on the time-integrated data i.e., after all the data has been read. Spectral data is much less space consuming than PHA-data and the time integration further reduces the size of the data set, so this should work fairly well. The scheme is automatically desided based on the data type in question. GED_NFILERECS = Returns the number of data records from each input file This is primarily meant for assisting in finding corresponding PHA-events between lev-2 and lev-3 PHA data. Not implemented for spectral data. GED_CATCHERR = If set (to nonzero) the errors will be catched by ged. The reason for this option is the handling of IDL errors when ged is called via a batch file by the java web interface. The error handling is very simple: in case of errors the copy of !ERROR_STATE system variable structure is returned. It is assumed that when the keyword has been set the caller checks the type of the result and acts accordingly. For example: d = ged(/GED_CATCHERR) if tag_names(d,/structure_name) EQ '!ERROR_STATE' then ... Note: this will not affect the handling of the non fatal math errors. Version history: 1.5 2007-01-31 (ER) 1) Updated the naming of the LED level-3 direction spectra reader functions. 2) Updated the file-iteration scheme for the led direction spectra. 3) Removed checking fo file types '.pha' from lev-3 reader function name construction. There are no such file types. 1.4 2004-12-14 (ER) Added new internal keyword flag 'GED_1ST' that will be set on first call of a reader and filter functions. Specifically this is for the readers like 'ged_l3_corr', that on request returns auxiliarity paramaters as a keyword array. This will enable clearing of the array on first call and adding the data at the end of the array on subsequent calls. 1.3 2004-10-07 (ER) Changed to take use of the ERNE-error messages. Specifically in case there are no files found as a result to call of the function 'datafilename'. 1.2 2002-06-28 (ER) Correction for error catching mechanism. It appeared that the '!ERROR_STATUS' contains fields (especially the message fields) that seem to be implicit pointers. When we copied those fields straight to the output error record, their contents were sometimes changed with further errors and warnings. 1.1 2002-06-26 (ER) - Added keyword 'GED_CATCHERR' and the accompanying code. - Changed names of the other ged specific keywords 'GED_...' format in accordance to the general naming convention. 1.0 2002-05-21 (ER) Original version.
gedfunction.txt · Last modified: 2023/10/11 15:22 by admin