frb.builds.build_hosts
Top-level module to build or re-build the JSON files for FRB host galaxies
- frb.builds.build_hosts.assign_z(ztbl_file: str, host: FRBHost)[source]
Assign a redshift using one of the Galaxy_DB tables
- Args:
ztbl_file (str) – table file
host (frbgalaxy.FRBHost) – host object
- Raises:
ValueError – [description]
- frb.builds.build_hosts.search_for_file(projects, references, root: str, prefix='ref', return_last_file=False)[source]
Search for a given data file
If multiple files are found, the last one is returned
- Args:
projects ([type]) – [description]
references ([type]) – [description]
root (str) – [description]
prefix (str, optional) – [description]. Defaults to ‘ref’.
return_last_file (bool, optional) – [description]. Defaults to False.
- Returns:
bool, str [file was found?, name of file with path]
- Return type:
- frb.builds.build_hosts.read_lit_table(lit_entry, coord=None)[source]
Reade a literature table
- Args:
lit_entry (pandas row) – Row of the overview table
coord (astropy.coordiantes.SkyCoord, optional) – Coordinate for the galaxy of interest. Defaults to None.
- Raises:
ValueError – [description]
- Returns:
table of literature data
- Return type:
astropy.table.Table
- frb.builds.build_hosts.run(host_input: Series, build_ppxf: bool = False, lit_refs: str = None, skip_surveys: bool = False, build_cigale: bool = False, is_host: bool = True, override: bool = False, out_path: str = None, outfile: str = None)[source]
Main method for generating a Host JSON file
- Args:
host_input (pandas.core.series.Series) – Row of the CVS file providing the host inputs
build_ppxf (bool, optional) – Run pPXF?. Defaults to False.
lit_refs (str, optional) – File of literature references. Defaults to None.
build_cigale (bool, optional) – Run CIGALE?. Defaults to False. NOT IMPLEMENTED (yet, but maybe never)
is_host (bool, optional) – Object is a Host, as opposed to a neighboring/foreground galaxy. Defaults to True.
override (bool, optional) – Attempt to over-ride errors. Mainly for time-outs of public data. Defaults to False.
outfile (str, optional) – Over-ride default outfile [not recommended; mainly for testing]
out_path (str, optional) – Over-ride default outfile [not recommended; mainly for testing]
skip_surveys (bool, optional) – Skip the survey data. Useful for testing. Defaults to False.
- Raises:
e – [description]
ValueError – [description]
- frb.builds.build_hosts.main(frbs: list, options: str = None, hosts_file: str = None, lit_refs: str = None, override: bool = False, outfile: str = None, out_path: str = None)[source]
Driver of the analysis
- Args:
frbs (list) – [description]
options (str, optional) – [description]. Defaults to None.
hosts_file (str, optional) – [description]. Defaults to None.
lit_refs (str, optional) – [description]. Defaults to None.
override (bool, optional) – [description]. Defaults to False.
outfile (str, optional) – [description]. Defaults to None. Here for testing
out_path (str, optional) – [description]. Defaults to None. Here for testing