CARMA C++
carma::antenna::common::OpticalTelControl Interface Reference

Antenna optical telescope control. More...

import "carma/antenna/common/OpticalTelControl.idl";

Public Member Functions

void applyTestOffset (in double azInArcmin, in double elInArcmin) raises ( carma::util::UserException )
 Apply an offset to on the fly generated test images. More...
 
void findCentroid (in unsigned short numFramesPerImage, in unsigned short minValidCentroids, in unsigned short maxCentroidAttempts, in unsigned short numEdgePixels, in unsigned short apertureRadiusPixels, in float pixelThresholdSigma, in boolean subBackground, in boolean normalizeMedian, in unsigned long seq) raises ( carma::util::UserException )
 Find centroid of star in field of view This routine will calculate the centroid on each of a number of specified images. More...
 
CentroidResults getCentroidResults () raises ( carma::util::UserException )
 Return results of last findCentroid call. More...
 
flattenedOpticalImage getImage (in unsigned short numFrames, in boolean subBackground, in boolean normalizeMedian, in boolean normalizeImage) raises (carma::util::UserException)
 Create and return an image from the input number of frames. More...
 
flattenedOpticalImage getStoredBackgroundImage () raises ( carma::util::UserException )
 Get stored background image. More...
 
flattenedOpticalImage grabFrame () raises (carma::util::UserException)
 Get a frame from the frame grabber and return it. More...
 
void setBrightness (in float brightness) raises (carma::util::UserException)
 Sets the brightness of subsequent frames. More...
 
void setContrast (in float contrast) raises (carma::util::UserException)
 Sets the contrast of subsequent frames. More...
 
void setFrameDimensions (in short x, in short y, in short x0, in short y0) raises (carma::util::UserException)
 Set specific frame dimensions. More...
 
void setFramegrabberResolution (in Resolution res) raises (carma::util::UserException)
 Set the resolution of the framegrabber. More...
 
void setRotationAndFieldsOfView (in float rotationInDegrees, in float azFOVInArcminutes, in float elFOVInArcminutes) raises (carma::util::UserException)
 Set image rotation and az/el fields of view. More...
 
void takeBackgroundImage (in unsigned short numFrames, in unsigned long seq) raises (carma::util::UserException)
 Take background image. More...
 
void turn (in SwitchState state) raises (carma::util::UserException)
 Turn the telescope and camera on or off. More...
 
void zeroTestOffset () raises ( carma::util::UserException )
 

Detailed Description

Antenna optical telescope control.

Definition at line 94 of file OpticalTelControl.idl.

Member Function Documentation

void carma::antenna::common::OpticalTelControl::applyTestOffset ( in double  azInArcmin,
in double  elInArcmin 
)
raises (carma::util::UserException
)

Apply an offset to on the fly generated test images.

For testing simulation purposes only.

Parameters
azInArcminAzimuth offset in arc minutes.
elInArcminElevation offset in arc minutes.
Exceptions
UserExceptionIf not running in simulation mode.
void carma::antenna::common::OpticalTelControl::findCentroid ( in unsigned short  numFramesPerImage,
in unsigned short  minValidCentroids,
in unsigned short  maxCentroidAttempts,
in unsigned short  numEdgePixels,
in unsigned short  apertureRadiusPixels,
in float  pixelThresholdSigma,
in boolean  subBackground,
in boolean  normalizeMedian,
in unsigned long  seq 
)
raises (carma::util::UserException
)

Find centroid of star in field of view This routine will calculate the centroid on each of a number of specified images.

The routine automatically co-adds frames when specified. The sequence number is used to verify the remote system has completed the requested operation. The sequence number is stored locally on the remote system and once complete, the corresponding monitor point for this sequence number is set to the one passed as seqNo.

Parameters
numFramesPerImageNumber of frames to co-add per image.
minValidCentroidsMinimum number of valid centroids after which to return.
maxCentroidAttemptsMaximum number of images to centroid on in an attempt to obtain numValidImages.
numEdgePixelsNumber of edged pixels to ignore.
apertureRadiusPixelsRadius of centroiding aperture in pixs.
pixelThresholdSigmaOnly pixels with a value greater than the mean + pixelThresholdSigma * sigma will be considered for centroiding. 3.0 is a good default.
subBackgroundSubtract background image.
normalizeMedianBefore subtracting the images, scale the background images and the current image to the same median value.
seqNoSequence number to return when command completes in monitor point named CentroidSeqNum
Exceptions
carma::util::UserExceptionIf backgroundImage or normalizeMedian specified but no image stored.
Precondition
If subBackground or normalizeMedian is true a background image must have been stored prior with takeBackgroundImage.
See Also
takeBackgroundImage
findCentroid
CentroidResults carma::antenna::common::OpticalTelControl::getCentroidResults ( )
raises (carma::util::UserException
)

Return results of last findCentroid call.

flattenedOpticalImage carma::antenna::common::OpticalTelControl::getImage ( in unsigned short  numFrames,
in boolean  subBackground,
in boolean  normalizeMedian,
in boolean  normalizeImage 
)
raises (carma::util::UserException
)

Create and return an image from the input number of frames.

Co-adds input number of frames and returns the result. This command blocks while grabbing and co-adding frames and is thus only for experimental and debugging purposes.

Parameters
numFramesNumber of frames to co-add into image.
subBackgroundSubtract background image.
normalizeMedianBefore subtracting the images, scale the background images and the current image to the same median value.
normalizeImageNormalize output image such that the minimum pixel value is 0 and the maximum is 255 (contrast stretch).
See Also
findCentroid
flattenedOpticalImage carma::antenna::common::OpticalTelControl::getStoredBackgroundImage ( )
raises (carma::util::UserException
)

Get stored background image.

Returns last image stored with takeBackgroundImage. If no image has been stored an exception is thrown.

Returns
Background image.
Exceptions
carma::util::UserExceptionif no image stored.
Precondition
takeBackgroundImage called prior to store background image.
Postcondition
UserException if no image exists or returned image.
flattenedOpticalImage carma::antenna::common::OpticalTelControl::grabFrame ( )
raises (carma::util::UserException
)

Get a frame from the frame grabber and return it.

Returns
a frame of CCD data
Deprecated:
Use getImage.

This method is provided here for debugging purposes and with the idea that it may be called by a dedicated thread on the ACC. Functions which return data like this should NOT be called directly by control threads in the ACC, because such calls will cause them to block.

See Also
setFieldsOfViewAndRotation
void carma::antenna::common::OpticalTelControl::setBrightness ( in float  brightness)
raises (carma::util::UserException
)

Sets the brightness of subsequent frames.

Parameters
brightnessNormalized brightness (0.0 - 1.0).
void carma::antenna::common::OpticalTelControl::setContrast ( in float  contrast)
raises (carma::util::UserException
)

Sets the contrast of subsequent frames.

Parameters
contrastNormalized contrast (0.0 - 1.0).
void carma::antenna::common::OpticalTelControl::setFrameDimensions ( in short  x,
in short  y,
in short  x0,
in short  y0 
)
raises (carma::util::UserException
)

Set specific frame dimensions.

This effectively crops any frame buffer image to the specified dimensions. Please note the distinction between resolution and frame dimensions. The supported resolutions define the maximum frame dimensions only! Frame dimensions are measured as a width and height starting at a particular offset (x0, y0) into the image. As an example, the optical telescope on 10-m antennas is mounted at a -90 angle, thus when requesting HIGH_RES frame dimensions, one would specify 468x760 rather than 760x468 (native dimensions). If (x0 + x, y0 + y) exceeds the current resolution OR image boundaries, an exception is thrown. No autoscaling is performed so you must properly set a resolution which supports your desired frame dimensions.

Parameters
xSize in x dimension
ySize in y dimension
x0Initial x offset.
y0Initial y offset.
Exceptions
carma::util::UserExceptionUpon invalid dimensions.
See Also
OpticalTelControl::setFramegrabberResolution
void carma::antenna::common::OpticalTelControl::setFramegrabberResolution ( in Resolution  res)
raises (carma::util::UserException
)

Set the resolution of the framegrabber.

Parameters
resDesired resolution.
See Also
carma::antenna::common::Resolution
void carma::antenna::common::OpticalTelControl::setRotationAndFieldsOfView ( in float  rotationInDegrees,
in float  azFOVInArcminutes,
in float  elFOVInArcminutes 
)
raises (carma::util::UserException
)

Set image rotation and az/el fields of view.

The rotation value is used to align raw camera images with the az/el coordinate system. Field of view values define the plate scale in azimuth and elevation after rotation. The rotated cropped image is used by findCentroid.

Parameters
rotationInDegreesAmount of rotation in degrees.
azFOVInArcminutesAzimuth field of view in arcminutes
elFOVInArcminutesElevation field of view in arcminutes
See Also
findCentroid
void carma::antenna::common::OpticalTelControl::takeBackgroundImage ( in unsigned short  numFrames,
in unsigned long  seq 
)
raises (carma::util::UserException
)

Take background image.

Identical to getImage but saves the image as the background image for future image subtraction. When the operation completes, the sequence number is placed into the monitor system.

Parameters
numFramesNumber of frames to co-add into image.
seqNoSequence number to return when command completes in monitor point named CentroidSeqNum
Exceptions
carma::util::UserExceptionon fatal error.
See Also
getStoredBackgroundImage
void carma::antenna::common::OpticalTelControl::turn ( in SwitchState  state)
raises (carma::util::UserException
)

Turn the telescope and camera on or off.

The OFF command covers the telescope for protection (lens cap, flap) and turns off the camera.

Parameters
state
See Also
SwitchState

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