This document recapitulates the entities defined in the Alma Science Data Model (ASDM) from a programmer's perspective. For each attribute of each ASDM entity, it provides its name , its types in the C++ and Java implementations. When this attribute happens to be an array, the shape (i.e. the sizes of all dimensions) is also provided as long as it can be expressed in a simple way.
A type is expressed by using the exact syntaxes of Java and C++ :
A shape is a comma separated list, possibly empty, of arithmetic expressions whose operands can be integer values, names of attributes of the same entity or names of attributes of another entity; in the latter case, the attribute name is prefixed by the entity name. Examples of shapes are "2" or "numPoly+1,2" or "Feed.numReceptors, numPoly".
A shape must be understood as the list of dimensions sizes read from the left to the right. For example a shape "numPoly+1,2" for an array of int defined for some attribute of an entity A corresponds to :
Note that in that case numPoly refers to an attribute of A.
Name | Java type | C++ type | Array's shape |
---|---|---|---|
numReceptors | int | int | |
. | . | . | . |
. | . | . | . |
receiverId | int[] | vector < int > | numReceptors |
When a shape defined for an attribute of an entity A refers to an attribute which belongs to another entity B, it's always possible to retrieve which instance of entity B must be considered since amongst its attributes the entity A always have the ones which form the key of entity B. As an example consider the Main entity and its attribute stateId :
Name | Java type | C++ type | Array's shape |
---|---|---|---|
configDescriptionId | Tag | Tag | |
. | . | . | . |
. | . | . | . |
stateId | Tag[] | vector < Tag > | ConfigDescription.numAntenna |
stateId is a 1D array of Tag and its size is specified as "ConfigDescription.numAntenna"; but one can also see that the Main entity has a configDescriptionId attribute, key of the ConfigDescription entity. Using the value of this configDescriptionId attribute it's possible to retrieve the relevant ConfigDescription instance (using the getRowByKey method of the ConfigDescriptionTable) and finally the value of its numAntenna attribute.
Example 1.1. A simple example without a shape.
In the DataDescrition entity we find :Name | Java type | C++ type | Array's shape |
---|---|---|---|
spectralWindowId | Tag | Tag |
Example 1.2. A shape referring to an attribute of the same entity.
In the Polarization entity we find :Name | Java type | C++ type | Array's shape |
---|---|---|---|
numCorr | int | int | |
corrType | int[] | vector < int > | numCorr |
corrProduct | int[][] | vector < vector < int > > | numCorr,2 |
The shape of corrType refers to numProduct which is an attribute of the same entity, in other words the following logical expressions in Java and in C++ :
// -----------------Java------------------------------------ // Let's assume that pRow is a Java instance of PolarizationRow // added to the PolarizationTable of an ASDM. pRow.getCorrType().length == pRow.getNumCorr(); // -----------------C++------------------------------------ // Let's assume that pRow is a C++ instance of PolarizationRow // added to the PolarizationTable of an ASDM. pRow.getCorrType().size() == pRow.getNumCorr();
should both evaluate to true.
The shape of CorrProduct refers to numProd as being the size of its first dimension, 2 being the size of the second. Upon execution of the following snippets of Java and C++ code:
// -----------------Java------------------------------------ // Let's assume that pRow is a Java instance of PolarizationRow // added to the PolarizationTable of an ASDM. boolean sameSize1 = pRow.getCorrProduct().length == pRow.getNumCorr(); boolean sameSize2 = true; for (int i = 0; i < pRow.getCorrProduct().length; i++) sameSize2 = sameSize2 && (pRow.getCorrProduct()[i].length == 2); // -----------------C++------------------------------------ // Let's assume that pRow is a C++ instance of PolarizationRow // added to the PolarizationTable of an ASDM. bool sameSize1 = pRow.getCorrProduct().size() == pRow.getNumCorr(); bool sameSize2 = true; for (int i = 0; i < pRow.getCorrProduct().size(); i++) sameSize2 = sameSize2 && (pRow.getCorrProduct().at(i).size() == 2);
the two logical variables sameSize1 and sameSize2 should evaluate to true.
Example 1.3. A shape referring to an attribute of another entity.
In the CalDevice entity we find :Name | Java type | C++ type | Array's shape |
---|---|---|---|
antennaId | Tag | Tag | |
feedId | int | int | |
spectralWindowId | Tag | Tag | |
timeInterval | ArrayTimeInterval | ArrayTimeInterval | |
numCalload | int | int | |
calEff | float[][] | vector < vector < float > > | numCalload, Feed.numReceptors |
// -----------------Java------------------------------------ // Let's assume that cdRow is a Java instance of CalDeviceRow // added to the CalDeviceTable of an ASDM. // Let's retrieve the value of the numReceptors attribute // in the associated FeedRow. int numReceptors = cdRow.getTable() .getContainer() .getFeed() .getRowByKey(cdRow.getFeedId(), cdRow.getAntennaId(), cdRow.getSpectralWindowId(), cdRow.getTimeInterval()) .getNumReceptors(); boolean sameSize1 = cdRow.getCalEff.length == cdRow.getNumCalload(); boolean sameSize2 = true; for (int i = 0; i < cdRow.getCalEff.length; i++) { sameSize2 = sameSize2 && (cdRow.getCalEff()[i].length == numReceptors); } // -----------------C++------------------------------------ // Let's assume that cdRow is an instance of CalDeviceRow // added to the CalDeviceTable of an ASDM. // Let's retrieve the value of the numReceptors attribute // in the associated FeedRow. int numReceptors = cdRow.getTable() .getContainer() .getFeed() .getRowByKey(cdRow.getFeedId(), cdRow.getAntennaId(), cdRow.getSpectralWindowId(), cdRow.getTimeInterval()) ->getNumReceptors(); bool sameSize1 = cdRow.getCalEff().size() == cdRow.getNumCalload(); bool sameSize2 = true; for (int i = 0; i < cdRow.getCalEff().size(); i++) { sameSize2 = sameSize2 && (cdRow.getCalEff()[i].size() == numReceptors); }
the two logical variables sameSize1 and sameSize2 should both evaluate to true.