vasca.region
¶
Module Contents¶
Classes¶
Defines a region in the sky as a list of vasca.field objects. It provides functionality to loop over fields to derive source lists, etc. |
API¶
- class vasca.region.Region[source]¶
Bases:
vasca.tables.TableCollection
Defines a region in the sky as a list of vasca.field objects. It provides functionality to loop over fields to derive source lists, etc.
Initialization
Many class attributes are stored in astropy.table.Table. To see a description of each of their columns run :meth: ~vasca.Regions.info.
None
- classmethod load_from_config(vasca_cfg)[source]¶
Loads region from configuration dictionary.
- vasca_cfgdict
Dictionary with region parameters derived from the vasca pipeline YAML configuration file.
None
- add_table_from_fields(table_name, only_selected=False)[source]¶
Add tables from the fields to the region by stacking them, adding the rg_fd_id column.
- table_namestr
Table to be added.
- only_selectedbool, optional
Only selected rows from the field tables are copied over to the region. The default is False.
None
- add_coverage_hp(nside=4096, coord_sys='galactic')[source]¶
Creates healpix arrays of Nr visits, fields and total exposure.
- nsideint, optional
NSIDE of healpix binning. The default is 4096.
- coord_sysstr, optional
Coordinate system, “galactic” or “icrs”.
- list of int
Array with number of visits per pixel.
- list of int
Array with exposure per pixel.
- list of int
Array with number of fields.
- load_from_fits(file_name, load_fields=False)[source]¶
Loads field from a fits file.
- file_namestr, optional
Region file name.
- load_fieldsbool, optional
Load the fields, which have to be located as fits in the subfolder “./fields/” of the region file in “file_name”. Default is False.
None
- get_src_from_id(rg_src_id, load_from_file=True, write_to_file=True, add_sed=True, add_gphoton=True, add_spectrum=True)[source]¶
Get Source object containing all region table entries relevant for the passed rg_src_id.
- rg_src_idint
Region source ID.
- load_from_filebool, optional
Load from a previously stored source, assumed to be in the “./sources” directory of the analysis directory. The default is True.
- write_to_file: bool, optional
Store source into the “./sources” directory of the analysis directory. The default is True.
- add_sed: bool, optional
Add Spectral Energy Distribution using
vasca.source.Source.add_vizier_SED()
. The default is True.- add_gphoton: bool, optional
Add gphoton light curve using
vasca.source.Source.add_gphoton_lc()
. The default is True.- add_spectrum: bool, optional
Add spectrum using
vasca.source.Source.add_spectrum()
. The default is True.
- vasca.table.source
VASCA source object.
- set_src_id_info()[source]¶
Stores the mapping of rg_src_id to rg_fd_id and fd_src_id into tt_src_id_map table.
None
- get_src_from_sky_pos(coordx, coordy, frame='icrs')[source]¶
Get Source object containing all region table entries relevant for the passed source position. The nearest source is matched.
- coordxstr or float
First coordinate component in any astropy.SkyCoord compatible format.
- coordystr or float
Second coordinate component in any astropy.SkyCoord compatible format.
- framestr
Coordinate system. Any astropy compatible format, see https://docs.astropy.org/en/stable/coordinates/skycoord.html
- vasca.table.source
VASCA source object.
- astropy.Quantity
Distance to the nearest source
- get_field(field_id=None, rg_fd_id=None, load_method='FITS', add_field=False, mast_products='TABLES', field_kwargs=dict())[source]¶
Load a field from a region, tt_fields table needs to include this field.
- field_idstr
Field ID. The default is None.
- rg_fd_idint
Region field ID. The default is None.
- load_methodstr, optional
Method to load the field. Either from “FITS”, from “MAST” or from “VASCA”. The default is “FITS”. Note that if the field is already in the region.fields dictionary, this will be ignored and the later be returned.
- add_fieldbool, optional
Add the field to the region.fields dictionary. The default is True.
- mast_productsstr, optional
load_products option of field.load_from_MAST. Sets to what level data products are downloaded.
- field_kwargsdict, optional
Keyword arguments passed to the field loading function.
- vasca.field
VASCA field
- cross_match_cds(query_radius=1.5 * uu.arcsec, query_table='I/355/gaiadr3', vizier_columns=['*', 'PQSO', 'PGal', 'PSS', 'RPlx', 'VarFlag', 'o_Gmag', 'RFRP', 'RFBP', 'AG', 'E(BP-RP)'], overwrite=False)[source]¶
Match sources in region with SIMBAD-catalogs or Vizier database catalog. Runs only over selected sources.
- query_radiusastropy.quantity, optional
Query up to this distance from VASCA sources. The default is 1 * uu.arcsec.
- query_tablestr, optional
Vizier table to query, if “simbad” query SIMBAD instead. The default is the main GAIA-DR3 table.
- vizier_columns: list, optional
Vizier catalog columns to get from the catalog. * is for default columns, ** for all columns. The default is for selected Vizier GAIA columns
- overwrite: bool, optional
Overwrite preexisting association for this source. The default is False.
None
- synch_src_sel(remove_unselected=False)[source]¶
Synchronize selections among tables. Select rows for tables containing “rg_src_id” for sources selected in tt_sources.
- remove_unselected: bool, optional
Remove table rows which were not selected
None
- get_region_catalog()[source]¶
Create a reduced region, which only contains info on selected sources
- vasca.Region
Region with only the selected sources
- set_LombScargle(obs_filters=['NUV', 'FUV'], nbins_min=20)[source]¶
Apply LombScargle analysis to selected sources. Results are stored into the tt_lombscargle table of the region.
- obs_filtersarray, optional
Observation filters to apply Lomb Scargle on.
- nbins_minint, optional
Minimum number of time bins to perform LombScargle. The default is 20.
None