| |
- exceptions.Exception
-
- Error
-
- ParseError
- SlalibError
- UnitsError
- threading.Thread(threading._Verbose)
-
- tracker
- angle
- rotator
- target
- telescope
class angle |
|
Class for storing angles. Internally stores an angle as a float in radians
and provides methods for setting and retrieving the angle in a variety of
units, both via floats or various string formats. |
|
Methods defined here:
- __abs__(self)
- __add__(self, other)
- __div__(self, other)
- __eq__(self, other)
- __ge__(self, other)
- __gt__(self, other)
- __iadd__(self, other)
- __idiv__(self, other)
- __imul__(self, other)
- __init__(self, value=0.0, units=False)
- Standard initialiser, takes up to two arguments. The first argument
(which defaults to zero) is the angle to store, the second argument
(which defaults to 'r') indicates the units used, 'r' for radians,
'd' for degrees and 'h' for hours. The angle may be in any numeric
type acceptable to the builtin function float(). Alternatively, if
value is itself an angle object, this becomes a C++ style 'copy
constructor' and units is ignored. Thirdly, value may be a string
representation of an angle, in which case it will be parsed by
angle.setString(). For string values only units of 'd' or 'h' are
acceptable, and units will default to 'd'.
- __isub__(self, other)
- __itruediv__(self, other)
- __le__(self, other)
- __lt__(self, other)
- __mul__(self, other)
- __ne__(self, other)
- __neg__(self)
- __pos__(self)
- __radd__(self, other)
- __repr__(self)
- __rmul__(self, other)
- __rsub__(self, other)
- __str__(self)
- __sub__(self, other)
- __truediv__(self, other)
- getAngle(self, units='r')
- Returns the value of the angle as a float in the specified units,
'r' - radians, 'd' - degrees or 'h' - hours.
- getString(self, units='d', ndp=3)
- Returns a string representation of the angle in sexagesimal or
'time' formats. The optional first parameter units can be 'd', 'h' or
't' for degrees, hours (sexagesimal) or hours (time format), default
is 'd'. The optional second parameter, 'ndp', specified the number of
decimal places in the seconds field, default 3.
For decimal string representations getAngle() can be used together with
standard string formatting commands.
- norm2Pi(self)
- Normalises the angle into the range 0-2Pi.
- normPi(self)
- Normalises the angle into the range +/-Pi.
- setAngle(self, value=0.0, units='r')
- Sets the angle. Takes up to two arguments. The first argument
(which defaults to zero) is the angle to store, the second argument
(which defaults to 'r') indicates the units used, 'r' for radians,
'd' for degrees and 'h' for hours. The angle may be in any form
acceptable to the builtin function float(). Alternatively, if value
is itself an angle object, this makes the angles equal and the units
argument is ignored.
- setString(self, angleString, units='d', startPos=1)
- Sets the angle from a string representation. The first argument
contains a free format string representing the angle as either
a decimal or sexagesimal number (or a combination of the two) and
the second is a character specifying the units used ('d' for degrees,
'h' for hours). Uses slaDafin from the slalib module to parse the
string. An optional third argument specifies where in the string
to start parsing (in a 1 based, not zero based, count).
Returns the position in the string at which encoding finished.
|
class rotator |
|
Class representing the camera rotation system used by DAZLE for field
rotation comepensation. |
|
Methods defined here:
- __init__(self, portname, telescope, target, idle, run, boost, dt, name='rotator')
- Initialiser for rotator class.
Arguments:
portname: The device name of the serial port which the
Taranis stepper motor controller is connected to.
telescope: A rotator.telescope object containing observatory
specific information.
target: A rotator.target object contain details of the target
field for observations.
idle: The peak motor current when the motor is stationary,
in amps. Must be >=0 and <= run.
run: The peak motor current when the motor is moving
continously, in amps. Must be >= idle and <= boost.
boost: The peak motor current when the motor is accelerating/
decelerating, in amps. Must be >=run and <= 4.5.
dt: The interval between tracking corrections, in seconds.
name: label used for logging purposes.
- isLockedOn(self)
- isTracking(self)
- setCurrents(self, idle, run, boost)
- Sets the motor currents to be used by the rotator.
Arguments:
idle: The peak motor current when the motor is stationary, in amps.
Must be >=0 and <= run.
run: The peak motor current when the motor is moving continously,
in amps. Must be >= idle and <= boost.
boost: The peak motor current when the motor is accelerating/
decelerating, in amps. Must be >=run and <= 4.5.
- setTarget(self, field)
- Changes to current target field to the rotator.target instance
given as the argument.
- setTelescope(self, observatory)
- Changes the current telescope/observatory for the instrument to the
rotator.telescope instance passed as the srgument
- setupRotator(self)
- Instructs the rotator to perform its initialisation routine, which
determines the encoder angular scale and zero point, and sets up
the upper and lower motion limits.
- startTracking(self, logData=False)
- Creates an instance of rotator.tracker thread and sets it running
for the currently set telescope and target.
Arguments:
logData: Boolean to indicate whether tracking status information
should be logged to the file 'dicstrack.log'. Default False.
- stopTracking(self)
- updateConfig(self, config)
- Should be called by the parent instrument object's destructor
to enable status information to be saved to file on exit.
Takes a ConfigParserRT.SafeConfigParser object as argument.
- where(self)
- Request status information from the Taranis.
|
class target |
|
Class representing a target field. Stores the position of the field
in mean place FK5 J2000 coordinates, and calculates the geocentric
apparent coordinates when given the epoch. Also have a number of methods
for setting and retrieving coordinates. |
|
Methods defined here:
- __init__(self, ra, dec, pa, name)
- Initialises the target object. Takes four arguments, the target's
RA, Dec, desired position angle, and name (an identification string
primarily for logging purposes. RA and Dec should be mean place
FK5 J2000 coordinates. Position angle is here defined as the angle
Northpole-field centre-'up', where 'up' is the upwards direction on the
detector. Each of the arguments should be either a single value
acceptable to the rotator.angle constructor (e.g. a rotator.angle
object, a numeric type representing an angle, or a string containing a
sexagesimal/decimal representation of the angle) or a sequence object
containing an argument list for the constructor. If a single value
is given for RA it is assumed to be in units of hours, whereas Dec and
PA are assumed to be in degrees.
- getApparentPlace(self)
- If apparent place RA and Dec have been calculated (with
updateApparentPlace()) then returns them, else returns None.
- getCoords(self)
- Returns the mean place FK5 J2000 RA and Dec, and the position angle
for the target, as rotator.angle objects.
- getPA(self)
- Returns the position angle for the target as a rotator.angle object
- setCoords(RA, Dec, PA)
- Sets the mean place FK5 J2000 RA and Dec, and the requested position
angle for the target. Arguments are as for __init__().
- setPA(self, pa)
- Sets the requested position angle.
- unwind(self, shiftnumber)
- Changes the position angle by the argument, shiftnumber, times
90 degrees. This will be done by a rotator object in order to
keep its required position within its range of motion. The
argument must be a type acceptible to the builtin int() function.
- updateApparentPlace(self, tdb)
- Performs the precession-nutation, light deflection and annual
aberration calculations required to obtain the apparent place
RA and dec of the target, and both returns and stores the result.
A single argument is required, the Barycentric Dynamical Time of
observation as a datetime.datetime object. According to the called
slalib.slaMap routine's notes, 'The distinction between the required
TDB and TT is always negligible. Moreover, for all but the most
critical applications UTC is adequate'.
- updateConfig(self, config)
- Should be called by the parent instrument object's destructor
to enable status information to be saved to file on exit.
Takes a ConfigParserRT.SafeConfigParser object as argument.
|
class telescope |
|
Class representing the telescope/observatory. Stores information relating
to the position and meteorological conditions (for refraction
calculations) and performs calculations of observed azimuth and elevation. |
|
Methods defined here:
- __init__(self, longitude, latitude, altitude, polar_motion_x, polar_motion_y, delta_ut, temperature, pressure, humidity, tlr, wavelength, name)
- Initialiser for a telescope object. Arguments representing angles
should be an object acceptable as an argument to the rotator.angle
constructor, or a sequence type containing a list of arguments
acceptible to rotator.angle().
Arguments:
longitude: Mean longitude of the telescope, east positive.
latitude: Mean geodetic latitude of the telescope.
altitude: Telescope's height above mean sea level (metres).
polar_motion_x: Polar motion x-coordinate for today, from IERS
polar_motion_y: Polar motion y-coordinate for today, from IERS
delta_ut: UT1-UTC from IERS, in seconds, as a float
temperature: Local ambient temperature (Kelvin)
pressure: Local atmospheric pressure (millibars)
humidity: Local relative humidity (in the range 0.0-1.0)
tlr: Tropospheric lapse rate (Kelvin/metre)
wavelength: Effective wavelength of the observations (microns)
name: An identification string for logging purposes.
- getIERS(self)
- Returns the stored earth rotation parameters, as provided by the
International Earth Rotation Service, UT1-UTC (seconds, float),
and the x and y components of polar motion (rotator.angles).
- getLocation(self)
- Returns the telescope location information, longitude, latitude
(both as rotator.angles) and altitude (metres).
- getPointing(self, field, utc)
- Calculates the observed azimuth and zenith distance for a given field
and time. Note that these calculations assume a 'perfect' telescope,
no pointing model is used.
Arguments:
field: the target field, expressed as a rotator.field object.
utc: the time of observation, UTC, expressed as a datetime.datetime
object
Returned:
az: the observed azimuth expressed as a rotator.angle, East = 90deg
zd: the observed zenith distance expressed as a rotator.angle.
pa: the parallactic angle at the target field.
- getWavelength(self)
- Returns the stored effective wavelength of observations, in microns.
- getWeather(self)
- Returns the stored meteorological parameters, temperature (in Kelvin),
pressure (in millibars), relative humidity (in the range 0-1.0) and
tropospheric lapse rate (Kelvin/metre).
- resetField(self)
- Deletes any stored field reference. The effect of this is to force
a recalculation of all the observed-to-apparent-place parameters
in the next call to getPointing(), rather than just updating the
sidereal time.
- setIERS(self, delta_UT, polar_motion_x, polar_motion_y)
- Sets the earth rotation parameters. The information to do this
should be obtained from the International Earth Rotation Service
bulletin covering the day in question.
Arguments:
delta_UT: UT1-UTC, in seconds.
polar_motion_x: Polar motion x-coordinate, as either an argument or
sequence containing an argument list for the
rotator.angle() constructor.
polar_motion_y: Polar motion y-coordinate, as either an argument or
sequence containing an argument list for the
rotator.angle() constructor.
- setLocation(self, longitude, latitude, altitude)
- Sets the telescope location information.
Arguments:
longitude: Mean longitude of the telescope, east positive, as either
an argument or sequence containing an argument list for the
rotator.angle() constructor.
latitude: Mean geodetic latitude of the telescope, as either an
argument or sequence containing an argument list for the
rotator.angle() constructor.
altitude: The telescope's height above mean sea level, in metres.
- setWavelength(self, wavelength)
- Sets the effective wavelength of observations.
Arguments:
wavelength: Effective wavelength of observations, in microns.
- setWeather(self, temperature, pressure, humidity, tlr)
- Sets the meteorogical parameters used in the refraction calculations.
Arguments:
temperature: Local ambient temperature (Kelvin)
pressure: Local atmospheric pressure (millibars)
humidity: Local relative humidity (in the range 0.0-1.0)
tlr: Tropospheric lapse rate (Kelvin/metre)
- updateConfig(self, config)
- Should be called by the parent instrument object's destructor
to enable status information to be saved to file on exit.
Takes a ConfigParserRT.SafeConfigParser object as argument.
|
class tracker(threading.Thread) |
|
Worker thread intended to be used by an instance of rotator.rotator in
order to perform the operations required for rotator tracking in the
background. |
|
- Method resolution order:
- tracker
- threading.Thread
- threading._Verbose
- __builtin__.object
Methods defined here:
- __init__(self, tele, tgt, dt, low, high, port, stop, lockedOn, logger, logData=False)
- Arguments:
tele: A rotator.telescope object describing the observatory at
which the instrument is situated.
tgt: A rotator.target object representing the target field
dt: The interval at which tracking adjustments should be made,
in seconds.
low: The lower limit of allowed motion, a rotator.angle object.
high: The upper limit of allowed motion, a rotator.angle object.
port: A serial.Serial object for communication with the hardware.
stop: A threading.Event object used to terminate the tracking
loop.
lockedOn: A threading.Event object used to indicate tracking within
tolerances.
logger: A logging.Logger instance used to output information.
logData: Boolean to indicate whether tracking status information
should be logged to the file 'dicstrack.log'. Default False.
- calcRotPos(self, utc)
- Based on the currently set target and telescope calculates the
required rotator position for the UTC given as a datetime.datetime
object.
DAzLE will mount on VLT UT3 Nasmyth platform 'A', which is on the
LEFT hand side when looking in the direction in which the telescope
if pointing. For the left hand Nasmyth platform the position angle
of the sky image on the detector with the rotator at zero degrees is
equal to parallactic angle + zenith distance + 180 degrees. The
required rotator position is therefore requested PA - parallactic angle
- zenith distance - 180degrees, appropriately normalised into -180 to
+180.
- limit_time(self)
- Calculates the time (UTC) at which the rotator will reach the limits
of its range of movement for the set telescope and target. Returns
None if the the rotator position is currently outside the limits,
otherwise a datetime.datetime object.
- run(self)
- Don't call this directly, use start().
Methods inherited from threading.Thread:
- __repr__(self)
- getName(self)
- isAlive(self)
- isDaemon(self)
- join(self, timeout=None)
- setDaemon(self, daemonic)
- setName(self, name)
- start(self)
Data and other attributes inherited from threading._Verbose:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of '_Verbose' objects>
- list of weak references to the object (if defined)
| |