Description of all Nenums methods - AlanLoh/nenums GitHub Wiki
Here is a list of the main methods used in the package:
- XST Class
- MS Class
- Astrometry utility functions
- ANTENNA Table creation
- MS table creation and management
- Progress Bar
File: XST.py
Checks that self.xstfile is a proper XST observation
Read XST fits file and fill the class attributes (headers, list of mini-arrays, frequencies, times and data)
File: MS.py
Performs the creation and filling of a Measurement Set.
File: utils/astro.py
Utility functions for astrometry and positionning.
Create the astropy coordinates object corresponding to the Nançay station.
Return the light speed
Compute the (RA,DEC) coordinates from an (azimuth, elevation) at a specific time.
- az : float azimuth in degrees (North = 0, increasing eastward)
- alt : float altitude (elevation) in degrees
- t : str or Time time at which to compute the corresponding RA Dec Returns
- ra : float Right Ascension in radians
- dec : float Declination in radians
File: Utils/makeant.py
Program used to produce the ANTENNA table in the Measurement Set data format.
depends on: locationsSB2.dat which contains antenna position of radiotelescope in ETRS X,Y,Z coordinates
requires: Pyrap
File: utils/ms.py Contains all required methods to process a MS.
Create an ANTENNA table for a Measurement Set
- msname : str Name of the Measurement Set
- miniarrays : np.ndarray Mini-Arrays from a XST file (ext: 1, key: 'noMROn')
Create an empty Measurement Set designed for NenuFAR XST observations. This function calls an external program makems which is a LOFAR soft.
- msname : str Name of the Measurement Set
- start : (str, Time) Beginning of the observation. XST cross-correlations are computed at the local zenith. It helps initializing the tracked RA / Dec.
- dt : float Time step of the XST observation, in seconds
- bwidth : float Spectral bandwidth in Hz
- sbpertime : int Number of sub-bands per unit of time xstsbbands : np.ndarray Sub-bands of a XST file (ext: 7, key: 'xstsubband')
Add observation standard information to the Measurement Set. These infos are retrieved from the XST header.
- msname : str Name of the Measurement Set
- xstheader : fits.header XST file header (ext: 0)
Fill the frequency / spectral windows columns of the MS
- msname : str Name of the Measurement Set
- xstsbbands : np.ndarray Sub-bands of a XST file (ext: 7, key: 'xstsubband')
Fill the TIME column of the MS based on XST times (in Julian Days)
- msname : str Name of the Measurement Set
- xsttime : np.ndarray Time array from a XST file (in JD)
Fill the Data Description ID column of the MS based on XST subbands info
- msname : str Name of the Measurement Set
- xstsbbands : np.ndarray Sub-bands of a XST file (ext: 7, key: 'xstsubband')
Fill the DATA column of the MS based on XST cross-correlations
- msname : str Name of the Measurement Set
- builtma : np.ndarray Mini-Arrays on the field, from the XST file (ext: 1, key: 'noMR')
- xstdata : np.ndarray Cross-correlations from the XST file (ext: 7, key: 'data')
Re-compute the UVW table of the Measurement Set. emptyMS() automatically creates a UVW table as if initial RA Dec (zenith at start) was tracked. However, XST are cross-correlations fixed at the local zenith. Therefore, the correct UVW table must be copied from the first time step.
- msname : str Name of the Measurement Set
XST Cross-Correlations are phased at the local zenith. UVW are supposed to also be computed at the local zenith (zenithUVW()). In order to produce a tracking observation, this function recompute UVWband re-phase the visibilities towards a new phase center (ra_center, dec_center)
- msname : str Name of the Measurement Set
- xsttime : np.ndarray Time array from a XST file (in JD)
- ra_center : float Right-Ascension of the tracked target (in radians)
- dec_center : float Declination of the tracked target (in radians)
Add pointing informations to the MS
- msname : str Name of the Measurement Set
- ra_center : float Right-Ascension of the tracked target (in radians)
- dec_center : float Declination of the tracked target (in radians)
Remove unused sub-items created during the MS construction process
- msname : str Name of the Measurement Set
Split the MS by sub-bands, as LOFAR
- msname : str Name of the Measurement Set
- remove : bool, optional Remove the Measurement Set once it has correctly been split (default = False)
Keep track of the modifications. Store everything into the HISTORY table of the Measurment set
- msname : str Name of the Measurement Set
- message : str Message to be kept in HISTORY
Compute a 3D rotation matrix
- ra : float Right Ascension (in radians)
- dec : float Declination (in radians) Returns
- rot : np.ndarray Rotation matrix
- w : np.ndarray W vector
Check that the MS exists
Add Imaging columns to the MS (Not done by default because this increase the size of the MS, which is not wanted for data storage purpose)
Check that all required Mini-Arrays are in the location file
- miniarrays : np.ndarray Mini-Arrays from a XST file (ext: 1, key: 'noMROn')
Check that the sum of all auto-correlations imag( XY ) + imag( YX ) is 0. This method is completely independent from the way data are stored in the MS.
File: utils/progressbar.py Display an eye-candy progress bar during the conversion.