ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
cscripts.csviscube.csviscube Class Reference
Inheritance diagram for cscripts.csviscube.csviscube:

Public Member Functions

def __init__
 
def process
 
def save
 
def publish
 

Private Member Functions

def _get_parameters
 
def _zenith_angle_map
 
def _sun_ra_exclusion
 
def _moon_ra_exclusion
 
def _adjust_ra_interval
 
def _exclude_ra_interval
 
def _hour_angle_weight
 
def _visibility_cube
 
def _save_results
 

Private Attributes

 _cube
 
 _results
 

Detailed Description

Compute a visibility cube

Definition at line 30 of file csviscube.py.

Constructor & Destructor Documentation

def cscripts.csviscube.csviscube.__init__ (   self,
  argv 
)
Constructor

Parameters
----------
argv : list of str
    List of IRAF command line parameter strings of the form
    ``parameter=3``.

Raises
------
TypeError
    An invalid number of command line arguments was provided.

Definition at line 36 of file csviscube.py.

Member Function Documentation

def cscripts.csviscube.csviscube._adjust_ra_interval (   self,
  ra_start,
  ra_stop 
)
private
Adjust Right Ascension interval so that it overlaps with the [0,360[
interval

Parameters
----------
ra_start : float
    Start of interval to exclude (degrees)
ra_stop : float
    Stop of interval to exclude (degrees)

Returns
-------
ra_start : float
    Adjusted start of interval to exclude (degrees)
ra_stop : float
    Adjusted stop of interval to exclude (degrees)

Definition at line 247 of file csviscube.py.

Referenced by cscripts.csviscube.csviscube._exclude_ra_interval(), and cscripts.csviscube.csviscube._hour_angle_weight().

def cscripts.csviscube.csviscube._exclude_ra_interval (   self,
  hours,
  ra_start,
  ra_stop 
)
private
Exclude Right Ascension interval from array of hour angles

Parameters
----------
hours : list of floats
    Array of hours
ra_start : float
    Start of interval to exclude (degrees)
ra_stop : float
    Stop of interval to exclude (degrees)

Returns
-------
hours : list of floats
    Array of hours with excluded Right Ascension interval

Definition at line 280 of file csviscube.py.

References cscripts.csviscube.csviscube._adjust_ra_interval().

Referenced by cscripts.csviscube.csviscube._hour_angle_weight().

def cscripts.csviscube.csviscube._get_parameters (   self)
private
def cscripts.csviscube.csviscube._hour_angle_weight (   self)
private
Compute hour angle weights

Computes an array that specifies the time during which a given hour
angle was observed during the observing time interval [tmin,tmax].
The hour angle runs from 0 to 360 degrees, array values are in units
of hours.

The method loops over the days in the time interval [tmin,tmax], with
time = tmin + i*86400 seconds. At each time step the position in Right
Ascension and Declination of the Sun is computed (the Sun's
Declination is in fact not used here).

An interval of [ra_sun-dra_sun, ra_sun+dra_sun] is assumed to be the
day. The method _sun_ra_exclusion() is used to compute dra_sun, which
is half of the length of the day in degrees (recall that 15 degrees
is one hour). The length of the day is computed using the sunzenith
constraint.

Definition at line 338 of file csviscube.py.

References cscripts.csviscube.csviscube._adjust_ra_interval(), cscripts.csviscube.csviscube._exclude_ra_interval(), cscripts.csviscube.csviscube._moon_ra_exclusion(), cscripts.csviscube.csviscube._results, and cscripts.csviscube.csviscube._sun_ra_exclusion().

Referenced by cscripts.csviscube.csviscube._visibility_cube().

def cscripts.csviscube.csviscube._moon_ra_exclusion (   self,
  time 
)
private
Compute the half length of the Right Ascension interval to exclude due
to the Moon constraint

The Moon zenith angle constraint implies an interval in Right Ascension
that is to be excluded. This method computes half the length of this
interval.

Parameters
----------
time : `~gammalib.GTime()`
    Time for which the Moon exclusion is to be computed

Returns
-------
dra : float
    Right Ascension interval half length (degrees)

Definition at line 198 of file csviscube.py.

Referenced by cscripts.csviscube.csviscube._hour_angle_weight().

def cscripts.csviscube.csviscube._save_results (   self,
  outfile,
  clobber 
)
private
Save results in VISIBILITY FITS table

Parameters
----------
outfile : str
    Result FITS file name
clobber : bool
    Overwrite existing file?

Definition at line 545 of file csviscube.py.

References cscripts.csviscube.csviscube._results.

Referenced by cscripts.csviscube.csviscube.save().

def cscripts.csviscube.csviscube._sun_ra_exclusion (   self,
  time 
)
private
Compute the half length of the Right Ascension interval to exclude due
to the Sun constraint

The Sun zenith angle constraint implies an interval in Right Ascension
that is to be excluded (that's the interval during which it is day).
This method computes half the length of this interval in degrees.

Parameters
----------
time : `~gammalib.GTime()`
    Time for which the Sun exclusion is to be computed

Returns
-------
dra : float
    Right Ascension interval half length (degrees)

Definition at line 149 of file csviscube.py.

Referenced by cscripts.csviscube.csviscube._hour_angle_weight().

def cscripts.csviscube.csviscube._visibility_cube (   self)
private
Compute visibility cube

Compute visibility cube by displacing the zenith angle map for all
hour angles. The visibility cube contains the number of hours a given
celestial position is visible under a given zenith angle interval.
Summing over all zenith angle intervals specifies for how long a given
celestial position will be visible.

Definition at line 477 of file csviscube.py.

References cscripts.csviscube.csviscube._cube, cscripts.csviscube.csviscube._hour_angle_weight(), and cscripts.csviscube.csviscube._zenith_angle_map().

Referenced by cscripts.csviscube.csviscube.process().

def cscripts.csviscube.csviscube._zenith_angle_map (   self,
  nx,
  ny,
  dx,
  dy 
)
private
Compute zenith angle map

The zenith angle of a position (ra,dec) depends on the declination and
the hour angle h and is given by

zenith(h,dec) = arccos( sin(lat) * sin(dec) + cos(lat) * cos(dec) * cos(h) )

The hour angle h (or local hour angle, LHA) is defined as the difference
between local siderial time (LST) and the Right Ascension

h = LST - ra

The map is computed for h=-ra which is equivalent to GST=lon (or LST=0).
In other words, the map corresponds to the time when ra=0 passes through
the local meridian.

Parameters
----------
nx : int
    Number of Right Ascension pixels.
ny : int
    Number of Declination pixels.
dx : float
    Right Ascension pixel size in degrees.
dy : float
    Declination pixel size in degrees.

Returns
-------
zmap : `~gammalib.GSkyMap`
    Allsky map comprising the zenith angle for an hour angle of 0.

Definition at line 81 of file csviscube.py.

Referenced by cscripts.csviscube.csviscube._visibility_cube().

def cscripts.csviscube.csviscube.process (   self)
Process the script

Definition at line 634 of file csviscube.py.

References cscripts.csobsselect.csobsselect._get_parameters(), cscripts.csadd2caldb.csadd2caldb._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csmodelselect.csmodelselect._get_parameters(), cscripts.csroot2caldb.csroot2caldb._get_parameters(), cscripts.csresmap.csresmap._get_parameters(), cscripts.csresspec.csresspec._get_parameters(), cscripts.csmodelinfo.csmodelinfo._get_parameters(), cscripts.csmodelmerge.csmodelmerge._get_parameters(), cscripts.csobsinfo.csobsinfo._get_parameters(), cscripts.csfindobs.csfindobs._get_parameters(), cscripts.csiactdata.csiactdata._get_parameters(), cscripts.cstsmapmerge.cstsmapmerge._get_parameters(), cscripts.csiactcopy.csiactcopy._get_parameters(), cscripts.cssrcdetect.cssrcdetect._get_parameters(), cscripts.csviscube.csviscube._get_parameters(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.csmodelsois.csmodelsois._get_parameters(), cscripts.cscaldb.cscaldb._get_parameters(), cscripts.csobs2caldb.csobs2caldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._get_parameters(), cscripts.cspull.cspull._get_parameters(), cscripts.csfootprint.csfootprint._get_parameters(), cscripts.csiactobs.csiactobs._get_parameters(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.csobsdef.csobsdef._get_parameters(), cscripts.csspec.csspec._get_parameters(), cscripts.cssens.cssens._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csscs.csscs._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.csviscube.csviscube._visibility_cube(), cscripts.csresmap.csresmap.publish(), cscripts.csphasecrv.csphasecrv.publish(), cscripts.csviscube.csviscube.publish(), cscripts.cslightcrv.cslightcrv.publish(), and cscripts.csspec.csspec.publish().

def cscripts.csviscube.csviscube.publish (   self,
  name = '' 
)
Publish visibility cube

Parameters
----------
name : str, optional
    Name of visibility cube

Definition at line 676 of file csviscube.py.

Referenced by cscripts.csviscube.csviscube.process().

def cscripts.csviscube.csviscube.save (   self)
Save the visibility cube

Definition at line 651 of file csviscube.py.

References cscripts.csviscube.csviscube._save_results().

Member Data Documentation

cscripts.csviscube.csviscube._cube
private

Definition at line 55 of file csviscube.py.

Referenced by cscripts.csviscube.csviscube._visibility_cube().

cscripts.csviscube.csviscube._results
private

The documentation for this class was generated from the following file: