ReadPidf


Table of Contents

  1. Introduction to ReadPidf
  2. ReadPidf basics
  3. Information available from the PIDF
    1. Averaging datatypes
    2. Binning structure
    3. Calibration Data Structure
    4. Data Quality
    5. Grouping information
    6. Miscellaneous information
    7. Mode information
    8. PitchAngle information
    9. Sensor information
    10. SpinAngle information
    11. Sweep/Scan information
    12. Units information
    13. Plasma Moments information

Introduction to ReadPidf


SYNOPSIS

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.


ReadPidf


SYNOPSIS

This routine reads from Plot Information Definition Files (PIDF) v2.0 to return specific data requested into storage provided by the calling routine.

include "pidf_defs.h"'

int ReadPidf (unsigned long data_key,
                 char          *exten,
                 int           data_type,
                 int           sennum,
                 int           unitnum,
                 PIDF          what,
                 char          *memory)

ARGUMENTS

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.

DESCRIPTION

ReadPidf is the generic PIDF data read routine, that interfaces the data and presentation routines. Plotting defaults are made available to the calling program for the configuration of plotting packages.

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.

ERRORS

All errors within this routine are returned through the status variable.

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.

WARNINGS

No memory bounds checking is done on the caller supplied memory. Therefore, sufficient memory should be given to avoid serious error.

EXAMPLES

Obtain the sensor name for sensor 2 in the virtual instrument MPSB, which is part of the PEM experiment on the MEPS instrument. The PEM experiment is part of the UARS-1 mission, which is identified with the UARS project.

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);


Averaging Information Datatypes


SYNOPSIS

AVG, MASS, CHARGE, PHI, THETA, or SCAN

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.


USES

Possible what values for AVG :

Possible what values for MASS, CHARGE, PHI, THETA, or SCAN :

where * is one of MASS, CHARGE, PHI, THETA, or SCAN


Binning Datatype


SYNOPSIS

BIN

Will get binning information from the PIDF.


USES

Possible what values :

All information in the Bin struct requires an associate bin number. This is specified as sennum in the call to ReadPidf.


Calibration Data Datatype


SYNOPSIS

CAL_DATA

Will get calibration information from the PIDF.


USES

Possible what values :

All information in the CalSet struct requires an associated calibration number. This is specified as sennum in the call to ReadPidf.


Data Quality Datatype


SYNOPSIS

D_QUAL

Will get data quality information from the PIDF.


USES

Possible what values :


PIDF Group Datatype


SYNOPSIS

PIDF_GROUP

Will get grouping information from the PIDF.


USES

Possible what values :


Items without Datatype


SYNOPSIS

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.


USES

Possible what values :


Mode Datatype


SYNOPSIS

MODE

Will get mode information from the PIDF.


USES

Possible what values :

All information in the Mode struct requires an associated mode number. This is specified as sennum in the call to ReadPidf.


Pitch Angle Datatype


SYNOPSIS

PITCH_ANGLE

Will get pitch angle information from the PIDF.


USES

Possible what values :

All information in the PitchAngle struct requires an associated sensor number. This is specified as sennum in the call to ReadPidf.

Sensor Datatype


SYNOPSIS

SENSOR

Will get sensor information from the PIDF.


USES

Possible what values :

All information in the Sensor struct requires an associated sensor number. This is specified as sennum in the call to ReadPidf.


Spin (Start Azimuthal/Stop Azimuthal) Angle Datatype


SYNOPSIS

START_AZ_ANGLE and STOP_AZ_ANGLE

Will get spin angle information from the PIDF.


USES

Possible what values :

All information in the SpinAngle struct requires an associated sensor number. This is specified as sennum in the call to ReadPidf.


Sweep Step/Scan Datatype


SYNOPSIS

SWEEP_STEP or SCAN

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.


USES

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.


Units from Datatypes


SYNOPSIS

UNITS

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.


USES

Possible what values :

All information in the Unit struct requires an associated unit number. This is specified as unitnum in the call to ReadPidf.


Moments Datatype


SYNOPSIS

MOMENTS

Will get plasma moments calculation information from the PIDF if it is available.


USES

Possible what values :