life_td_data_generation.utils package¶
life_td_data_generation.utils.catalog_comparison module¶
life_td_data_generation.utils.io module¶
- Helper functions for the creation and analysis of the LIFE Target
Database.
- class utils.io.Path¶
Bases:
object
- utils.io.load(paths, stringtoobjects=True, location='../../additional_data/')¶
This function loads xml tables.
- Parameters:
paths (list(str)) – Filenames.
stringtoobjects (bool) – Wheter stringtoobject function should be called.
location (str) – Folder to save the file in, default is ../../data/additional_data/
- Returns:
Loaded tables.
- Return type:
list(astropy.table.table.Table)
- utils.io.objecttostring(cat)¶
- utils.io.save(cats, names, location='../../additional_data/')¶
This functions saves the tables given as list in the cats parameter.
- Parameters:
cats (list(astropy.table.table.Table)) – Python list of astropy table to be saved.
names (list(str)) – Contains names for saving location of tables in cats.
location (str) – Defaults to ../../data/additional_data/
- utils.io.string_to_object_whole_dict(dictionary, number=100)¶
- utils.io.stringtoobject(cat, number=100)¶
This function changes string type columns to object type.
The later has the advantace of allowing strings of varying length. Without it truncation of entries is a risk.
- Parameters:
cat (astropy.table.table.Table) – Table with at least two columns
number (int) – Length of longest string type element in the table. Default is 100.
- Returns:
Table with all string type columns transformed into object type ones.
- Return type:
astropy.table.table.Table