lcc.db_tier package

Submodules

lcc.db_tier.TAP_query module

class lcc.db_tier.TAP_query.TapClient[source]

Bases: lcc.db_tier.base_query.LightCurvesDb

Common class for all TAP db clients

Attributes

COO_UNIT_CONV (int, float) Conversion rate of coordinates from degrees
QUOTING (list, tuple) Expressions with any of these symbols are quoted

Methods

COO_UNIT_CONV = 1
COUNTER_CON = 0
QUOTING = [' ', '/', '_', '-', '.', '+']
REPEAT_CON = 10
SPECIAL_SYMB = ['<', '>', '=']
postQuery(tap_params)[source]

Post query according to given parameters

Parameters:

tap_params : dict

Tap query parameters. It has to contains four keys.

Dict keys:
URL(str)

Url of tap server

table(str)

Name of table for query

select(str/list)

Select string or list of column names

conditions(list/tuple)

For each condition in the list of conditions there is a tuple - (“name of column”, “condition”) or (“name of column”, “lower value”, “upper value” for search in the range

Returns:

list of lists

Result from the query as nested lists

lcc.db_tier.base_query module

class lcc.db_tier.base_query.LightCurvesDb[source]

Bases: lcc.db_tier.base_query.StarsCatalogue

Methods

getStarsWithCurves()[source]

Query Star objects

Returns:

list

List of Star objects appended by LightCurve instances

class lcc.db_tier.base_query.StarsCatalogue[source]

Bases: object

Methods

coneSearch(coo, stars, delta_deg, nearest=False)[source]

Filter results from cone search

Parameters:

coo : astropy.coordinates.sky_coordinate.SkyCoord

Center of searching

stars : list of Star objects

Stars returned by query

delta_deg: float, astropy.units.quantity.Quantity

Radius from center of searching

nearest : bool

Nearest star to the center of searching is returned if it is True

Returns:

list

List of Star objects

getStars()[source]

Query Star objects

Returns:

list

List of Star objects

lcc.db_tier.stars_provider module

class lcc.db_tier.stars_provider.StarsProvider[source]

Bases: object

Stars provider is an interface between end-user and database connectors. All database connectors have to inherit StarsCatalog class.

Attributes

STARS_PROVIDER (dict)

Methods

STARS_PROVIDERS = {'CorotFaintArchive': <class 'lcc.db_tier.connectors.corot_archive.CorotFaintArchive'>, 'OgleIII': <class 'lcc.db_tier.connectors.ogleIII_archive.OgleIII'>, 'FileManager': <class 'lcc.db_tier.connectors.file_manager.FileManager'>, 'AsasArchive': <class 'lcc.db_tier.connectors.asas_archive.AsasArchive'>, 'CorotBrightArchive': <class 'lcc.db_tier.connectors.corot_archive.CorotBrightArchive'>, 'KeplerArchive': <class 'lcc.db_tier.connectors.kepler_archive.KeplerArchive'>, 'MachoDb': <class 'lcc.db_tier.connectors.macho_client.MachoDb'>, 'OgleII': <class 'lcc.db_tier.connectors.ogle_client.OgleII'>}
classmethod getProvider(obtain_method, obtain_params)[source]

Get database connector via name of its class

Parameters:

obtain_method : str

Name of connector class

obtain_params : list of dicts

List of queries

Returns:

instance

Constructed database connector or uninstanced if there is no queries

lcc.db_tier.vizier_tap_base module

class lcc.db_tier.vizier_tap_base.VizierTapBase(queries)[source]

Bases: lcc.db_tier.TAP_query.TapClient

Base class for all tap connectors using VizieR database. In the most situations new connectors will contain just few class attributes and there will not be need to write new or overwrite current methods.

Attributes

TAP_URL (str) Url to tap server
FILES_URL (str) Path to light curve files storage
TABLE (str) Name of queried table
RA (str) Name of right ascension column. It should be in degrees, anyway it is necessary to convert them
DEC (str) Name of declination column. It should be in degrees, anyway it is necessary to convert them
NAME (preformated str) Preformated string with dictionary keys.

Methods

This class inherits TapClient which brings methods for creating,  
posting and returning tap queries. Methods of this class manage  
results and create Star objects and light curves.  
There is no need overwrite methods in inherited classes in the most  
cases. Anyway obtaining light curves can be different for many  
databases. In this case it would be sufficient to just implement  
new _getLightCurve method.  
Brief description of methods can be found below at their declaration.  
DEC = 'DEJ2000'
DELIM = None
ERR_COL = 2
ERR_MAG_RATIO = 1.0
LC_FILE = None
MAG_COL = 1
RA = 'RAJ2000'
TAP_URL = 'http://tapvizier.u-strasbg.fr/TAPVizieR/tap'
TIME_COL = 0
getStars(lc=False, **kwargs)[source]

Get star objects

Parameters:

lc : bool

Star is appended by light curve if True

Returns:

list

List of stars

getStarsWithCurves(**kwargs)[source]

Get star objects with light curves

Parameters:

kwargs : dict

Optional parameters which have effect just if certain database provides this option.

For example CoRoT archive contains very large light curves, so the dimension of light curve can be reduced by max_bins keyword.

Returns:

list

List of stars with their light curves

Module contents