Package alma.aedf.types

Provides classes implementing the different types of data structures defined in the Alma Export Data Format document and tables of these structures.

See:
          Description

Class Summary
AEDF An abstract class for the AEDF types This class defines a set of properties and methods common to all the AEDF basic classes.
AlmaCorrelatorMode Processor mode information.
AlmaCorrelatorModeTable  
Antenna Antenna characteristics.
AntennaTable  
CalDevice Calibration device characteristics.
CalDeviceTable  
CalWidget CalWidget : calibration widgets.
CalWidgetTable  
ConfigDescription Configuration description.
ConfigDescriptionTable  
DataDescription Data description tableThis table sets a referential constraint in the AEDF.
DataDescriptionTable  
Doppler Doppler tracking information.
DopplerTable  
ExecuteSummary Schedule and Execute summary.
ExecuteSummaryTable  
Feed Feed charactersitics.
FeedTable  
Field Field position for each source.
FieldTable  
FlagCmd Flag commands.
FlagCmdTable  
Focus Focus information.
FocusTable  
FreqOffset Frequency offset information.
FreqOffsetTable  
GainCurve Gain curves in pointed directions.
GainCurveTable  
GainTracking Antenna gain tracking information.
GainTrackingTable  
History History information.
HistoryTable  
Main Data, coordinates and flags.
MainTable  
ObsSummary Observation summary information.
ObsSummaryTable  
ObsUnit Observation unit characteristics.
ObsUnitTable  
Pointing Antenna pointing information.
PointingTable  
Polarization Polarization information.
PolarizationTable  
Processor Processor characteristics.
ProcessorTable  
Receiver Receiver properties.
ReceiverTable  
ScanSummary Scan summary information.
ScanSummaryTable  
Schedule Schedule characteristics.
ScheduleTable  
Seeing Seeing information.
SeeingTable  
Source Source information.
SourceParameter Source parameter information.
SourceParameterTable  
SourceTable  
SpectralWindow Spectral window description.
SpectralWindowTable  
State State information.
StateTable  
SwitchCycle Cycle information in switching modes.
SwitchCycleTable  
SysCal System calibration.
SysCalTable  
Table A abstract class ancestor of all tables of AEDF instances.
TestTable1 A simple test program.
TestTable2 A simple test program.
TestTablePerf1  
TestXPath A simple test program.
TotPowMonitoring Total power data monitoring.
TotPowMonitoringTable  
Weather Weather station information.
WeatherTable  
WvmCal Radiometric calibration method.
WvmCalTable  
 

Exception Summary
AEDFException A Exception class to report problems occurring with classes in this packages.
 

Package alma.aedf.types Description

Provides classes implementing the different types of data structures defined in the Alma Export Data Format document and tables of these structures.

Implementing the Alma Export Data Format (AEDF)

For each type of structure defined in the AEDF there is a Java class implementing it. In the following we will designate these classes as AEDF classes.

"Non-defined" values.

It may happen that all the informations required to build an instance of an AEDF class are not available for example when the constructor of this is called. In such a case we use the following convention to code the fact that an instance variable is "non defined". These convention may also be useful to process non mandatory characteristics of an AEDF structure, setting one of these characteristics to its "non-defined" value indicates that it should not be considered as "present" in this instance.

Type "non-defined" value
int Integer.MIN_VALUE
float Float.NaN
double Double.NaN
String null
any array null


There is no way to say that a boolean instance variable is "non-defined".

AEDF Classes constructors.

For each AEDF class there is one complete constructor allowing to specify the value of each instance variable and one so-called empty constructor which takes no arguments.

Example: the class Antenna implements the AEDF ANTENNA which is defined as follows :

ANTENNA : antenna characteristics
Characteristic nameCharacteristic type
NAMEString
STATIONString
TYPEString
MOUNTString
POSITIONDouble(3)
OFFSETDouble(3)
DISH_DIAMETERDouble
ORBIT_IDInt
MEAN_ORBITDouble(6)
PHASED_ARRAY_IDDouble
FLAG_ROWBool


Then an instance of the Antenna class can be created as follows:
import alma.aedf.types.Antenna;
.
.
.
String name;
String station;
String type;
String mount;
double[] position;
double[] offset;
double dishDiameter;
int orbitId;
double[] meanOrbit;
int phasesArrayId;
boolean flagRow;
.
.
// Assign appropriate values to every variable declared above.
// and build an instance of Antenna
Antenna myAntenna = new Antenna(name,
                                  station,
                                  type,
                                  mount,
                                  position,
                                  offset,
                                  dishDiameter,
                                  orbitId,
                                  meanOrbit,
                                  phasesArrayId,
                                  flagRow);
                                                          

AEDF classes setters and getters.

For each class setters and getters are provided which allows to write / read the value of any instance variable corresponding to a characteristic in the AEDF.

Example:
import alma.aedf.types.Antenna;
Antenna myAntenna;
.
.
.
// Some code to instantiate myAntenna
.
.
// Use some setters and getters.
myAntenna.setMount("Mount31");

double offset = {10.0, 10.0, -4.};
myAntenna.setOffset(offset);

double[] position = myAntenna.getPosition();
if (position != null) {
	System.out.println(position[0]+","+position[1]+","+position[2]);
}

Output for writing in a VO Table : toTR.

The toTR produces a String whose content is the XML representation of this instance. This representation consists of a TR element with a collection of TD children elements.
Example:
import alma.aedf.types.DataDescription; 
.
.
.
DataDescription myDD = new DataDescription(1, 2, -1, false);
System.out.println(myDD.toTR());
.
.
.

should display :
<TD>1</TD><TD>2</TD><TD>-1</TD><TD>false</TD>

Tables of AEDF classes instances.

For each AEDF class there is a class implementing a table of instances of this AEDF class. The name of such a table consists of the word Table appended to the name of the AEDF class. For example the Antenna class has its AntennaTable class.

Creating a table.

A table can be created and filled in different ways : Example with a constructor.
import alma.aedf.type.SpectralWindow;
import alma.aedf.type.SpectralWindowTable;


SpectralWindowTable mySPWinTable;
.
.
try {
	mySPWinTable = new SpectralWindowTable("myUID", "myProjectUID");
} 
catch (Exception e) {
			e.printStackTrace();
}
One can see that the constructor expects two String arguments. Both are used to store identifiers; the first one is the identifier of the table itself in some archiving system (very likely the ALMA Archiving system) and the second one the identifier of the project this table belongs to. Once it's created the table is empty, it contains no SpectralWindow instances, a call to its nRows returns 0.

Example with a call to fromXML.
import alma.aedf.types.SpectralWindowTable;
String xmlString;

/*
** Here some code to assign to xmlString the text of a VO Table describing
** a SpectralWindow table (e.g. retrieving it from the Archive, or reading it
** in a file).
**
*/
.
.
.
/*
** Then build a SpectralWindowTable from the value of xmlString.
*/ 
SpectralWindowTable mySPWin = SpectralWindowTable.fromXML(xmlString);	
System.out.println("This table belongs to project with UID = " + spt.getProjectUID());
System.out.println("It has " + spt.nRows() + " rows");


The table created with this method, contains as many instances of SpectralWindow as there are TR elements in the TABLEDATA part of the VO Table. One can see in the example above the use of two querying methods getProjectUID and nRows returning respectively the identifier of the project the table belongs to and the number of SpectralWindow instances stored in it.

Adding a row in a table: add.


Example
import alma.aedf.types.DataDescription;
import alma.aedf.types.DataDescriptionTable;

DataDescription myDDTable = new DataDescriptionTable("someId", "someProjectId");

System.out.println(myDDTable.nRows);
myDDTable.add(new DataDescription(1, 2, -1, false)); 
System.out.println(myDDTable.nRows);
.
.

The DataDescriptionTable instance initially contains no DataDescription instance, then one DataDescription is added to the table. The example above output successively 0 and 1.

Set methods

The most important/useful set methods are :

Get methods

Useful get methods are :

VO Table output : toXML

This method returns the VO Table representation of the table :

Example:
import alma.aedf.types.DataDescription;
import alma.aedf.types.DataDescriptionTable;
.
.
DataDescriptionTable myDDTable = new DataDescriptionTable("someUID", "someProjectUID");

myDDTable.add(new DataDescription(0, 0, -1, false));
myDDTable.add(new DataDescription(1, 2, -1, false));

String xmlString = myDDTable.toXML();
System.out.println(xmlString);


displays :

<?xml version="1.0"?>
<!-- New document created at Thu Jan 29 11:03:32 CET 2004 -->
<VOTABLE version="1">
    <RESOURCE name="PARAMS">
       <PARAM datatype="char" name="AEDF_TYPE" value="DATA_DESCRIPTION">
            <DESCRIPTION>Data description table. This table defines the shape of
             the associated DATA in MAIN, and is indexed directly by DATA_DESC_ID.            
            </DESCRIPTION>
        </PARAM>
        <PARAM datatype="char" name="PROJECT_UID" value="TBD">
            <DESCRIPTION>This parameter contains the identifier of the project this table 
                belongs to.            
            </DESCRIPTION>
        </PARAM>
    </RESOURCE>
    <RESOURCE name="TABLE">
        <TABLE>
            <FIELD datatype="int" name="SPECTRAL_WINDOW_ID">
                <DESCRIPTION>
                   Spectral Window Identifier (0-based index into the  collection of TABLEDATA's 
                   TRs children of the attached SPECTRAL_WINDOW VOTABLE. )
                </DESCRIPTION>
            </FIELD>
            <FIELD datatype="int" name="POLARIZATION_ID">
                <DESCRIPTION>Polarization Identifier (0-based index into the collection of 
                TABLEDATA's TRs children of the attached SPECTRAL_WINDOW VOTABLE.)                </DESCRIPTION>
            </FIELD>
            <FIELD datatype="int" name="LAG_ID">
                <DESCRIPTION>Lag function identifier</DESCRIPTION>
            </FIELD>
            <FIELD datatype="boolean" name="FLAG_ROW">
                <DESCRIPTION>Row Flag</DESCRIPTION>
            </FIELD>
            <DATA>
                <TABLEDATA>                
                <TR>
                  <TD>0</TD><TD>0</TD><TD>-1</TD><TD>false</TD>
                </TR>
                <TR>
                  <TD>1</TD><TD>2</TD><TD>-1</TD><TD>false</TD>
                </TR>
                </TABLEDATA>
            </DATA>
        </TABLE>
    </RESOURCE>
</VOTABLE>