SpectralWindowTable¶
-
class
SpectralWindowTable(container)[source]¶ Bases:
objectThe SpectralWindowTable class is an Alma table.
Spectral window description. The convention in ALMA is to describe the frequency axis in the topocentric reference frame. If this is not the case (for instance if active Doppler tracking is implemented) then measFreqRef should be set accordingly.
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.
-
basebandName¶ identifies the baseband.
- Type
-
netSideband¶ identifies the net sideband.
- Type
-
numChan¶ the number of frequency channels.
- Type
int
-
sidebandProcessingMode¶ identifies the sideband processing mode.
-
windowFunction¶ identifies the window function.
- Type
-
numBin¶ the number of channels used in any post-FFT averaging. Optional.
- Type
int
-
chanFreqArray¶ Array(numChan) the frequencies defined as an array (numChan values). Optional.
- Type
Frequency []
-
correlationBit¶ identifies the number of bits used in the signal representation. Optional.
- Type
-
freqGroup¶ the frequency group number. Optional.
- Type
int
-
freqGroupName¶ the frequency group name. Optional.
- Type
str
-
lineArray¶ Array(numChan) indicates lines (true) versus baselines (false). Optional.
- Type
bool []
-
measFreqRef¶ the reference frame of the frequencies. Optional.
-
name¶ a name for this spectral window. Optional.
- Type
str
-
oversampling¶ data are “oversampled” (true) or not (false). Optional.
- Type
bool
-
quantization¶ a quantization correction has been applied (true) or not applied (false). Optional.
- Type
bool
-
refChan¶ the reference channel “number”. Optional.
- Type
float
-
numAssocValues¶ the number of associated values. Optional.
- Type
int
-
assocNature¶ Array(numAssocValues) the natures of the associations with the rows refered to by assocSpectralWindowId. Optional.
- Type
-
assocSpectralWindowId¶ Array(numAssocValues) refers to a collection of associated rows in the table. Optional.
- Type
Tag []
-
imageSpectralWindowId¶ refers to a unique row in the table (image sideband description). Optional.
- Type
-
dopplerId¶ refers to a collection of rows in DopplerTable. Optional.
- Type
int
Methods Summary
MIMEXMLPart(byteOrder)Used in both the small XML file as well as the bin file when writing out as binary.
add(x)Look up the table for a row whose noautoincrementable attributes are matching their homologues in x.
autoIncrement(key, x)For internal use.
checkAndAdd(x)A method to append a row to it’s 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 SpectralWindow (SpectralWindowTable.xsd).
get()Get all rows.
getChanFreqArrayEqTolerance()A getter for the tolerance on chanFreqArray Returns the tolerance as a Frequency
getChanFreqStartEqTolerance()A getter for the tolerance on chanFreqStart Returns the tolerance as a Frequency
getChanFreqStepEqTolerance()A getter for the tolerance on chanFreqStep Returns the tolerance as a Frequency
getChanWidthArrayEqTolerance()A getter for the tolerance on chanWidthArray Returns the tolerance as a Frequency
getChanWidthEqTolerance()A getter for the tolerance on chanWidth Returns the tolerance as a Frequency
getContainer()Return the container to which this table belongs.
getEffectiveBwArrayEqTolerance()A getter for the tolerance on effectiveBwArray Returns the tolerance as a Frequency
getEffectiveBwEqTolerance()A getter for the tolerance on effectiveBw Returns the tolerance as a Frequency
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.
getRefFreqEqTolerance()A getter for the tolerance on refFreq Returns the tolerance as a Frequency
getResolutionArrayEqTolerance()A getter for the tolerance on resolutionArray Returns the tolerance as a Frequency
getResolutionEqTolerance()A getter for the tolerance on resolution Returns the tolerance as a Frequency
getRowByKey(spectralWindowId)Returns a SpectralWindowRow given a key.
getRows()get the rows, synonymous with the get method.
getTotBandwidthEqTolerance()A getter for the tolerance on totBandwidth Returns the tolerance as a Frequency
getVersion()lookup(basebandName, netSideband, numChan, …)Look up the table for a row whose all attributes except the autoincrementable one are equal to the corresponding parameters of the method.
newRow(basebandName, netSideband, numChan, …)Create a new SpectralWindowRow initialized to the specified values.
newRowCopy(row)Create a new row using a copy constructor mechanism.
newRowDefault()Create a new row with default values.
setChanFreqArrayEqTolerance(tolerance)A setter for the tolerance on chanFreqArray
setChanFreqStartEqTolerance(tolerance)A setter for the tolerance on chanFreqStart
setChanFreqStepEqTolerance(tolerance)A setter for the tolerance on chanFreqStep
setChanWidthArrayEqTolerance(tolerance)A setter for the tolerance on chanWidthArray
setChanWidthEqTolerance(tolerance)A setter for the tolerance on chanWidth
setEffectiveBwArrayEqTolerance(tolerance)A setter for the tolerance on effectiveBwArray
setEffectiveBwEqTolerance(tolerance)A setter for the tolerance on effectiveBw
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 SpectralWindowTable 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.
setRefFreqEqTolerance(tolerance)A setter for the tolerance on refFreq
setResolutionArrayEqTolerance(tolerance)A setter for the tolerance on resolutionArray
setResolutionEqTolerance(tolerance)A setter for the tolerance on resolution
setTotBandwidthEqTolerance(tolerance)A setter for the tolerance on totBandwidth
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 SpectralWindow (SpectralWindowTable.xsd).
Methods Documentation
-
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]¶ Look up the table for a row whose noautoincrementable attributes are matching their homologues in x. If a row is found that row else autoincrement x.spectralWindowId, add x to its table and returns x.
returns a SpectralWindowRow. x. A row to be added.
-
checkAndAdd(x)[source]¶ A method to append a row to it’s 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 raise an exception if not.
Append x to its table. x is 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 SpectralWindow (SpectralWindowTable.xsd).
-
getChanFreqArrayEqTolerance()[source]¶ A getter for the tolerance on chanFreqArray Returns the tolerance as a Frequency
-
getChanFreqStartEqTolerance()[source]¶ A getter for the tolerance on chanFreqStart Returns the tolerance as a Frequency
-
getChanFreqStepEqTolerance()[source]¶ A getter for the tolerance on chanFreqStep Returns the tolerance as a Frequency
-
getChanWidthArrayEqTolerance()[source]¶ A getter for the tolerance on chanWidthArray Returns the tolerance as a Frequency
-
getChanWidthEqTolerance()[source]¶ A getter for the tolerance on chanWidth Returns the tolerance as a Frequency
-
getEffectiveBwArrayEqTolerance()[source]¶ A getter for the tolerance on effectiveBwArray Returns the tolerance as a Frequency
-
getEffectiveBwEqTolerance()[source]¶ A getter for the tolerance on effectiveBw Returns the tolerance as a Frequency
-
getRefFreqEqTolerance()[source]¶ A getter for the tolerance on refFreq Returns the tolerance as a Frequency
-
getResolutionArrayEqTolerance()[source]¶ A getter for the tolerance on resolutionArray Returns the tolerance as a Frequency
-
getResolutionEqTolerance()[source]¶ A getter for the tolerance on resolution Returns the tolerance as a Frequency
-
getRowByKey(spectralWindowId)[source]¶ Returns a SpectralWindowRow given a key. return the row having the key whose values are passed as parameters, or None if no row exists for that key.
param spectralWindowId.
-
getTotBandwidthEqTolerance()[source]¶ A getter for the tolerance on totBandwidth Returns the tolerance as a Frequency
-
lookup(basebandName, netSideband, numChan, refFreq, sidebandProcessingMode, totBandwidth, windowFunction)[source]¶ Look up the table for a row whose all attributes except the autoincrementable one are equal to the corresponding parameters of the method. return this row if any, None otherwise.
param basebandName.
param netSideband.
param numChan.
param refFreq.
param sidebandProcessingMode.
param totBandwidth.
param windowFunction.
-
newRow(basebandName, netSideband, numChan, refFreq, sidebandProcessingMode, totBandwidth, windowFunction)[source]¶ Create a new SpectralWindowRow 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 SpectralWindowRow 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 SpectralWindowRow 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 SpectralWindowTable 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 “SpectralWindow.bin” or an XML representation (_fileAsBin==False) will be saved in a file “SpectralWindow.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.
-