CARMA C++
|
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 ) |
Antenna optical telescope control.
Definition at line 94 of file OpticalTelControl.idl.
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.
azInArcmin | Azimuth offset in arc minutes. |
elInArcmin | Elevation offset in arc minutes. |
UserException | If 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.
numFramesPerImage | Number of frames to co-add per image. |
minValidCentroids | Minimum number of valid centroids after which to return. |
maxCentroidAttempts | Maximum number of images to centroid on in an attempt to obtain numValidImages. |
numEdgePixels | Number of edged pixels to ignore. |
apertureRadiusPixels | Radius of centroiding aperture in pixs. |
pixelThresholdSigma | Only pixels with a value greater than the mean + pixelThresholdSigma * sigma will be considered for centroiding. 3.0 is a good default. |
subBackground | Subtract background image. |
normalizeMedian | Before subtracting the images, scale the background images and the current image to the same median value. |
seqNo | Sequence number to return when command completes in monitor point named CentroidSeqNum |
carma::util::UserException | If backgroundImage or normalizeMedian specified but no image stored. |
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.
numFrames | Number of frames to co-add into image. |
subBackground | Subtract background image. |
normalizeMedian | Before subtracting the images, scale the background images and the current image to the same median value. |
normalizeImage | Normalize output image such that the minimum pixel value is 0 and the maximum is 255 (contrast stretch). |
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.
carma::util::UserException | if no image stored. |
flattenedOpticalImage carma::antenna::common::OpticalTelControl::grabFrame | ( | ) | ||
raises | ( | carma::util::UserException | ||
) |
Get a frame from the frame grabber and return it.
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.
void carma::antenna::common::OpticalTelControl::setBrightness | ( | in float | brightness | ) | |
raises | ( | carma::util::UserException | |||
) |
Sets the brightness of subsequent frames.
brightness | Normalized brightness (0.0 - 1.0). |
void carma::antenna::common::OpticalTelControl::setContrast | ( | in float | contrast | ) | |
raises | ( | carma::util::UserException | |||
) |
Sets the contrast of subsequent frames.
contrast | Normalized 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.
x | Size in x dimension |
y | Size in y dimension |
x0 | Initial x offset. |
y0 | Initial y offset. |
carma::util::UserException | Upon invalid dimensions. |
void carma::antenna::common::OpticalTelControl::setFramegrabberResolution | ( | in Resolution | res | ) | |
raises | ( | carma::util::UserException | |||
) |
Set the resolution of the framegrabber.
res | Desired 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.
rotationInDegrees | Amount of rotation in degrees. |
azFOVInArcminutes | Azimuth field of view in arcminutes |
elFOVInArcminutes | Elevation field of view in arcminutes |
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.
numFrames | Number of frames to co-add into image. |
seqNo | Sequence number to return when command completes in monitor point named CentroidSeqNum |
carma::util::UserException | on fatal error. |
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.
state |