EphemerisTable¶
-
class
EphemerisTable(container)[source]¶ Bases:
objectThe EphemerisTable class is an Alma table.
Shown here are the fields found in each row.
The key fields are shown first and used (together) to index a unique row. Key fields are all required and indicated by “Key.” following the description.
Other fields are required unless “optional” is shown for that field.
The field description text here is as found in the model used to generate the code.
Types may be an enumeration or extended pyasdm type. Fields that are python lists are indicated that by “[]” in the type and having the word “Array” at the start of description followed by the expected number of elements in that list in parentheses. Lists (arrays) may be multi-dimensional (lists of lists) and are indicated by [][] … etc as needed to indicate the expected number of dimensions. Multi-dimenstional lists will show the expected number of elements for each dimension also in the parenthese after “Array”.
The use of “auto-incrementable” indicates that that field is auto-generated when the table is created and that field is set, as necessary, to create a unique key for the specific row being added, by incrementing that value from the previous highest value needed for the rest of the elements of the key on that row. Such a field can not be set independently, it is only set when the row is added to the table by that auto-increment mechanism.
-
timeInterval¶ interval of time during which the data are relevant. key.
- Type
-
ephemerisId¶ identifies a collection of rows in the table. key.
- Type
int
-
observerLocation¶ Array(3) a triple of double precision values defining the observer location. This triple contains in that order the longitude, the latitude and the altitude of the observer : <ul> <li> the longitude is expressed in radian. An east (resp. west) longitude is denoted as a positive (resp. negative) quantity.</li> <li> the latitude is expressed in radian. A north (resp. south) latitude is denoted as a positive (resp. negative) quantity. </li> <li> the altitude is expressed in meter. It’s the altitude above the reference ellipsoid. </li> </ul> A triple with all its elements equal to 0.0 will mean that a geocentric coordinate system is in use instead of a topocentric one.
- Type
float []
-
equinoxEquator¶ epoch at which equator and equinox were calculated for ephemeris. Expresses a year as a decimal value (J2000 would be represented as 2000.0).
- Type
float
-
numPolyDir¶ the number of coefficients of the polynomial stored in phaseDir. It has to be >= 1 .
- Type
int
-
dir¶ Array(numPolyDir, 2) the ephemeris direction expressed in radian. The nominal entry in the phaseDir, delayDir, or ReferenceDir in the Field table serves as additional offset to the direction described by “dir”. The actual direction is obtained by composition, e.g. actual phase direction = [phasDir value from Field table] + [dir]. The direction described by dir is the result of the sum [ dir_{0,i} + dir_{1,i}*dt + dir_{2,i}*dt^2 + … + dir_{numPolyDir-1,i}*dt^{numPolyDir-1}, forall i in {0,1} ] where [ dt = t - timeOrigin ]
- Type
float [] []
-
numPolyDist¶ the number of coefficients of the polynomial stored in distance. It has to be >= 1 .
- Type
int
-
distance¶ Array(numPolyDist) the coefficiens of the polynomial used to calculate the distance, expressed in meter, to the object from the position of the antenna along the given direction. This distance is the result of the sum : [ distance_0 + distance_1*dt + distance_2*dt^2 + … + distance_{numPolyDist-1}*dt^{numPolyDist-1} ] where [ dt = t - timeOrigin ].
- Type
float []
-
origin¶ the origin of the ephemeris information.
- Type
str
-
numPolyRadVel¶ the number of coefficients of the polynomial stored in radVel . It has to be >= 1 . Optional.
- Type
int
-
radVel¶ Array(numPolyRadVel) the coefficients of a polynomial expressing a radial velocity as a function of the time expressed in m/s. The time origin used to tabulate the polynomial is stored in timeOrigin. Optional.
- Type
float []
Methods Summary
Key(ephemerisId)Returns a string built by concatenating the ascii representation of the parameters values suffixed with a “_” character.
MIMEXMLPart(byteOrder)Used in both the small XML file as well as the bin file when writing out as binary.
add(x)Add a row.
checkAndAdd(x)A method to append a row to its table, used by input conversion methods.
checkPresenceInMemory()Check if the table is present in memory.
fromXML(xmlstr)Populate this table from the content of a XML document that is required to conform to the XML schema defined for a Ephemeris (EphemerisTable.xsd).
get()Get all rows.
getByContext(ephemerisId)Returns all the rows sorted by ascending startTime for a given context.
getContainer()Return the container to which this table belongs.
getEntity()Returns the table’s entity.
getKeyName()Return the list of field names that make up key key as a list of strings.
getName()Return the name of this table.
getRowByKey(timeInterval, ephemerisId)Returns a EphemerisRow given a key.
getRows()get the rows, synonymous with the get method.
getVersion()insertByStartTime(x, rowlist)Insert a EphemerisRow in a list of EphemerisRow so that it’s ordered by ascending start time.
newRow(timeInterval, ephemerisId, …)Create a new EphemerisRow initialized to the specified values.
newRowCopy(row)Create a new row using a copy constructor mechanism.
newRowDefault()Create a new row with default values.
setEntity(e)Set the table’s entity The parameter, e, must be an Entity
setFromFile(directory)Reads and parses a file containing a representation of a EphemerisTable as those produced by the toFile method.
setFromMIME(byteStream)Extracts the binary part of a MIME message and deserialize its content to fill this with the result of the deserialization.
setFromMIMEFile(directory)Set this table from a MIME file.
setFromXMLFile(directory)This is the function used by setFromFile when the file is an XML file Not intended for external use.
setNotPresentInMemory()Set the state to indicate it is not present in memory and needs to be loaded before being used.
setVersion(version)size()Return the number of rows in the table.
toFile(directory)Stores a representation (binary or XML) of this table into a file.
toMIME(mimeFilePath, mimeXMLpart, byteOrder)Write this out to mimeFilePath as a serialized MIME file with a leading XML part and a following binary part.
toXML()Translate this table to an XML representation conforming to the schema defined for Ephemeris (EphemerisTable.xsd).
Methods Documentation
-
Key(ephemerisId)[source]¶ Returns a string built by concatenating the ascii representation of the parameters values suffixed with a “_” character.
-
MIMEXMLPart(byteOrder)[source]¶ Used in both the small XML file as well as the bin file when writing out as binary. The byte order is set by byteOrder.
-
add(x)[source]¶ Add a row. x the EphemerisRow to be added.
return a EphemerisRow. If the table contains a EphemerisRow whose attributes (key and mandatory values) are equal to this in x then this returns that previously added EphemerisRow, otherwise x is returned.
- raises DuplicateKey when the table contains a EphemerisRow with a key equal to the key in x but having
a value section different from the values in x.
note The row is inserted in the table in such a way that all the rows having the same value of ( ephemerisId ) are stored by ascending time.
-
checkAndAdd(x)[source]¶ A method to append a row to its table, used by input conversion methods. Not indended for external use.
If this table has an autoincrementable attribute then check if x verifies the rule of uniqueness and throw exception if not.
This method is appropriate for the case with a ArrayTimeInterval temporal key, no auto incrementable attribute, with other values in the key.
Append x to its table. x The row to be appended. returns x.
-
checkPresenceInMemory()[source]¶ Check if the table is present in memory. If not, load the table from the file using the directory of the container.
-
fromXML(xmlstr)[source]¶ Populate this table from the content of a XML document that is required to conform to the XML schema defined for a Ephemeris (EphemerisTable.xsd).
-
getByContext(ephemerisId)[source]¶ Returns all the rows sorted by ascending startTime for a given context. The context is defined by a value of ( ephemerisId ).
return a list of EphemerisRow. A None value is returned if the table contains no EphemerisRow for the given ( ephemerisId ).
-
getRowByKey(timeInterval, ephemerisId)[source]¶ Returns a EphemerisRow given a key. return the row having the key whose values are passed as parameters, or None if no row exists for that key.
-
insertByStartTime(x, rowlist)[source]¶ Insert a EphemerisRow in a list of EphemerisRow so that it’s ordered by ascending start time.
x The EphemerisRow to be inserted. rowlist The list where x is to be inserted.
The inserted row is returned. If x already exists in rowlist then it is not added and the row in rowlist is returned.
If a row matching the value of the start time of timeInterval is found in rowlist but the other required parameters do not have the same value then a DuplicateKey exception is raised.
-
newRow(timeInterval, ephemerisId, observerLocation, equinoxEquator, numPolyDir, dir, numPolyDist, distance, timeOrigin, origin)[source]¶ Create a new EphemerisRow initialized to the specified values.
The new row is not added to this table, but it does know about it. (the autoincrementable attribute, if any, is not in the parameter list)
-
newRowCopy(row)[source]¶ Create a new row using a copy constructor mechanism.
The method creates a new EphemerisRow which knows about this table. Each attribute of the created row is a (deep) copy of the corresponding attribute of row. The method does not add the created row to this, it simply parents it to this, a call to the add method has to be done in order to get the row added (very likely after having modified some of its attributes. If row is None then the method returns a new EphemerisRow with default values for its attributes.
-
newRowDefault()[source]¶ Create a new row with default values. The new row is not added to this table but it knows about it.
-
setFromFile(directory)[source]¶ Reads and parses a file containing a representation of a EphemerisTable as those produced by the toFile method. This table is populated with the result of the parsing. param directory The name of the directory containing the file te be read and parsed. raises ConversionException If any error occurs while reading the files in the directory or parsing them.
-
setFromMIME(byteStream)[source]¶ Extracts the binary part of a MIME message and deserialize its content to fill this with the result of the deserialization. param byteStream the previously opened io.BufferedReader instance containing the data to be extracted.
It is the responsibility of this method to close byteStream.
-
setFromMIMEFile(directory)[source]¶ Set this table from a MIME file. Used internally by setFromFile. Not intended for external use.
-
setFromXMLFile(directory)[source]¶ This is the function used by setFromFile when the file is an XML file Not intended for external use.
-
setNotPresentInMemory()[source]¶ Set the state to indicate it is not present in memory and needs to be loaded before being used. This is used by the container class when loaded from a file and this table is present with non-zero rows. Tables are loaded on demand when the get function in the container for that table is used.
-
toFile(directory)[source]¶ Stores a representation (binary or XML) of this table into a file.
Depending on the boolean value of its _fileAsBin data member a binary serialization of this (_fileAsBin==True) will be saved in a file “Ephemeris.bin” or an XML representation (_fileAsBin==False) will be saved in a file “Ephemeris.xml”. The file is always written in a directory whose name is passed as a parameter. param directory The name of directory where the file containing the table’s representation will be saved. raises ConversionException for any errors while writing that file.
-
toMIME(mimeFilePath, mimeXMLpart, byteOrder)[source]¶ Write this out to mimeFilePath as a serialized MIME file with a leading XML part and a following binary part.
The mimeXMLpart is a string that should have already been written to the corresponding small XML file (and is returned by the MIMEXMLPart method here). The byteOrder is a ByteOrder instance that gives the byte order to use when writing the binary data. That instance should have also been used to generate mimeXMLpart.
-