vasca.field

Field classes for VASCA

Module Contents

Classes

BaseField

Class that defines the basic data structure for field-based analysis. One field is generally the area in the sky covered by a telescope in one observation. A field is generally composed of several visits of the telescope at different times.

GALEXField

Instance of one GALEX field

GALEXDSField

VASCA implementation of GALEX drift-scan mode observations

Data

API

vasca.field.FILE_DIR = 'dirname(...)'
vasca.field.ROOT_DIR = None
vasca.field.dimless = None
class vasca.field.BaseField[source]

Bases: vasca.tables.TableCollection

Class that defines the basic data structure for field-based analysis. One field is generally the area in the sky covered by a telescope in one observation. A field is generally composed of several visits of the telescope at different times.

This class contains the main functionality for source detection and drawing. To be inherited by field analysis classes, which can then be tailored to the needs of the observatories supported by the VASCA pipeline.

Initialization

Many class attributes are stored in astropy.table.Table. To see a description of each of their columns run :meth: ~vasca.field.BaseField.info.

None

load_sky_map(file_name, img_attr='ref_img')[source]

Load reference image and WCS from passed fits file

filenamestr

File name of image FITS

img_attr: str, optional

Class attribute to store the image in, ‘ref_img’ or ‘vis_img’. Default is ‘ref_img’

None

get_upper_limits()[source]

Calculates magnitude upper limits on non-detections to the tt_visits table.

float array

Array of upper limits for each visit

set_light_curve(add_upper_limits=True)[source]

Adds detections information into ta_sources_lc for sources listed in self.tt_sources

add_upper_limitsbool, optional

Add upper limits to the tt_sources_lc, for visits with no detection. Upper limits are stored in the flux_err columns for none detections. The default is True.

None

remove_double_visit_detections()[source]

Remove multiple detections of one source in one visit from tt_detections. Keep only the closest detection.

list

List of removed detection IDs

set_field_attr(dd_names=None)[source]

Sets the most important field parameters as class attributes.

dd_namesdict, None

List of strings containing the parameter names. If None (default), a set of pre-defined parameters is set.

None

get_field_par(par_name, table_name)[source]

Returns metadata parameter par_name derived from astropy table data table_name.

par_namestr

Name of the parameter to be read either directly or calculated from table data.

table_namestr

Name of table data. Must be initialized as class attribute.

str, None

None is returned if either par_name or table_name are not available. In this case warnings are issued to logging.

AssertionError

If :attr: ~vasca.field.BaseField.tt_fields has not exactly one row

get_sky_region()[source]

Get region on the sky of the field.

regions.SkyRegion

Region on the sky of the field.

load_from_fits(file_name='tables.fits')[source]

Loads field from a fits file and sets field attributes.

file_namestr, optional

File name. The default is “field_default.fits”.

None

class vasca.field.GALEXField(obs_id, obs_filter=None, data_path=None, visits_data_path=None)[source]

Bases: vasca.field.BaseField

Instance of one GALEX field

Initialization

Initializes a new GALEXField instance with skeleton VASCA data structure.

obs_idint

GALEX field ID

obs_filterstr, optional

Selects the GALEX obs_filter for which the corresponding observation data is loaded. Needs to be either from: ‘FUV’ -> 135-175 nm ‘NUV’ -> 175-280 nm (default)

data_pathstr, optional

Path to root location of cloud-synced data associated with the GALEX field. Defaults to a path given by the resource manager.

visits_data_pathstr, optional

Path to a pre-downloaded table holding the complete list of GALEX visits. Defaults to a path given by the resource manager.

data_pathstr

Path to root location of cloud-synced data associated with the GALEX field

visits_data_pathstr

Path to a pre-downloaded table holding the complete list of GALEX visits

vasca_file_prefixstr

File name prefix following VASCA naming convention: ‘VASCA_<observatory>_<filed_id>_<obs_filter>’

classmethod from_VASCA(obs_id, obs_filter='NUV', fits_path=None, **kwargs)[source]

Constructor to initialize a GALEXField instance from a VASCA-generated FITS file

obs_idint

GALEX field ID

obs_filterstr, optional

Selects the GALEX filter for which the corresponding observation data is loaded. Needs to be either from: ‘FUV’ -> 135-175 nm ‘NUV’ -> 175-280 nm (default)

fits_pathstr, optional

Path to the fits file. Defaults to a path handled by ResourceManager.

**kwargs

All additional keyword arguments are passed to ~GALEXField.__init__()

vasca.field.GALEXField

classmethod from_MAST(obs_id, obs_filter='NUV', refresh=False, load_products='TABLES', write=True, **kwargs)[source]

Constructor to initialize a GALEXField instance either fresh from the MAST archive (refresh=True) or if available from cached raw data (refresh=False).

The procedure uses vasca.resource_manager.ResourceManager to handle file locations.

obs_idint

GALEX field ID

obs_filterstr, optional

Selects the GALEX obs_filter for which the corresponding observation data is loaded. Needs to be either from: ‘FUV’ -> 135-175 nm ‘NUV’ -> 175-280 nm (default)

refreshbool, optional

Selects if data is freshly loaded from MAST (refresh=True) or from cashed data on disc (refresh=False, default).

load_productsstr, optional

Selects if data products shall be loaded: “NONE”, “TABLES” for tables, and reference image, “ALL” for tables and visit images.

write: bool, optional

If load_products is enabled, stores the data as VASCA tables in the cloud for faster loading in the future. Default is True.

**kwargs

All additional keyword arguments are passed to ~GALEXField.__init__()

vasca.field.GALEXField

Returns None if no entry is found

static load(gfield_id, obs_filter='NUV', method='MAST_LOCAL', load_products='TABLES', **field_kwargs)[source]

Loads GALEX field data according to a given method and returns a GALEXField instance.

gfield_idint

GALEX field ID

obs_filterstr, optional

Selects the GALEX obs_filter for which the corresponding observation data is loaded. Needs to be either from: ‘FUV’ -> 135-175 nm ‘NUV’ -> 175-280 nm (default)

methodstr, optional

Specification of the load method. Four methods are implemented: MAST_REMOTE: Standard method to query data from MAST archives. This requires an internet connection to the MAST servers. Local data will be overwritten MAST_LOCAL: Dafault. Builds a new GALEXfield instance based on MAST archival data cached on local disc. If no data is found, the fallback is MAST_REMOTE. VASCA: Builds a new GALEXField based on a VASCA-generated field data file. AUTO: Attempts to load field data by using VASCA as method and falls back to MAST_LOCAL if no VASCA file is found on disc.

The default directory where field data availability is checked is defined by the “data_path” attribute of GALEXField and can be passed explicitly via the “field_kwargs”.

load_productsstr, optional

Selects if data products shall be loaded: “NONE”, “TABLES” for tables, and reference image, “ALL” for tables and visit images.

field_kwargs

All additional keyword arguments are passed to the load methods ~GALEXField.from_MAST() and ~GALEXField.from_VASCA(), as well as to ~GALEXField.__init__().

TypeError

If the specified load method is not a string.

ValueError

If the specified load method is not one of ‘[“mast_remote”, “mast_local”, “vasca”, “auto”]’. String matching is case insensitive.

vasca.field.GALEXField

static get_visit_upper_limits(tt_visits)[source]

Calculates upper limits on non-detections to the tt_visits table following the article of Gezari et al. ApJ 766 (2013) p4

float array

Array of upper limits for each visit

_load_galex_field_info(obs_id, obs_filter, col_names=None, refresh=False)[source]

Loads the archival metadata associated to a given field ID.

obs_idint

GALEX field ID

obs_filterstr, optional

Selects the GALEX filter for which the corresponding observation data is loaded. Needs to be either from: ‘FUV’ -> 135-175 nm ‘NUV’ -> 175-280 nm (default)

col_namesdict

Dictionary with keys of MAST column names to load, and values the corresponding VASCA table column names. Default in None.

refreshbool, optional

Selects if data is freshly loaded from MAST (refresh=True) or from cashed data on disc (refresh=False, default).

_load_galex_visits_info(obs_id, obs_filter, col_names=None)[source]

Loads the archival metadata associated to a given visit ID.

obs_idint

GALEX field ID

obs_filterstr, optional

Selects the GALEX filter for which the corresponding observation data is loaded. Needs to be either from: ‘FUV’ -> 135-175 nm ‘NUV’ -> 175-280 nm (default)

col_namesdict

Dictionary with keys of MAST column names to load, and values the corresponding VASCA table column names. Default in None.

_load_galex_archive_products(obs_id, obs_filter, col_names=None, dd_products=None, ref_maps_only=False, refresh=False)[source]

Loads the relevant data products from MAST servers and stores them using the ResourceManager.

obs_idint

GALEX field ID.

obs_filterstr

Selects the GALEX filter for which the corresponding observation data is loaded. Needs to be either from [‘NUV’, ‘FUV’].

col_nameslist, optional

List of columns to store from raw data.

dd_productsdict, optional

Dictionary of listing the data products to be loaded.

ref_maps_onlybool, optional

If True, only the reference/coadd maps are loaded (default). If False, also the visit maps are included.

refreshbool, optional

Set True to refresh the raw data via a MAST query. On default cashed raw data is used.

class vasca.field.GALEXDSField(field_name, data_path=None, visits_data_path=None, **kwargs)[source]

Bases: vasca.field.BaseField

VASCA implementation of GALEX drift-scan mode observations

The archival data is expected to be downloaded separately.

Initialization

Initializes a new GALEXDSField instance with skeleton VASCA data structure.

field_namestr

GALEX drift-scan field name

data_pathstr, optional

Path to root location of data associated with the GALEX field. Defaults to a path given by the resource manager.

visits_data_pathstr, optional

Path to a pre-downloaded table holding the complete list of GALEX DS visits. Defaults to a path given by the resource manager.

data_pathstr

Path to root location of data associated with the GALEX field

visits_data_pathstr

Path to a pre-downloaded table holding the complete list of GALEX DS visits

vasca_file_prefixstr

File name prefix following VASCA naming convention: ‘VASCA_<observatory>_<filed_id>_<obs_filter>’

name_id_map(a)[source]

Return the field/visit ID if the name is supplied and vice versa.

Note its not necessary to specify if identifier corresponds to the field or visit since names/IDs are unique.

astr, int

Input name (if string) or ID (if integer)

str, int

Output name or ID

_load_info(field_name)[source]

Load field and associated visits information.

field_namestr

GALEX field name.

_load_data_products(field_name, ref_maps_only=False)[source]

Loads the relevant data products form storage.

field_namestr

GALEX field name.

ref_maps_onlybool, optional

If True, only the reference/coadd maps are loaded (default). If False, also the visit maps are included.

classmethod from_VASCA(field_name, fits_path=None, **kwargs)[source]

Constructor to initialize a GALEXField instance from a VASCA-generated FITS file

field_nameint

GALEX field ID

fits_pathstr, optional

Path to the fits file. Defaults to a path handled by ResourceManager.

**kwargs

All additional keyword arguments are passed to ~GALEXField.__init__()

vasca.field.GALEXField

classmethod from_MAST(field_name, load_products='TABLES', write=True, **kwargs)[source]

Constructor to initialize a GALEXDSField instance from pre-downloaded MAST archival data.

The procedure uses vasca.resource_manager.ResourceManager to handle file locations.

field_namestr

GALEX drift scan field name

load_productsstr, optional

Selects if data products shall be loaded: “NONE”, “TABLES” for tables, and reference image, “ALL” for tables and visit images.

write: bool, optional

If load_products is enabled, stores the data as VASCA tables in the cloud for faster loading in the future. Default is True.

**kwargs

All additional keyword arguments are passed to ~GALEXField.__init__()

vasca.field.GALEXDSField

Returns None if no entry is found

static load(field_name, method='MAST_LOCAL', load_products='TABLES', **field_kwargs)[source]

Loads GALEX field data according to a given method and returns a GALEXField instance.

field_nameint

GALEX drift scan field name

methodstr, optional

Specification of the load method. Four methods are implemented: MAST_REMOTE: Standard method to query data from MAST archives. This requires an internet connection to the MAST servers. Local data will be overwritten MAST_LOCAL: Dafault. Builds a new GALEXfield instance based on MAST archival data cached on local disc. If no data is found, the fallback is MAST_REMOTE. VASCA: Builds a new GALEXField based on a VASCA-generated field data file. AUTO: Attempts to load field data by using VASCA as method and falls back to MAST_LOCAL if no VASCA file is found on disc.

The default directory where field data availability is checked is defined by the “data_path” attribute of GALEXField and can be passed explicitly via the “field_kwargs”.

load_productsstr, optional

Selects if data products shall be loaded: “NONE”, “TABLES” for tables, and reference image, “ALL” for tables and visit images.

field_kwargs

All additional keyword arguments are passed to the load methods ~GALEXField.from_MAST() and ~GALEXField.from_VASCA(), as well as to ~GALEXField.__init__().

TypeError

If the specified load method is not a string.

ValueError

If the specified load method is not one of ‘[“mast_remote”, “mast_local”, “vasca”, “auto”]’. String matching is case insensitive.

vasca.field.GALEXField