hsd_k2jycal¶
- hsd_k2jycal(dbservice: bool | None = None, endpoint: str | None = None, reffile: str | None = None, infiles: str | list[str] | None = None, caltable: str | list[str] | None = None) ResultsList[SDK2JyCalResults][source]¶
Obtain and apply the Kelvin-to-Jansky conversion factors.
Reads Kelvin-to-Jansky (Jy/K) conversion factors from a
jyperk_query.csvfile (whendbservice=True, the default, these are queried from the online database) or from a manually providedjyperk.csvfile. Factors are stored per MS, per spw, per antenna, and per polarization.The WebLog lists the applied Jy/K factors and displays plots of them:
For MOUSs with fewer than 5 EBs: a scatter plot of factors.
For MOUSs with 5 or more EBs: a box plot. Outliers (per the matplotlib boxplot definition) are plotted as individual points labeled with their EB name.
Plots of Jy/K conversion factors. (a) Fewer than 5 EBs: scatter plot. (b) 5 or more EBs without outliers: box plot. (c) 5 or more EBs with outliers: box plot with points and EB names indicated.¶
- Parameters:
dbservice --
Whether or not accessing Jy/K DB to retrieve conversion factors.
Default: None (equivalent to True)
endpoint --
Which endpoints to use for query.
Options: 'asdm', 'model-fit', 'interpolation'
Default: None (equivalent to 'asdm')
reffile --
Path to a file containing Jy/K factors for science data, which must be provided by associating calibrator reduction or the observatory measurements. Jy/K factor must take into account all efficiencies, i.e., it must be a direct conversion factor from Ta* to Jy. The file must be in either MS-based or session-based format. The MS-based format must be in an CSV format with five fields: MS name, antenna name, spectral window id, polarization string, and Jy/K conversion factor. Example for the file is as follows:
MS,Antenna,Spwid,Polarization,Factor uid___A002_X316307_X6f.ms,CM03,5,XX,10.0 uid___A002_X316307_X6f.ms,CM03,5,YY,12.0 uid___A002_X316307_X6f.ms,PM04,5,XX,2.0 uid___A002_X316307_X6f.ms,PM04,5,YY,5.0
The first line in the above example is a header which may or may not exist. Example for the session-based format is as follows:
#OUSID=XXXXXX #OBJECT=Uranus #FLUXJY=yy,zz,aa #FLUXFREQ=YY,ZZ,AA #sessionID,ObservationStartDate(UTC),ObservationEndDate(UTC), Antenna,BandCenter(MHz),BandWidth(MHz),POL,Factor 1,2011-11-11 01:00:00,2011-11-11 01:30:00,CM02,86243.0,500.0,I,10.0 1,2011-11-11 01:00:00,2011-11-11 01:30:00,CM02,86243.0,1000.0,I,30.0 1,2011-11-11 01:00:00,2011-11-11 01:30:00,CM03,86243.0,500.0,I,50.0 1,2011-11-11 01:00:00,2011-11-11 01:30:00,CM03,86243.0,1000.0,I,70.0 1,2011-11-11 01:00:00,2011-11-11 01:30:00,ANONYMOUS,86243.0,500.0,I,30.0 1,2011-11-11 01:00:00,2011-11-11 01:30:00,ANONYMOUS,86243.0,1000.0,I,50.0 2,2011-11-13 01:45:00,2011-11-13 02:15:00,PM04,86243.0,500.0,I,90.0 2,2011-11-13 01:45:00,2011-11-13 02:15:00,PM04,86243.0,1000.0,I,110.0 2,2011-11-13 01:45:00,2011-11-13 02:15:00,ANONYMOUS,86243.0,500.0,I,90.0 2,2011-11-13 01:45:00,2011-11-13 02:15:00,ANONYMOUS,86243.0,1000.0,I,110.0
Lines starting with '#' are meta data and header. The header must exist. The factor to apply is identified by matching the session ID, antenna name, frequency and polarization of data in each line of the file. Note the observation date is supplementary information and not used for the matching so far. The lines whose antenna name is 'ANONYMOUS' are used when there is no measurement for specific antenna in the session. In the above example, if science observation of session 1 contains the antenna PM04, Jy/K factor for ANONYMOUS antenna will be applied since there is no measurement for PM04 in session 1. If no file name is specified or specified file doesn't exist, all Jy/K factors are set to 1.0.
Example: reffile='', reffile='working/jyperk.csv'
infiles --
List of input MeasurementSets.
Example: vis='ngc5921.ms'
caltable --
Name of output gain calibration tables. Name is automatically created from infiles if None is given.
Example: caltable='ngc5921.gcal'
Notes
QA scoring:
QA = 1.0 if Jy/K conversion factors are available for all data.
QA = 0.0 if Jy/K conversion factors are missing for any data.
- Returns:
The results object for the pipeline task is returned.
Examples
Derive and apply Jy/K calibration using the online database:
>>> hsd_k2jycal()