tableio
- lsmtool.tableio.RADec2Angle(RA, Dec)
Returns normalized Angle objects for input RA, Dec values.
- Parameters:
RA (
str,floatorlistofstr,float) – Values of RA to convert. Can be strings in makesourcedb format or floats in degrees (astropy.coordinates.Angle are also supported)Dec (
str,floatorlistofstr,float) – Values of Dec to convert. Can be strings in makesourcedb format or floats in degrees (astropy.coordinates.Angle are also supported)
- Returns:
RAAngle (
listofastropy.coordinates.Angle) – The RA, normalized to [0, 360)DecAngle (
listofastropy.coordinates.Angle) – The Dec, normalized to [-90, 90].
- lsmtool.tableio.broadcastTable(fileName)
Sends a table via SAMP.
- Parameters:
fileName (
str) – Name of sky model file to broadcast
- lsmtool.tableio.casaRegionWriter(table, fileName)
Writes model to a casa region file.
- Parameters:
table (
astropy.table.Table) – Input sky model tablefileName (
str) – Output file to which the sky model is written
- lsmtool.tableio.coneSearch(VOService, position, radius)
Returns table from a VO cone search.
- Parameters:
VOService (
str) – Name of VO service to query (must be one of allowedVOServices)position (
listoffloats) – A list specifying a position as [RA, Dec] in either makesourcedb format (e.g., [‘12:23:43.21’, ‘+22.34.21.2’]) or in degrees (e.g., [123.2312, 23.3422])radius (
floatorstr, optional) – Radius in degrees (if float) or ‘value unit’ (if str; e.g., ‘30 arcsec’) for cone search region
- lsmtool.tableio.convertExternalTable(table, columnMapping, catalogProperties)
Converts an external table to a makesourcedb compatible one.
- Parameters:
table (
Table) – External table to convertcolumnMapping (
dict) – Dict that defines the column name mapping from external table to makesourcedb columnscatalogProperties (
dict) – Dict that defines the catalog properties. Currently, these consist of ‘fluxtype’, ‘deconvolved’, ‘psf’, ‘referencefrequency’, and ‘fluxunits’
- lsmtool.tableio.createTable(outlines, metaDict, colNames, colDefaults)
Creates an astropy table from inputs.
- lsmtool.tableio.decformat(val)
Column formatter for Dec values.
- lsmtool.tableio.ds9RegionWriter(table, fileName)
Writes table to a ds9 region file.
- Parameters:
table (
astropy.table.Table) – Input sky model tablefileName (
str) – Output file to which the sky model is written
- lsmtool.tableio.facetRegionWriter(table, fileName)
Writes the model patches to a ds9 facet region file.
The resulting file is suitable for use with WSClean in faceting mode.
- Parameters:
table (
astropy.table.Table) – Input sky model table; must have patches definedfileName (
str) – Output file to which the sky model is written
- lsmtool.tableio.factorDirectionsWriter(table, fileName)
Writes patches to a Factor directions file.
Note that Factor respects the order of patches and they are sorted here by apparent flux from brightest to faintest.
- Parameters:
table (
astropy.table.Table) – Input sky model table; must have patches definedfileName (
str) – Output file to which the sky model is written
- lsmtool.tableio.fluxformat(val)
Column formatter for flux density values.
- lsmtool.tableio.getGSM(position, radius)
Returns the table from a GSM search.
- Parameters:
position (
listoffloats) – A list specifying a position as [RA, Dec] in either makesourcedb format (e.g., [‘12:23:43.21’, ‘+22.34.21.2’]) or in degrees (e.g., [123.2312, 23.3422])radius (
floatorstr) – Radius in degrees (if float) or ‘value unit’ (if str; e.g., ‘30 arcsec’) for cone search region
- lsmtool.tableio.getLoTSS(position, radius)
Returns table from a LoTSS search.
- Parameters:
position (
listoffloats) – A list specifying a position as [RA, Dec] in either makesourcedb format (e.g., [‘12:23:43.21’, ‘+22.34.21.2’]) or in degrees (e.g., [123.2312, 23.3422])radius (
floatorstr) – Radius in degrees (if float) or ‘value unit’ (if str; e.g., ‘30 arcsec’) for cone search region
- lsmtool.tableio.getQueryInputs(position, radius)
Returns the inputs for a non-VO-compatible catalog search.
- Parameters:
position (
listoffloats) – A list specifying a position as [RA, Dec] in either makesourcedb format (e.g., [‘12:23:43.21’, ‘+22.34.21.2’]) or in degrees (e.g., [123.2312, 23.3422])radius (
floatorstr) – Radius in degrees (if float) or ‘value unit’ (if str; e.g., ‘30 arcsec’) for cone search region
- Returns:
- Raises:
ValueError – Raised when the input radius cannot be converted to degrees, usually due to improperly specified units
- lsmtool.tableio.getTGSS(position, radius)
Returns the table from a TGSS search.
- Parameters:
position (
listoffloats) – A list specifying a position as [RA, Dec] in either makesourcedb format (e.g., [‘12:23:43.21’, ‘+22.34.21.2’]) or in degrees (e.g., [123.2312, 23.3422])radius (
floatorstr) – Radius in degrees (if float) or ‘value unit’ (if str; e.g., ‘30 arcsec’) for cone search region
- lsmtool.tableio.iteritems(d)
- lsmtool.tableio.itervalues(d)
- lsmtool.tableio.kvisAnnWriter(table, fileName)
Writes table to a kvis annotation file.
- Parameters:
table (
astropy.table.Table) – Input sky model tablefileName (
str) – Output file to which the sky model is written
- lsmtool.tableio.makeEmptyTable()
Returns an empty sky model table.
- lsmtool.tableio.processFormatString(formatString)
Proccesses the header string.
- lsmtool.tableio.processLine(line, metaDict, colNames)
Processes a makesourcedb line.
- lsmtool.tableio.queryNonVOService(url, format='makesourcedb')
Returns the table from a non-VO service.
- Parameters:
- Raises:
ConnectionError – Raised when the wget call returns a nonzero return code, indicating a problem with the connection to the service
- lsmtool.tableio.raformat(val)
Column formatter for RA values.
- lsmtool.tableio.rowStr(row, metaDict)
Returns makesourcedb representation of a row.
- Parameters:
row (
astropy.table.Row) – Row to processmetaDict (
dict) – Table meta dictionary
- Returns:
line (
str) – Sting representing a row in a makesourcedb sky model file
- lsmtool.tableio.skyModelIdentify(origin, *args, **kwargs)
Identifies valid makesourcedb sky model files.
- lsmtool.tableio.skyModelReader(fileName, header_start=0)
Reads a makesourcedb sky model file into an astropy table.
See https://www.astron.nl/lofarwiki/doku.php?id=public:user_software:documentation:makesourcedb for details. Note that source names, types, and patch names are limited to a length of 100 characters.
- Parameters:
- Returns:
table (
astropy.table.Table)