ReadPIDF TCL UTILITIES USER MANUAL ReadPIDF
SYNOPSIS
Read a UDF PIDF file.
PACKAGE
TCLUDF
NAME
ReadPIDF
USAGE
set rV  ReadPIDF  Key {N}]
INPUT DEFINITIONS
Key - The data key associated with the UDF definition of the PIDF file to be read.
N - The PIDF return array iD. This is an optional value which is not supplied is set to 0. The information read from the PIDF file is available in the global variable Pidf$N.
RETURN DEFINITION
Routine returns the read status as:
-1 - Cannot open a PIDF file for this Key definition.
0 - PIDF values have already been read.
1 - ALL_OKAY
DESCRIPTION
ReadPIDF reads all the fields in the PIDF file associated with the UDF definition represented by KeY. The information is returned in the global array variable PidfN. The definition of the array elements is provided in the table below. Basically each element in the array corresponds to one or more PIDF field definitions. Common fields within a PIDF structures are grouped together as lists so that for example the name field within the PIDF Sensor structure is returned as list of strings, one list element per defined sensor structure. Where there can be multiple instances of a field within a structure as is the case with the unit_number field, the information is returned as a list of lists.
The table below provides the mapping between the PidfN array indices and the PIDF field which it represents. For more detailed descriptions of the definition of the PIDF field refer to the PIDF manual. The table also provides where allpicable, the PIDF structure under which the name was defined as well a comments where necessary.
Pidf ARRAY DEFINITIONS
PidfN INDEX STRUCTURE PIDF FIELD COMMENTS
Version version
Institute institution
Project project
Mission mission
Exper experiment
Inst instrument
VInst vinst
NGroups num_groups
GrpName group_name List of group names
PlotAvail plot_avial_flag
DataMask data_type_mask
InstDeps instrument_dep
Cyclic cyclic
Blocking blocking
SenType sen_type
MinMax List of the fields: phi_min, phi_max, theta_min, theta_max, scan_min, scan_max
NBinSets num_bin_sets
NUnits num_units
UnitId Unit id
UnitLId Unit local_id
UnitMin Unit min
UnitMax Unit max
UnitSca Unit unit_scaling
UnitLab Unit unit_label
UnitLDes Unit long_description
UnitSDes Unit short_description
UnitNtbls Unit num_tables
UnitTbls Unit tbl_app_flag List of lists
UnitOps Unit tbl_app_oper List of lists
NSens num_sensors
SenName Sensor name
SenComp Sensor component
SenSrc Sensor source
SenSCF Sensor scf_name
SenPa Sensor pitch_angle_flag
SenPidfN Sensor pidf_sensor_num
SenVidfN Sensor vidf_sensor_num
SenAncS Sensor anc_sensor
SenGrpN Sensor group_num
SenScanBlk Sensor scan_block_info
SenUnits Sensor unit_number List of lists
NModes num_modes
ModeName Mode name
ModeSName Mode short_name
ModePidfN Mode pidf_mode_num
ModeVidfN Mode vidf_mode_num
ModeUnits Mode unit_number List of lists
NScans num_scan
ScanPidfN Scan scan_block_num
ScanSpacing Scan spacing List of lists
ScanUnits Scan units_index List of lists
ScanBinLoc Scan bin_location List of lists
ScanVUnits Scan var_units List of lists
NAncs num_cals
AncName CalSet name
AncSName CalSet short_name
AncPidfN CalSet pidf_cal_num
AncVidfN CalSet vidf_cal_num
AncUnits CalSet unit_number List of lists
AncSens CalSet cal_based_on_sensor List of lists
NdQ
dQName DataQual name
dQSName DataQual short_name
dQUnits DataQual unit_number List of lists
NPhase
sAName SpinAngle name
sASName SpinAngle short_name
sAUnits SpinAngle unit_number List of lists
NPitch
pAName PitchAngle name
pASName PitchAngle short_name
pAUnits PitchAngle unit_number List of lists
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
# GET the defined units for the third defined IMOORBIT PIDF sensor

# INITIALIZE the UDF common variables

UDFInits

# GET the key for the UDF hierarchy IMAGE IMAGE1 OA ORBIT IMOORBIT

set KeY [GetDataKey IMAGE IMAGE1 OA ORBIT IMOORBIT]

# OPEN and read the PIDF file

ReadPIDF $KeY 0 

# MAKE sure there are 3 sensors

if { $Pidf0(NSens) > 3 } {

# IDENTIFY the measurement

   puts stderr "Third PIDF sensor:"
   puts stderr "    Name:   [lindex $Pidf0(SenName) 2]"
   puts stderr "    Comp:   [lindex $Pidf0(SenComp) 2]"

# THESE are the units defined for this sensor

   set Units [lindex $Pidf0(SenUnits) 2] 

# THIS is the number of units defined for this sensor

   set nU [llength $Units] 
   puts stderr "    $nU units defined" 

# LOOP over the defined units

   for { set I 0 } { $I < $nU } { incr I } { 

# THIS is the unit number

       set uN [lindex $Units $I] 

# PRINT out some information

       puts stderr "    Unit $I: [lindex $Pidf0(UnitLDes) $uN] \
                                ([lindex $Pidf0(UnitLab) $uN])" 
   }
} else { puts stderr "Only $Pidf0(NSens) defined" }

>Third PIDF sensor:
>    Name:   GCI Satellite Pos: Z
>    Comp:   Z
>    2 units defined
>    Unit 0: Distance  (km)
>    Unit 1: Distance  (Re)

      
Feb 20, 2007