votools module

astrodbkit.votools.dict_tovot(tabdata, tabname='votable.xml', phot=False, binary=True)

Converts dictionary table tabdata to a VOTable with name tabname

Parameters:
  • tabdata (list) – SQL query dictionary list from running query_dict.execute()
  • tabname (str) – The name of the VOTable to be created
  • phot (bool) – Parameter specifying if the table contains photometry to be merged
  • binary (bool) – Parameter specifying if the VOTable should be saved as a binary. This is necessary for tables with lots of text columns.
astrodbkit.votools.photaddline(tab, sourceid)

Loop through the dictionary list tab creating a line for the source specified in sourceid

Parameters:
  • tab – Dictionary list of all the photometry data
  • sourceid – ID of source in the photometry table (source_id)
Returns:

tmpdict – Dictionary with all the data for the specified source

Return type:

dict

astrodbkit.votools.photparse(tab)

Parse through a photometry table to group by source_id

Parameters:tab (list) – SQL query dictionary list from running query_dict.execute()
Returns:newtab – Dictionary list after parsing to group together sources
Return type:list
astrodbkit.votools.table_add(tab, data, col)

Function to parse dictionary list data and add the data to table tab for column col

Parameters:
  • tab (Table class) – Table to store values
  • data (list) – Dictionary list from the SQL query
  • col (str) – Column name (ie, dictionary key) for the column to add