lcc.db_tier.connectors package

Submodules

lcc.db_tier.connectors.asas_archive module

class lcc.db_tier.connectors.asas_archive.AsasArchive(queries)[source]

Bases: lcc.db_tier.vizier_tap_base.VizierTapBase, lcc.db_tier.base_query.LightCurvesDb

Asas archive of variable stars. It inherits VizierTapBase - see documentation of this class to class attributes description.

As for all TAP queries it is possible to use “<” and “>” marks (for example {“Per”:”>2.5}).

Attributes

DELIM  
LC_FILE  

Methods

DEC = '_DE'
IDENT_MAP = {'asas': 'ASAS'}
LC_META = {'color': 'V', 'origin': 'ASAS'}
LC_URL = 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Plot/Vgraph/txt?II%2f264%2f.%2f{asas_id}&P=0'
MORE_MAP = OrderedDict([('Per', 'period'), ('Class', 'var_type'), ('Jmag', 'j_mag'), ('Kmag', 'k_mag'), ('Hmag', 'h_mag'), ('LC', 'lc_file')])
NAME = '{ASAS}'
RA = '_RA'
TABLE = 'II/264/asas3'
TAP_URL = 'http://tapvizier.u-strasbg.fr/TAPVizieR/tap'

lcc.db_tier.connectors.corot_archive module

class lcc.db_tier.connectors.corot_archive.CorotBrightArchive(queries)[source]

Bases: lcc.db_tier.vizier_tap_base.VizierTapBase, lcc.db_tier.base_query.LightCurvesDb

CoRoT connector. TAP query and downloading of the light curve fits are executed on Vizier catalog. It inherits VizierTapBase - see documentation of this class to class attributes description.

As for all TAP queries it is possible to use “<” and “>” marks (for example {“CoRot”:”>2.5}).

Examples

queries = [{“ra”: 102.707, “dec”: -0.54089, “delta”: 10},
{“CoRot”: 116}]
client = StarsProvider.getProvider(obtain_method=”CorotBrightArchive”,
obtain_params=queries)

stars = client.getStarsWithCurves(max_bins=10000)

Attributes

DELIM  

Methods

IDENT_MAP = OrderedDict([('VizierDb', 'Star'), ('CorotBrightArchive', 'CoRoT')])
LC_FILE = 'FileName'
LC_META = {'origin': 'CoRoT', 'ylabel_unit': 'Electrons per second', 'color': 'No', 'invert_yaxis': False, 'xlabel_unit': 'days', 'xlabel': 'Terrestrial time', 'ylabel': 'Flux'}
LC_URL = 'http://vizier.u-strasbg.fr/viz-bin/nph-Cat?-plus=-%2b&B/corot/files/'
MORE_MAP = OrderedDict([('(B-V)', 'b_v_mag'), ('SpT', 'spectral_type'), ('Vmag', 'v_mag'), ('VMAG', 'abs_v_mag'), ('Teff', 'temp')])
NAME = '{Star}'
TABLE = 'B/corot/Bright_star'
class lcc.db_tier.connectors.corot_archive.CorotFaintArchive(queries)[source]

Bases: lcc.db_tier.connectors.corot_archive.CorotBrightArchive

Corot archive of faint stars

Examples

queries = [ { “Corot” : “102706554”},
{“ra”: 100.94235, “dec” : -00.89651, “delta” : 10}]

client = StarsProvider().getProvider( obtain_method = “CorotFaintArchive”, obtain_params = queries) stars = client.getStarsWithCurves(max_bins = 10000 )

Attributes

DELIM  

Methods

ERR_COL = 5
ERR_MAG_RATIO = 16.0
IDENT_MAP = {'CorotFaintArchive': 'CoRoT'}
LC_META = {'ylabel_unit': 'Electrons per 32 second', 'color': 'R', 'invert_yaxis': False, 'xlabel_unit': 'julian days', 'xlabel': 'Barycentric time', 'ylabel': 'Flux'}
MAG_COL = 4
MORE_MAP = OrderedDict([('SpT', 'spectral_type'), ('Vmag', 'v_mag'), ('Rmag', 'r_mag'), ('Bmag', 'b_mag'), ('Imag', 'i_mag'), ('Gmean', 'g_mag')])
NAME = 'CoRoT'
TABLE = 'B/corot/Faint_star'
TIME_COL = 2

lcc.db_tier.connectors.file_manager module

class lcc.db_tier.connectors.file_manager.FileManager(obtain_params)[source]

Bases: lcc.db_tier.base_query.LightCurvesDb

This class is responsible for managing light curve files

Attributes

path (str) Path key of folder of light curves .
star_class (str) Name of the loaded star-like type (e.g. Cepheids)
suffix (str) Suffix of light curve files in the folder. If suffix is “fits”, files are loaded as fits files, otherwise files are considered as .dat files of light curve such as: #time mag err 12 13.45 0.38
files_limit (int, str) Number of files which will be loaded
db_ident (str) Name of the database to which the file name will be assigned EXAMPLE: For the file “my_macho_star.dat” and given db_ident as “macho” makes Star object: star.ident[“macho”] –> my_macho_star
files_to_load (iterable of str) List of file names which should be loaded from the given folder. If it is not specified all files will be loaded
object_file_name (str) Name of the pickle file which contains list of star objects

Methods

DB_ORIGIN = 'DB_ORIGIN'
DEFAULT_STARCLASS = 'star'
FITS_CLASS = 'CLASS'
FITS_DEC = 'DEC'
FITS_DEC_UNIT = 'DEC_UN'
FITS_NAME = 'IDENT'
FITS_RA = 'RA'
FITS_RA_UNIT = 'RA_UN'
FITS_SUFFIX = ('fits', 'FITS')
SUFFIXES = ['dat', 'txt', 'fits', 'FITS']
getStarsWithCurves()[source]

Common method for all stars provider

If there are object_file_name in query dictionary, the object file of list of stars is loaded. In other case files from given path of the folder is loaded into star objects.

Returns:

list of Star objects

Star objects with light curves

static parseFileName(file_path)[source]

Return cleaned name of the star without path and suffix

classmethod writeToFITS(file_name, star, clobber=True)[source]

lcc.db_tier.connectors.kepler_archive module

class lcc.db_tier.connectors.kepler_archive.KeplerArchive(obtain_params)[source]

Bases: lcc.db_tier.base_query.LightCurvesDb

This is connector to Kepler archive of light curves using kplr package

Methods

DEC_IDENT = 'kic_dec'
IDENTIFIER = {'kic_2mass_id': '2mass', '_name': 'kepler'}
LC_META = {'origin': 'Kepler', 'ylabel_unit': 'electrons per second', 'color': 'N/A', 'invert_yaxis': False, 'xlabel_unit': 'BJD - 2454833', 'xlabel': 'TIME', 'ylabel': 'Flux'}
NAME = '_name'
RA_IDENT = 'kic_degree_ra'
STAR_MORE_MAP = {'kic_gmag': 'g_mag', 'kic_teff': 'teff', 'kic_imag': 'i_mag', 'kic_hmag': 'h_mag', 'kic_umag': 'u_mag', 'kic_zmag': 'z_mag', 'kic_kmag': 'k_mag', 'kic_jmag': 'j_mag'}
getStars(lc=False)[source]
Returns:

list of Star objects

List of Star objects according to queries

getStarsWithCurves()[source]
Returns:

list of Star objects

List of Star objects with light curves according to queries

lcc.db_tier.connectors.macho_client module

class lcc.db_tier.connectors.macho_client.MachoDb(queries)[source]

Bases: lcc.db_tier.vizier_tap_base.VizierTapBase, lcc.db_tier.base_query.LightCurvesDb

Client for MACHO database of variable stars. It inherits VizierTapBase - see documentation of this class to class attributes description.

Examples

queries = [{“Field”: 1 , “Tile”: 3441, “Seqn”: 25}] client = StarsProvider.getProvider(obtain_method=”MachoDb”,

obtain_params=queries)

stars = client.getStarsWithCurves()

Attributes

DELIM  

Methods

IDENT_MAP = {'MachoDb': ('Field', 'Tile', 'Seqn')}
LC_FILE = ''
LC_META = {'xlabel_unit': 'MJD (JD-2400000.5)', 'origin': 'MACHO', 'xlabel': 'Time'}
LC_URL = 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Plot/w/Vgraph/txt?II%2f247%2f.%2f{macho_name}&F=b%2br&P={period}&-x&0&1&-y&-&-&-&--bitmap-size&600x400'
MORE_MAP = OrderedDict([('Class', 'var_type'), ('Vmag', 'v_mag'), ('Rmag', 'r_mag'), ('rPer', 'period_r'), ('bPer', 'period_b')])
NAME = '{Field}.{Tile}.{Seqn}'
TABLE = 'II/247/machovar'

lcc.db_tier.connectors.ogleIII_archive module

class lcc.db_tier.connectors.ogleIII_archive.OgleIII(queries)[source]

Bases: lcc.db_tier.base_query.LightCurvesDb

Connector to OGLEIII

Methods

COL_MAP = {'Decl': 'dec', 'ID_OGLE_II': 'ogle_ii_id', 'ID_MACHO': 'macho_id', 'A_1': 'i_ampl', 'Subtype': 'subtype', 'I': 'i_mag', 'ID_OTHER': 'other_id', 'ID_ASAS': 'asas_id', 'Field': 'field', 'RA': 'ra', 'ID_GCVS': 'gcvs_id', 'V': 'v_mag', 'Remarks': 'remarks', 'StarID': 'starid', 'Type': 'type', 'ID': 'name', 'P_1': 'period'}
DEFAULT_DELTA = 10
LC_META = {'origin': 'OgleII', 'ylabel_unit': 'mag', 'color': 'V', 'xlabel_unit': 'days', 'xlabel': 'hjd', 'ylabel': 'magnitude'}
MAX_TIMEOUT = 60
MORE = ['i_mag', 'type', 'subtype', 'remarks', 'i_ampl', 'period', 'v_mag']
ROOT = 'http://ogledb.astrouw.edu.pl/~ogle/CVS/'
SUFF = 'query.php?first=1&qtype=catalog'
getStars(lc=False)[source]
getStarsWithCurves()[source]
postQuery(query, lc)[source]

lcc.db_tier.connectors.ogle_client module

class lcc.db_tier.connectors.ogle_client.OgleII(queries)[source]

Bases: lcc.db_tier.base_query.LightCurvesDb

Connector to OGLEII. It is divided into two subdatabases - “phot” and “bvi”. The first one contains light curves and metadata about coordinates, identifiers and V magnitude. The second one also contains information about V and I.

Identifier of the stars in OgleII db are: field, starid and target.

In case of cone search (if coordinates are provided), “nearest” key can be used. If it is True just nearest star to the target point is returned.

Methods

BVI_TARGETS = ['lmc', 'smc', 'bul']
COL_MAP = {'Decl': 'dec', 'B': 'b_mag', 'I': 'i_mag', 'Field': 'field', 'RA': 'ra', 'V': 'v_mag', 'StarID': 'starid'}
LC_META = {'origin': 'OgleII', 'ylabel_unit': 'mag', 'color': 'V', 'xlabel_unit': 'days', 'xlabel': 'hjd', 'ylabel': 'magnitude'}
MAX_TIMEOUT = 60
PHOT_TARGETS = ['lmc', 'smc', 'bul', 'car']
QUERY_TYPES = ['bvi', 'phot']
ROOT = 'http://ogledb.astrouw.edu.pl/~ogle/photdb'
getStars(lc=False)[source]
getStarsWithCurves()[source]
postQuery(query, lc)[source]

Module contents