GCS Software Description Notes

GCS acquires using an image specified by the guidecam_ROI values in the configuration file - sent to azcamserver with the binning parameters.

After acquisition, it creates a smaller ROI based on the guideWindowSize - this info is sent to the azcamserver with the binning parameters.

For centroiding, it creates a subimage (internal to the CamImage class) based on the guidecam_clipping config value, centered around the hotspot.

Most processing is done in 1x1 binned space, so the code can mostly ignore binning (for pixel scale, for instance).

  • Full frame, guide image, clipped image:
    AcqGuidingClipping.jpg

Notes on the GuidingThread class

configuration attribute description
guideWindowSize   1x1 pixel size for ROI from azcam once acquisition is done
guidecam_ROI AzCam::_ROIX1 etc  
maxOffsetToHotspot _maxDistanceFromHotspot used to accept/reject centroid (0.54 for MODS/LUCI)
maxHotspotFromProbe _maxHotspotFromProbe when exceeds this GCS moves the probe, defaults to 0.5

IIF uses the results from GCSSubsystem::resumeGuiding (which calls GuidingThread::resumeLoop) to decide if guiding resumed correctly (on an offset, for example).
If ! _inLoop , then it returns true immediately.
resumeGuiding calls isStarInBox which checks the GuidestarCloseToHotspot DD entry for the specified (config value is cyclesUntilStable which is set to 1) number of images.

The _inLoop flag is set to true when the guide iteration gets started, in the while ((!_pauseFlag) && _isGuiding) - so as soon as the _pauseFlag is cleared (the end of GuidingThread::resumeLoop), the loop will start again.


DD Entries

DD entries Source module Telemetry
AGW.SFPachieved_X
AGW.SFPachieved_Y
base class AGWUnit to current probe position from attribute _probePosition guiding.KFPProbeX/YAchieved
AGW.genericXachieved
AGW.genericYachieved
MODS and LUCI: returned from getxy command (doUpdateProbePosition)
but also set in the base class getProbePosition which is called from setProbePosition
base class sets SFPachieved and genericAchieved to same values
AGW.SFPrequested_X
AGW.SFPrequested_Y
base class AGWUnit to current requested position (unless homing) guiding.KFPProbeX/Yrequested
AGW.SFPerror_X
AGW.SFPerror_Y
base class AGWUnit to current probe pos - requested (mm)
AGW.genericXrequested
AGW.genericYrequested
MODS and LUCI: returned from SFP-to-AGW commands (doSetProbePosition)
should be set only in the base class setProbePosition instead of relying on derived classes
 
GuideCam.HS2PRB_ASEC
GuideCam.HS2PRB_MM
not set or used - delete from shared mem  
GuideCam.PR2GS_ASEC
GuideCam.PR2GS_MM
not set or used - delete from shared mem  
GuideCam.PRB_SFP_X
GuideCam.PRB_SFP_Y
(says mm) not set or used - delete from shared mem  
GuideCam.PR_SFP_X
GuideCam.PR_SFP_Y
(says mm) not set or used - delete from shared mem  
GuideCam.probespot_x
GuideCam.probespot_y
(says pixel) not set or used - delete from shared mem  

GCS Client

usage: gcsclient command left|right <optional args>

commands are selectAGW, closeLoop, moveProbe, getStatus, getFilter, setExpTime, 
             setGuideRate, setFilter, setFocus, getFocus, getHotspot, setHotspot, 
             stopGuiding, setGSsfp, setGS, readGuideCam, readWFSCam, sendZernikesToPSF, 
             setDbgToGCS, sendCentroidsToPCS, triggerWFS, setWFSExpTime, pauseGuiding, 
             resumeGuiding, offsetGuiding, startWFS, stopWFS, collimate, startAcquire, 
             stopAcquire, setNewInstrument, parkActiveProbe, feedGuideImages, offsetProbe, 
             getGuideCamSubWindow, setGuideCamSubWindow, resetGuideCamController, resetWFSCamController 
[ksummers@ksummers-dev 2017A]$ gcsclient getStatus left
GCS Version: 5.5a
GS is invalid or not yet set.
GCS status: "OK"
Selected AGW unit: 0
Selected AGW name: "MODS1"
Selected AGW type: OSU_MODS
Associated rotator angle (deg): 0
GCS isAcquiring: 0
GCS isGuiding: 0
GCS isWFSing: 0
GCS Guide Rate: 0.4
Guide camera exposure time (ms): 2000
WFS camera exposure time (ms): 30000
AGW position (mm): 0, 0 (native: 0, 0)
AGW Focus: -12345
AGW Filter: 1 : Clear
AGW Status: OK
AGW Power: ON
AGW Homed State - Position: NO     Filter: NO     Focus: NO 

Useful grep Commands for the SYSLOG

To see see probe movement errors:
 find . -name \*.log -exec grep doSetProbePosition {} \; | grep ERR 

New "wrap-up" line added at the end of every guide cycle. Grep for pp:
20150429.log:2015-04-29T09:57:40.372283+00:00 tcs64-1 LBT_GCSL: GT: pp: -84.122 154.499, KFP: -82.457 148.219, HS(pix) 261.0 211.2, PR2HS(as): 0.012, cent: 265.2 206.3, GCxy(as) -0.23 0.27, GC(as) 0.35, sfpvel: 0.05 0.10
20150429.log:2015-04-29T09:57:45.468198+00:00 tcs64-1 LBT_GCSL: GT: pp: -84.122 154.499, KFP: -82.457 148.219, HS(pix) 261.0 211.2, PR2HS(as): 0.012, cent: 261.1 215.1, GCxy(as) -0.01 -0.21, GC(as) 0.21, sfpvel: 0.12 0.11
20150429.log:2015-04-29T09:57:50.581345+00:00 tcs64-1 LBT_GCSL: GT: pp: -84.122 154.499, KFP: -82.457 148.219, HS(pix) 261.0 211.2, PR2HS(as): 0.012, cent: 258.4 216.2, GCxy(as) 0.14 -0.27, GC(as) 0.30, sfpvel: 0.19 0.09
20150429.log:2015-04-29T09:58:10.169341+00:00 tcs64-1 LBT_GCSL: GT: pp: -84.122 154.499, KFP: -82.440 130.221, HS(pix) 261.4 211.1, PR2HS(as): 0.020, cent: 259.1 204.9, GCxy(as) 0.12 0.33, GC(as) 0.35, sfpvel: 0.17 0.12
20150429.log:2015-04-29T09:58:15.279016+00:00 tcs64-1 LBT_GCSL: GT: pp: -84.122 154.499, KFP: -82.440 130.221, HS(pix) 261.4 211.1, PR2HS(as): 0.020, cent: 263.8 217.6, GCxy(as) -0.13 -0.36, GC(as) 0.38, sfpvel: 0.23 0.10



To get the probe moves
 egrep "moveProbeOnGuide|moveProbeOnHS|moveWindowOn|MP " current.log | egrep -v "start|exit|reSelect|TEMP|ilter|COORD_RADEC"


MODS setxy error codes:
 agw/include/getErrorMsg.h
 "Warning: Invalid guide probe Y position, must be 0..-180",//17"
  "Warning: Invalid X guide probe position, must be -92..92",//22
  "Fatal: Calibration Tower is in the Beam, move disallowed",//201


Guide corrections are logged in the complete event now:
 grep "applyGuideCorrectio.complete" *.events 


It's useful to see this (and the several lines after it) in the log:
autoAcquireGuidestar: summary ...

AzCamServer to GCS Interface

For all AGWs, the GCS code has an AzCam class for both the guider and wavefront sensor cameras.

For LUCI and MODS, there is a single azcamserver machine that runs the server software process for each of the cameras (8 processes: one for each instrument/guider and instrument/wavefront sensor combination). (see notes on the Commissioning/AzCamServer page)

The GCS interface to the cameras is through the AzCam class. GCS uses a string-over-socket interface to the AzCamServer, parsed by the python file: LBTCommandParser.py
Here are the commands GCS uses of the AzCamServer and what they do with the python objects.

Get version returns string representing the azcamserver software version
ResetController same as the reset command, calls controller.Reset()
SetSocket 1 192.168.58.19 30022 first parameter flag is ignored unless -1 which "cancels remote mode"; other two parameters are hostname and hostport - this is set to whatever hostname GCS is running on
SetROI 85 449 51 424 1 1 sets the focalplane object attributes (first column, last column, first row, last row, column binning, row binning)
Get CameraType returns ControllerType which looks like the string gen1 or gen2 or smallcam or gen3 or gen3e
Get vispixels returns focalplane.NumColsImage and focalplane.NumRowsImage - different answer from GetDetPars if you're not using the full frame
GetDetPars returns focalplane.NumColsImage and focalplane.NumRowsImage ; used to set the ROI attributes in the AzCam GCS class
setParameter IMGTYP set image header keyword
setParameter AZCAMV set image header keyword
SetExposure 2000 values is assumed to be in milliseconds, it's converted to seconds in azcamserver
ReadTemperature 1 flag here is ignored
calls tempcon.GetTemperatures() and sets camera temp and dew temp in reply
Guide 5 1 5 here is a flag, ignored; 1 is number of exposures
sleeps .1, then calls exposure.Guide1
I Attachment Action Size DateSorted ascending Who Comment
AcqGuidingClipping.jpgjpg AcqGuidingClipping.jpg manage 3 MB 16 Mar 2016 - 23:14 UnknownUser Full frame, guide image, clipped image
Topic revision: r16 - 19 Jun 2018, KelleeSummers
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback