azely package#

Submodules#

Module contents#

class AzEl(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]#

Bases: DataFrame

Calculated azimuth and elevation of the object in degrees.

Parameters:
  • index (Axes | None)

  • columns (Axes | None)

  • dtype (Dtype | None)

  • copy (bool | None)

az: Series#

Azimuth of the object in degrees.

el: Series#

Elevation of the object in degrees.

in_lst() Self[source]#

Convert its time index to the local sidereal time (LST).

Return type:

Self

in_utc() Self[source]#

Convert its time index to the coordinated universal time (UTC).

Return type:

Self

location: Location#

Location information used for the azimuth/elevation calculation.

object: Object#

Object information used for the azimuth/elevation calculation.

separation(other: Self, /) Series[source]#

Calculate the separation angle with other object in degrees.

Parameters:

other (Self)

Return type:

Series

time: Time#

Time information used for the azimuth/elevation calculation.

class Location(name: str, longitude: str, latitude: str, altitude: str = '0 m')[source]#

Bases: object

Location information.

Parameters:
  • name (str) – Name of the location.

  • longitude (str) – Longitude of the location (with units).

  • latitude (str) – Latitude of the location (with units).

  • altitude (str) – Altitude of the location (with units).

altitude: str = '0 m'#

Altitude of the location (with units).

property earthlocation: EarthLocation#

Convert it to an astropy EarthLocation.

latitude: str#

Latitude of the location (with units).

longitude: str#

Longitude of the location (with units).

name: str#

Name of the location.

property timezone: ZoneInfo#

Convert it to an IANA ZoneInfo.

class Object(name: str, longitude: str, latitude: str, frame: str = 'icrs')[source]#

Bases: object

Object information.

Parameters:
  • name (str) – Name of the object.

  • longitude (str) – Longitude of the object (with units).

  • latitude (str) – Latitude of the object (with units).

  • frame (str) – Coordinate frame name of the object.

frame: str = 'icrs'#

Coordinate frame name of the object.

latitude: str#

Latitude of the object (with units).

longitude: str#

Longitude of the object (with units).

name: str#

Name of the object.

skycoord(obstime: Time, /) SkyCoord[source]#

Convert it to an astropy SkyCoord.

Parameters:

obstime (Time)

Return type:

SkyCoord

class Time(start: str = '00:00 today', stop: str = '00:00 tomorrow', step: str = '10min', timezone: str = '')[source]#

Bases: object

Time information.

Parameters:
  • start (str) – Left bound of the time (inclusive).

  • stop (str) – Right bound of the time (inclusive).

  • step (str) – Step of the time (pandas offset alias).

  • timezone (str) – Timezone of the time (IANA timezone name).

property index: DatetimeIndex#

Convert it to a pandas DatetimeIndex.

start: str = '00:00 today'#

Left bound of the time (inclusive).

step: str = '10min'#

Step of the time (pandas offset alias).

stop: str = '00:00 tomorrow'#

Right bound of the time (exclusive).

timezone: str = ''#

Timezone of the time (IANA timezone name).

calc(object: Object | ObjectDict | str, location: Location | LocationDict | str = '', time: Time | TimeDict | str = '', *, google_api: str | None = None, ipinfo_api: str | None = None, sep: str = '\\s*;\\s*', timeout: float = 10.0, append: AppendDict | bool = True, overwrite: OverwriteDict | bool = False, source: SourceDict | PathLike[str] | str | None = PosixPath('/github/home/.config/azely/cache.toml')) AzEl[source]#

Calculate azimuth/elevation of given object in given location at give time.

Parameters:
  • object (Object | ObjectDict | str) – Object information, or query dictionary or string for it.

  • location (Location | LocationDict | str) – Location information, or query dictionary or string for it.

  • time (Time | TimeDict | str) – Time information, or query dictionary or string for it.

  • google_api (str | None) – Optional Google API key for the location information.

  • ipinfo_api (str | None) – Optional IPinfo API key for the location information.

  • sep (str) – Separator string for splitting the location/object/time queries.

  • timeout (float) – Timeout length in seconds for the location/object information.

  • append (AppendDict | bool) – Whether to append the location/object/time information to the source TOML file if it does not exist. An option dictionary for each information is also accepted.

  • overwrite (OverwriteDict | bool) – Whether to overwrite the location/object/time information to the source TOML file even if it already exists. An option dictionary for each information is also accepted.

  • source (SourceDict | PathLike[str] | str | None) – Path of a source TOML file for the location/object/time information. An option dictionary for each information is also accepted.

Returns:

Calculated azimuth and elevation of the object in degrees.

Return type:

AzEl

get_location(query: str, /, *, google_api: str | None = None, ipinfo_api: str | None = None, sep: str = '\\s*;\\s*', timeout: float = 10.0, append: bool = True, overwrite: bool = False, source: PathLike[str] | str | None = None) Location[source]#

Parse given query to create location information.

Parameters:
  • query (str) – Query string for the location information.

  • google_api (str | None) – Optional Google API key.

  • ipinfo_api (str | None) – Optional IPinfo API key.

  • sep (str) – Separator string for splitting the query.

  • timeout (float) – Timeout length in seconds.

  • append (bool) – Whether to append the location information to the source TOML file if it does not exist.

  • overwrite (bool) – Whether to overwrite the location information to the source TOML file even if it already exists.

  • source (PathLike[str] | str | None) – Path of a source TOML file for the location information.

Return type:

Location

Returns

Location information created from the parsed query.

get_object(query: str, /, *, sep: str = '\\s*;\\s*', timeout: float = 10.0, append: bool = True, overwrite: bool = False, source: PathLike[str] | str | None = None) Object[source]#

Parse given query to create object information.

Parameters:
  • query (str) – Query string for the object information.

  • sep (str) – Separator string for splitting the query.

  • timeout (float) – Timeout length in seconds.

  • append (bool) – Whether to append the object information to the source TOML file if it does not exist.

  • overwrite (bool) – Whether to overwrite the object information to the source TOML file even if it already exists.

  • source (PathLike[str] | str | None) – Path of a source TOML file for the object information.

Return type:

Object

Returns

Object information created from the parsed query.

get_time(query: str, /, *, sep: str = '\\s*;\\s*', append: bool = True, overwrite: bool = False, source: PathLike[str] | str | None = None) Time[source]#

Parse given query to create time information.

Parameters:
  • query (str) – Query string for the time information.

  • sep (str) – Separator string for splitting the query.

  • append (bool) – Whether to append the time information to the source TOML file if it does not exist.

  • overwrite (bool) – Whether to overwrite the time information to the source TOML file even if it already exists.

  • source (PathLike[str] | str | None) – Path of a source TOML file for the time information.

Returns:

Time information created from the parsed query.

Return type:

Time