skycalc_ipy.core module#

Based on the skycalc_cli package, but heavily modified.

The original code was taken from skycalc_cli version 1.1. Credit for skycalc_cli goes to ESO

class skycalc_ipy.core.AlmanacQuery(indic)[source]#

Bases: ESOQueryBase

A class for querying the SkyCalc Almanac.

Parameters
indicdict, SkyCalcParams

A dictionary / :class:SkyCalcParams object containing the following keywords: ra, dec, date or mjd

  • ra : [deg] a float in the range [0, 360]

  • dec : [deg] a float in the range [-90, 90]

And either data or mjd:

  • date : a datetime string in the format ‘yyyy-mm-ddThh:mm:ss’

  • mjda float with the modified julian date. Note that mjd=0

    corresponds to the date “1858-11-17”

Methods

__call__()

Query the ESO Skycalc server with the parameters in self.params.

get_cache_filenames(prefix, suffix)

Produce filename from hass of parameters.

query()

Deprecated feature.

query()[source]#

Deprecated feature.

Deprecated since version v0.4.0.

This method is deprecated, Class is now callable, use that instead.

class skycalc_ipy.core.ESOQueryBase(url, params)[source]#

Bases: object

Base class for queries to ESO skycalc server.

Methods

get_cache_filenames(prefix, suffix)

Produce filename from hass of parameters.

BASE_URL = 'https://etimecalret-002.eso.org/observing/etc'#
REQUEST_TIMEOUT = 2#
get_cache_filenames(prefix: str, suffix: str) str[source]#

Produce filename from hass of parameters.

Using three underscores between the key-value pairs and two underscores between the key and the value.

class skycalc_ipy.core.SkyModel[source]#

Bases: ESOQueryBase

Class for querying the Advanced SkyModel at ESO.

Contains all the parameters needed for querying the ESO SkyCalc server. The parameters are contained in params and the returned FITS file is in data in binary form. This must be saved to disk before it can be read with the write() method.

Parameter and their default values and comments can be found at: https://www.eso.org/observing/etc/bin/gen/form?INS.MODE=swspectr+INS.NAME=SKYCALC

Methods

__call__(**kwargs)

Send server request.

call()

Deprecated feature.

callwith(newparams)

Deprecated feature.

fix_observatory()

Convert the human readable observatory name into its ESO ID number.

get_cache_filenames(prefix, suffix)

Produce filename from hass of parameters.

getdata()

Deprecated feature.

printparams([keys])

List the values of all, or a subset, of parameters.

write(local_filename, **kwargs)

Write data to file.

call()[source]#

Deprecated feature.

Deprecated since version v0.4.0.

This method is deprecated, just call the instance instead.

callwith(newparams)[source]#

Deprecated feature.

Deprecated since version v0.4.0.

This method is deprecated, just call the instance instead.

fix_observatory()[source]#

Convert the human readable observatory name into its ESO ID number.

The following observatory names are accepted: lasilla, paranal, armazones or 3060m, highanddry or 5000m

getdata()[source]#

Deprecated feature.

Deprecated since version v0.4.0.

This method is deprecated, just use the .data attribute instead.

printparams(keys=None)[source]#

List the values of all, or a subset, of parameters.

Parameters
keyssequence of str, optional

List of keys to print. If None, all keys will be printed.

write(local_filename, **kwargs)[source]#

Write data to file.

skycalc_ipy.core.get_cache_dir() Path[source]#

Establish the cache directory.

There are three possible locations for the cache directory: 1. As set in os.environ[“SKYCALC_IPY_CACHE_DIR”] 2. As set in the scopesim_data package. 3. The data directory in this package.