[ACP-1458]  Add hook for alternate image acquisition (e.g. spectroscopy)
Type New Feature
Priority High
Severity Trivial
Component AcquireImages script, AcquireSupport library
Fixed In Version [8.18.1
Versions Affected [8.0.18.0.1
Severity Closed
Resolution Complete
Reported By Bob Denny
Resources Bob Denny
Start Date 4/27/2016

Description
This is a major project aimed at supporting the Spectrographs in use by Katherine Blundell at Oxford University (at least at the beginning) and maybe others as time goes on. The hope is that it can all be done within the observing logic script, but... this Gemini ticket is also for containing any changes needed to the main ACP components, the need for which may arise during the project.

Unfortunately the discourse is happening via email so it is no available here and may be lost with email cleanups. I have marked this as private for now.

This has changed into just the AcquireImage() user action and is now publicly visible.

Comments
7/8/2016 4:56:18 PM   Bob Denny
OK, need to get 8.1 out. Closing this out. It's going to have to do!.
7/8/2016 4:55:08 PM   Bob Denny
SVN Comment
Author rbdenny
Repository svn+ssh://rbdenny@a2_svn_dc3/home/rbdenny/svn/astro/acp
SVN Revision 938
Affected files /trunk/ACP Help/relnotes.htm (Modified)
/trunk/Scripts/AcquireImages.js (Modified)
Check-in comment Make missing AcquireImage() method in UserActions harmless. No error in log, nothing. GEM:1458
7/8/2016 4:14:31 PM   Bob Denny
Put a try/catch block around the call to AcquireImage() so that older UserActions won't kill the system. Put an ugly annoying message into the log (<-- future release)
4/29/2016 12:53:56 PM   Bob Denny
LEAVING OPEN - ACQUIREIMAGE() CALL SIGNATURE MAY CHANGE
4/29/2016 12:33:34 PM   Bob Denny
SVN Comment
Author rbdenny
Repository svn+ssh://rbdenny@a2_svn_dc3/home/rbdenny/svn/astro/acp
SVN Revision 919
Affected files /trunk/ACP Help/addtologic.htm (Modified)
/trunk/ACP Help/planfmt.html (Modified)
/trunk/Script Components Master/UserActions-template.wsc (Modified)
/trunk/Script Components Master/UserActionsJS-template.wsc (Modified)
/trunk/UserActions-template.wsc (Modified)
/trunk/UserActionsJS-template.wsc (Modified)
Check-in comment Add AcquireImage custom action (changes not in common with 1459) GEM:1458
4/29/2016 12:31:36 PM   Bob Denny
SVN Comment
Author rbdenny
Repository svn+ssh://rbdenny@a2_svn_dc3/home/rbdenny/svn/astro/acp
SVN Revision 918
Affected files /trunk/ACP Help/relnotes.htm (Modified)
/trunk/Scripts/AcquireImages.js (Modified)
Check-in comment GEM:1459 Add AcquireImage custom action, fix pointing update on second and later focus within a single target (per-filter focusing). Will commit changes that apply only to 1458 in the next push. GEM:1458
4/27/2016 3:29:13 PM   Bob Denny
After some work, it became clear that I can do this with an external program and a new AcquireImage(....) user action that handles everything once the scope has been aimed and possibly focused. Deleted the special acquire script from SVN.
4/27/2016 1:42:03 PM   Bob Denny
Multiple other emails regarding startup sequencing and logic and other stuff not directly related to the spectroscopic stuff. Then from her:

I truly think that if the Plate-Solve-On-One-Camera followed by Refine-Find-On-Little-Camera procedure can be accomplished that this will be an immense asset to a great many of your customers beyond our observatories.    I’m more than willing to help in any way I can.  

4/27/2016 1:29:15 PM   Bob Denny
I do hope that this finds you well and that your training course last month was good fun.    I’m now back home in England after nearly three weeks in the US.   A real highlight of the visit was the final evening of the trip, which was when my husband and I visited Rob Capon and his splendid observatory (this had been postponed from 20th March because of wintry weather).  We had a wonderful evening with Rob & Rose (and were treated to a delicious dinner by Rose :) which was immensely beneficial: seeing ACP in action was such a help - I’m even more impressed and eager to use it than I was previously!  

Following the phone conversation you and I had while I was at NRAO Socorro, I’ve put together FITS images of half a dozen targets taken one of the Global Jet Watch observatory guider cameras - for the Finder Library we discussed - to be used to line up the guider camera once the main Pinpoint plate solution has been run on the wide-field imaging camera.   (As mentioned all the guider cameras at the observatories have identical detectors.)  These Finder FITS images are available in this folder.   This same folder also contains an Excel file that lists the X, Y positions of the target on each Finder FITS images.   Because pictures are sometimes worth 1000 words this folder contains jpegs of each field of view with the target object indicated by a colourful arrow.   

I’m fairly sure we’ve covered this but in case not, all the mounts at the observatories are Bisque Paramount MEs or ME IIs, so German Equatorial.   A further point to mention is that the optical path has an odd number of reflections (one at the primary mirror, one at the secondary mirror, one at the Perseus mirror) - all identical in all the observatories.  And a comparison of one of the above “Library Finders” with a freshly observed image from the guider camera will of course have the exact same reflections as one another.

I still need to get you the recipe for picking out the X,Y position of the dark fibre hole (which is probably just visible on the jpgs in the above folder).   I will send this to you very soon.   I’m a touch busy tonight with various preparations prior to travelling to my Chile school observatory at the end of next week;  work needs to be done out there to fully recover from the 8.4-magnitude earthquake that hit last time I visited.  It’s only now that the aftershocks have finally died down that it makes sense to travel out to fix the polar alignment and tweak up the collimation.  Hoping for a less bumpy visit this time!

4/27/2016 1:27:56 PM   Bob Denny
3/16/2016 [Katherine] - Sent a FITS file showing the guider with the circle around the fiber hole (attached, image of this here):


4/27/2016 1:20:28 PM   Bob Denny
3/11/2016 [Katherine] - I’ve had a short window of opportunity before the sun rose
to make a start on what you asked for.   It’s not as complete as you’d
suggested, but I think the picture is nonetheless clear: there is way
too much scatter in the position of the three
target stars (arcturus, asellus primus and SS433) for guiding to
commence on the guider camera and for spectroscopy to begin merely
following a slew from an(y)other part of the sky.  In normal remote
control operations, after slewing to a target I’d use the
Maxim “Move" command to just put the target onto my fibre hole.
Numbers tabulated in the attached Excel spreadsheet.  The coords of the
centre of the fibre hole are about 300, 296.

However, I think in real life robotic operations we envisage doing a plate solution on the imaging camera, rather than just relying on a very accurate slew to the target?

Because I had very limited time this evening, I just did these three targets of which two saturate easily on the imaging camera. I am wondering what the significance of your request that these targets not be saturated, because the plate solving in TheSkyX (Image Link) seems to cope fine with saturated stars in the image to be plate solved (as long as there are plenty of other stars that aren’t saturated of course).  So, the only image I have for you that is free of saturation is the SS433 field (the target is at about 1102, 602) and this is available from this link

4/27/2016 1:19:01 PM   Bob Denny
3/9/2016 [Katherine] - I’ll be glad to get these together for you (although it
may be a few days - it's the end of term on Friday and we’re
mid-crescehdo right now…).

I had a further thought about lining up the guider camera that I thought I would relay to you, but you may consider it clunky.  If after doing a plate solve with PinPoint on the wide-field imaging camera - and the script has been run that rotates the Perseus instrument selector etc -  we then take (and save) an image from the guider camera.  Then:  do a 2D cross-correlation of this newly saved guider image with a previously saved “Finder Image” taken with the exact same guider camera after some by-hand lining up of the target with the fibre hole.  This 2D correlation then gives the x-offset and y-offset we need to send to Maxim's Move window (or however you prefer to best do this step) to hop from where we are now and where we need to be to be lined up.

4/27/2016 1:17:04 PM   Bob Denny
3/9/2016 [Bob] - I hope I caught you soon enough before your  trip to the US... I
have been playing with ideas, and wonder if you might do some
confirming tests before I go too far along the road...
  1. Prepare some offset coordinates which will put the target star on or near the center of the guider.
  2. Send the telescope far away then back to these coordinates.
  3. Take a guider image at the typical exposure interval you would use for guiding on that star.
  4. Identify the target star in the guider image (approx XY)
  5. Repeat 1-4 several times for this target to get an idea of the repeatability of this position/flexure
  6. Now take an unfiltered image with the target star centered in the wide field camera. Don't allow (near) saturation of any of the nearby stars, but make the exposure as long as possible. What I am looking for is flux values. Save this image as well.

Repeat for several different targets (alt/az at various places on both sides of the meridian). I hope I have made this clear enough. The idea is for me to test/verify the practicality of the approach we talked about. I am concerned about identifying the target star in the guide image. I can do a lot including flux measurements and precision XY measurements with PinPoint, just no platesolving of the guider image (I don't think :-)). 

4/27/2016 1:14:50 PM   Bob Denny
1/21/2016 [Katherine] - The list below is my understanding of how it might be possible to proceed.  I’ve colour coded in green the things that I assume/hope are already doable or at least not too worrisome, and colour-coded in blue things that I reckon I can take care of.  I hope that this all makes some sense and that no showstoppers emerge!  Do let me know your thoughts either way when you’ve had a chance to get to this and ponder. 

1.  The Maxim configuration used for the main ACP observing is that Camera 1 has been selected to be the wide-field imaging camera and Maxim’s Camera 2 has been set to be the SXH9 guider for the spectrograph

2. Now suppose ACP says "it is time to move to Target X"

3. ACP tells Maxim to slew to the RA and Dec in the ACP database for Target X

4. ACP needs to execute a script - this script switches the Perseus instrument selector to direct the light path to the imaging port [more info about this script in step 6]

5. ACP tells Maxim to do a plate solve with Pinpoint and it uses its Camera 1 (the wide-field imaging camera) to do this, resulting in the RA and Dec from step 3 being notionally at the centre of the imaging camera’s field.

6.  ACP then needs to execute a script - this script switches the Perseus instrument selector to direct the light path to the spectroscopy port;  this script will also perform two offsets: (i) the known focus offset between the imaging camera’s focal plane and the spectroscopy guider camera’s focal plane and (ii) the known x-y shift that moves the telescope from Target X’s RA and Dec being at the centre of the imaging camera to be at the centre of the spectroscopy guider camera

7.  ACP then needs to execute a script - this script takes an image with the guider camera which gets saved as a .FITS file, then calls a python file which does a source fitting and extraction operation on the stars in that image and then calculates the offset needed to plonk the source identified as Target X within these on the fibre hole, reports the offset back to ACP e.g. by writing a new file containing these two numbers onto disc in a watched folder.

8.  ACP then sends this offset calculated by the python script into the Move command within the Guide window of Maxim’s Camera Control (or equivalent operation to produce this offset).

9.  ACP then starts Maxim guiding with Camera 2 in the normal way; ACP pauses for guider settle

10.  ACP then executes a script -this script tells TheSkyX to take N exposures on the spectroscopy camera of Target X, for Y seconds.

11. ACP halts this script when it is time to slew to Target Y or when all N exposures on Target X are finished.

Thoughts:
  • TheSkyX and the ACP database need to have the same Target Names, RAs and Decs so that the FITS headers all appear sensibly.
  • It should be assumed that prior to step 2, the SXH9 guider camera has been focussed via our normal mirror flap method. 
  • The script referred to in step 6 is being written and tested by Daniel van Noord at Optec (I already have an early version of it which can be called either by a .js script or by a .vbs script)
  • I found some promising-looking scripts for step 7 within a number of scripts written by Ken Sturrock (will relocate the web-page for these and advise presently) but also the very simple examples that are available on www.Bisque.com->Downloads->Documentation->Technical Documents->ScriptTheSkyXDocumentation seem to me to look like they would suffice.
  • An alternative strategy for setting the images going on the spectrograph camera once the guider is happily guiding would be this route:   http://neutronoptics.com/ascom.html