Package ivs :: Package observations :: Module visibility :: Class Ephemeris
[hide private]
[frames] | no frames]

Class Ephemeris

source code


Instance Methods [hide private]
 
__init__(self, **kwargs)
Initialize an Ephemeris object.
source code
 
__set_object(self, objectname)
Retrieve coordinates for an object in 'ephem'-style.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Set object, site and dates
 
set_objects(self, objects=None, **kwargs)
Initializes a list of objects by searching their coordinates on SIMBAD or NED.
source code
 
get_objectnames(self)
Return the names of the objects.
source code
 
set_site(self, sitename='lapalma', sitelat=None, sitelong=None, siteelev=None)
Set the observing site.
source code
 
set_date(self, startdate='today', days=20, dt=10.)
Set the start date for ephemeris calculations.
source code
 
get_date(self)
Return the currently set date at the currently set site.
source code
    Get output objects, output object names, output sites and output site names
 
get_out_objects(self, indexes)
Return the ephem object(s) (in a list) corresponding to the rows defined by indexes in the arrays of the "vis" dictionary.
source code
 
get_out_objectnames(self, indexes)
Return the object names (in an array) corresponding to the rows defined by indexes in the arrays of the "vis" dictionary.
source code
 
get_out_sites(self, indexes)
Return the ephem site(s) (in a list) corresponding to the rows defined by indexes in the arrays of the "vis" dictionary.
source code
 
get_out_sitenames(self, indexes)
Return the names of the sites (in an array) corresponding to the rows defined by indexes in the arrays of the "vis" dictionary.
source code
    Compute and plot visibilities
 
visibility(self, multiple=False, midnight=None, airmassmodel='Pickering2002', **kwargs)
Calculate ephemeri.
source code
 
plot(self, plot_daynight=True, **kwargs)
Make a plot of the result of 'visibility'.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 

Initialize an Ephemeris object.

You can set the site, date and objects via the keyword arguments of the functions 'set_objects', 'set_site' and 'set_date'. Defaults are 'no objects', 'la palma' and 'the current time'.

You can also give the same information when calling 'visibility'.

Overrides: object.__init__

set_objects(self, objects=None, **kwargs)

source code 

Initializes a list of objects by searching their coordinates on SIMBAD or NED.

Parameters:
  • objects (iterable) - a list of object names, resolved by SIMBAD or NED.
Decorators:
  • @decorators.filter_kwargs

set_site(self, sitename='lapalma', sitelat=None, sitelong=None, siteelev=None)

source code 

Set the observing site.

Supported are: 'lapalma', 'lasilla', 'palomar' and a bunch of capitals defined in pyephem. The other keywords allow to manually define a site or change one or more of the parameters of a manually defined site (always enter a sitename though!). If sitename is None, the site is left unchanged.

Parameters:
  • sitename - the name of the site or city
  • sitelong (string) - longitude (EAST) of site
  • sitelat (string) - latitude (NORTH) of site
  • siteelev (integer or float) - site elevation above sea level (m)
Decorators:
  • @decorators.filter_kwargs

set_date(self, startdate='today', days=20, dt=10.)

source code 

Set the start date for ephemeris calculations.

'startdate' can take the following formats: Format 1: Calendar date: '2010/08/16 12:00:00.0' , Format 2: Julian Date: 2455832.25 , Format 3: None: no change, or 'today': the current date (=default)

Careful: all times are UTC, they do not take care of time zones. default values are also set in UTC (gmtime)

Parameters:
  • startdate (string or float) - the exact time of the first visibility calculation
  • days (float) - total number of days on which to calculate visibilities (if visibility keyword 'multiple' = False)
  • dt (float) - sampling time in minutes
Decorators:
  • @decorators.filter_kwargs

visibility(self, multiple=False, midnight=None, airmassmodel='Pickering2002', **kwargs)

source code 

Calculate ephemeri.

*If 'multiple' = False, a single site definition and startdate (and/or values for the days and dt keywords) are expected. If one (or more) of these keywords is not given a value, it is assumed that it should not change its current value. If several astrophysical objects are given, ephemeri will be given for each object at the defined site and times. If 'midnight' is not None, ephemeri are calculated in the middle of each night, for the whole year.

*If 'multiple' = True, a list/array of site names and startdates can be given. Note: the length of keywords 'sitename', 'startdate' and 'objects' can be either N or 1 and should be in the same format as previously. In this case, ephemeri are only calculated at the times given in 'startdate', and thus the keywords 'days', 'dt' and 'midnight' are not used. Sites are currently only accessible throught the keyword 'sitename'.

The result of this function is an attribute 'vis', a dictionary containing:

  • MJDs: Modified Julian Dates
  • dates calendar dates (Format 1)
  • alts: altitudes
  • moon_alts: altitudes of the moon
  • airmass
  • moon_airmass: airmasses of the moon
  • moon_separation: separation to moon
  • during_night: night time / day time (boolean 1-0)
  • sun_prevrise: time of previous sun rise
  • sun_nextrise: time of next sun rise
  • sun_prevset: time of previous sun set
  • sun_nextset: time of next sun set

NOTE: use the 'get_out_objects', 'get_out_objectnames', 'get_out_sites' and 'get_out_sitenames' functions to retrieve the object, name of the object, site and name of the site corresponding to a particular row in each of the arrays 'vis' contains.