gdr3apcal package#

Subpackages#

Submodules#

gdr3apcal.calibration module#

class gdr3apcal.calibration.GaiaDR3_GSPPhot_cal(configuration_file: Optional[str] = None)[source]#

Bases: object

Collection of calibration models for different GSP-Phot parameters.

calibrateMetallicity(pandas_data_frame: DataFrame)[source]#

apply model mh to the ‘mh_gspphot’ field

printModelVersions()[source]#

Prints model versions

gdr3apcal.calibration.checksum_of_file(file_name: str, original: Optional[str] = None) bool[source]#

Verify the Checksum of a given file against reference Running without reference will return False, but print the computed hash sum

gdr3apcal.calibration_models module#

Interfaces to various flavors of models

class gdr3apcal.calibration_models.CalibrationModel(name: str, model: Union[Callable, BaseEstimator], features: Sequence[str], label: str)[source]#

Bases: object

single generic model wrapper

static compute_cosb_from_dataframe(df: DataFrame) array[source]#

Infers from the data how to compute cos(b)

Checks if b is provided (test degrees or radians). If not attempts from ra, dec with conversion to Galactic coordinates

class gdr3apcal.calibration_models.CalibrationModelGrouped(name: str, models: dict, features: Sequence[str], label: str, groupby: str)[source]#

Bases: CalibrationModel

A convenient collection of models that apply on grouped data This is used to handle the individual calibrations of the spectral libraries of GSP-Phot.

class gdr3apcal.calibration_models.CallableModel(name: str, model: Callable, features: Sequence[str], label: str)[source]#

Bases: CalibrationModel

Use a single function/callable object as calibration model

class gdr3apcal.calibration_models.SklearnModel(name: str, model: BaseEstimator, features: Sequence[str], label: str)[source]#

Bases: CalibrationModel

Using a BaseEstimator API (.predict)

gdr3apcal.config module#

Package important locations

gdr3apcal.downloader module#

Tools to download the model files

gdr3apcal.downloader.dl_ascii_progress(iterseq: Sequence, total: int = 100, progress_length: int = 50, mininterval: float = 2)[source]#

A simplistic progress indicator in ascii format applicable to a sequence

iterseq: sequence to iter over total: length of the sequence (default is 100 or len(iterseq) when possible) progress_length: number of characters used by the indicator mininterval: how long to wait before updating the indicator (default 0.5 seconds)

gdr3apcal.downloader.download_file(link: str, file_name: str, overwrite: bool = False) str[source]#

Download a file on disk from url

link: url of the file file_name: path and filename of the download location overwrite: set to re-download (default False)

Returns the filename of the data

gdr3apcal.downloader.pretty_size_print(num_bytes: int) str[source]#

Output number of bytes in a human readable format

keywords#

num_bytes: int

number of bytes to convert

returns:

output – string representation of the size with appropriate unit scale

rtype:

str

gdr3apcal.mars_converter module#

Tools to convert pyearth.Earth models to python source code

The method to remove pyearth depencency is a little bit convoluted. We basically extract the equations of the models and write them into a python script.

One could imagine making a dump of the function call. However, this does not work in python. Python will look for the original module of the function. (regardless of using joblib, or dill) We did not find a way to deep dump the functions.

gdr3apcal.repositories module#

Simplified access to storage

class gdr3apcal.repositories.BaseRepository(repo: str, **kwargs)[source]#

Bases: object

Base class for downloading from specific locations

download_file(fname: str, where: str)[source]#
class gdr3apcal.repositories.HTTP(repo: str, **kwargs)[source]#

Bases: BaseRepository

Direct download from URL {repo}/{filename}

download_file(fname: str, where: str)[source]#
class gdr3apcal.repositories.Keeper(repo: str, **kwargs)[source]#

Bases: BaseRepository

Make a simplified interface to a folder on Keeper/Seafile

download_file(fname: str, where: str)[source]#