The ReadPidf calls are necessary if you ever need to read information from the PIDF. The PIDF holds valuable information about the instrument which may be needed for calculation or plotting purposes.
This document makes no attempt at educating the user on the PIDF or how the information is used in the PIDF. See the PIDF Documention if you need to know about a certain field. This document only serves as a way of getting information you already know exists in the PIDF.
Most information in the PIDF is in a structured form. If you know which particular structure the information is in, you can go straight to that data type and see how to get at that information.
include "pidf_defs.h"'
int ReadPidf (unsigned long data_key, char *exten, int data_type, int sennum, int unitnum, PIDF what, char *memory)
data_key is a unique value which indicates the data set of interest.
exten is a two character extension to be added to PIDF file names when default files are not to be used.
data_type is the data type of the value requested.
sennum is a data type identification number for accessing values that iterate (typically this is a number which specifies which structure you wish to look at).
unitnum is the unit identification number (if needed).
what is the requested item from data_type.
memory is adequate memory of the correct data type casted to a a character pointer for answers to be placed.
The data set of interest is referenced through the key value data_key which must be created using the fields_to_key module. Most of the IDFS generic routines utilize key values. The routine returns information about the various data types sensor, sweep, calibration, mode, data quality, pitch angle and spin angle upon request.
The exten field currently is not used.
The mnemonics for data_type are found in pidf_defs.h. sennum and unitnum are PIDF assigned numbers for the item you are seeking information about. What is the specific item you are interested in given the previous parameters. The mnemonics for what is also found in pidf_defs.h. Argument memory is a casted character pointer of the correct data type.
ReadPidf uses a hashing mechanism to store PIDF files in memory for efficient access.
When one of these files is updated, ReadPidf will re-hash the changes so the user does not have to restart their program for the changes to take effect.
ReadPidf will also attempt to AutoPromote(3) pidf files when they are off line.
The header file pidf_ret.h, which includes all possible return values, should be included so that the mnemonics for the return codes can be referenced. The pidf_ret.h file is described below. If the error is related to the syntax of the PIDF file, then the line number of the error and full path name are printed.
include "pidf_defs.h" extern LinkList Projects; StrHier pcode, mcode, ecode, icode, vcode; ulong data_key; short project, mission, exper, inst, vinst, params[5], status; char sen_name[100]; pcode = SourceByStr (Projects, "UARS", (char *) 0); project = SNUM (pcode); mcode = SourceByStr (Projects, "UARS", "UARS-1", (char *) 0); mission = SNUM (mcode); ecode = SourceByStr (Projects, "UARS", "UARS-1", "PEM", (char *) 0); exper = SNUM (ecode); icode = SourceByStr (Projects, "UARS", "UARS-1", "PEM", "MEPS", (char *) 0); inst = SNUM (icode); vcode = SourceByStr (Projects, "UARS", "UARS-1", "PEM", "MEPS", "MPSB", (char *) 0); vinst = SNUM (vcode); params[0] = project; params[1] = mission; params[2] = exper; params[3] = inst; params[4] = vinst; fields_to_key (params, &data_key); status = ReadPidf(data_key, "", SENSOR, 2, NOTUSED, NAME, (char*) sen_name);
Each of these will get averaging information from the PIDF if it is available. To get MASS, CHARGE, PHI, THETA, or SCAN info, use the related keyword as your datatype with START or STOP as your what value.
Possible what values for AVG :
Possible what values for MASS, CHARGE, PHI, THETA, or SCAN :
Will get binning information from the PIDF.
Possible what values :
All information in the Bin struct requires an associate bin number. This is specified as sennum in the call to ReadPidf.
Will get calibration information from the PIDF.
Possible what values :
All information in the CalSet struct requires an associated calibration number. This is specified as sennum in the call to ReadPidf.
Will get data quality information from the PIDF.
Possible what values :
Will get grouping information from the PIDF.
Possible what values :
Certain information is available without needing an associated data type. For these pieces of information, send in NOTUSED for the datatype, sennum and the unitnum.
Possible what values :
Will get mode information from the PIDF.
Possible what values :
All information in the Mode struct requires an associated mode number. This is specified as sennum in the call to ReadPidf.
Will get pitch angle information from the PIDF.
Possible what values :
All information in the PitchAngle struct requires an associated sensor number. This is specified as sennum in the call to ReadPidf.
Will get sensor information from the PIDF.
Possible what values :
All information in the Sensor struct requires an associated sensor number. This is
specified as sennum in the call to ReadPidf.
Will get spin angle information from the PIDF.
Possible what values :
All information in the SpinAngle struct requires an associated sensor number.
This is specified as sennum in the call to ReadPidf.
Will get scan information from the PIDF.
Scan is a bit of an awkward one as it has seperate units within it as a different
structure. As a result, most operations involve sending an associated scan number
and a corresponding unit number.
Possible what values :
All information in the Scan struct requires an associated scan number. Information
in the ScanUnit struct requires a related ScanUnit number within the Scan struct.
The scan number is specified as sennum and the scan unit number is specified
as unitnum in the call to ReadPidf.
Will get unit information from the PIDF. Most data types have a units field within
them and to get to the units information, one must go through the associated data
type.
Possible what values :
All information in the Unit struct requires an associated unit number. This is
specified as unitnum in the call to ReadPidf.
Will get plasma moments calculation information from the PIDF if it is available.
Possible what values :
Sensor Datatype
SYNOPSIS
SENSOR
USES
Spin (Start Azimuthal/Stop Azimuthal) Angle Datatype
SYNOPSIS
START_AZ_ANGLE and STOP_AZ_ANGLE
USES
Sweep Step/Scan Datatype
SYNOPSIS
SWEEP_STEP or SCAN
USES
Units from Datatypes
SYNOPSIS
UNITS
USES
Moments Datatype
SYNOPSIS
MOMENTS
USES