LBC WRS Image Analysis Software

In April-2014, we started testing a replacement LBC active optics application for LBCFPIA (or DOFPIA) called WRS (or DOWRS).

In February-2018, Marco sent a version of WRS for analyzing tech chip images. Analysis of tech chip images is now all done on the CMU. WRSTech covers installation and testing of the tech chip WRS code.

How to Run It

DOWRS is installed on the mountain in the lbceng account. It is integrated with the old DOFPIA in that all the WRS is in the src subdirectory, like the LBCFPIA directory (using the old astron and mpfit libraries from LBCFPIA. We can upgrade them if we want to try that too.)

The technical report is: 602f800. The software documentation and user manual is: 602f810 with more detailed instructions than this wiki page. This lists all the configuration options that are modified in WRS_RED.par and WRS_BLUE.par .

To run with live LBC:

> source /home/lbceng/WRS/setup.csh
> idl
IDL> dowrs


To run standalone on an existing file:

IDL>@make_wrs
IDL> standalone_wrs,"fitsfilename", /red     OR
IDL> standalone_wrs,"fitsfilename", /blue

Issues

Minor Things to do:

  • DONE separate the lbcfpia.cfg file into a wrs version so the two programs can run from the same directory. JMH thinks this means adding WRSmode flags to dowrs.pro as KS did in dofpia_wrs.pro. KS did this on 9-July-2015:
    I modified it to use $WRS_HOME/lbcwrs.cfg if the WRSMode flag is set. If the WRSMode flag is set it will look for: 1. the file specified on the command line 2. lbcwrs.cfg in the local directory 3. lbcwrs.cfg in $WRS_HOME I think the non-WRS mode should work as it has.

  • include the environment variables from setup.csh in the proper accounts (lbto, partners, lbcobs) so even setup.csh is not needed
  • DONE add the /LOW flag to dowrs, so we don't need to keep dowrslow.pro around. JMH made the low position the default on 14-Sep-2015.
  • Install an absolute and world-writable path in WRS_RED.par and WRS_BLUE.par for the 'save' directory.
  • Decide if we want the DONE Keyboard check or the ability to run from a script.

Testing Notes

20161116 - Analysis of 20161107

After analyzing a failed DOHYBRID convergence from 20161107, Olga/Marco/John changed the gain for the coma correction (both a7 and a8) in WRS_RED.par and WRS_BLUE.par from 0.5 to 0.7. The correction computed by WRS appears to have been correct, but not enough of it was applied to the mirror to make FPIA happy for the next iteration.

20161004 - Deployment Tests of DOHYBRID

Here's what I did (to fix the problem of a writeable save directory not existing). Next time we collimate, we'll run dohybrid to give this a try:

mkdir /home/lbceng/WRSsave/
chmod 777 WRSsave

cd /home/lbceng/WRS/src/
cp WRS_BLUE.par WRS_BLUE.20161005.par
cp WRS_RED.par WRS_RED.20161005.par

Replace './save/' with '/home/lbceng/WRSsave/' in WRS_BLUE.par and WRS_RED.par

Let's see how that works... I can see, though, that it does generate a lot of files. That can be turned off (the next line in the WRS_BLUE/RED.par), but it seems OK for now.

20160226 - WRS v0.9.12

Marco provided code with improvements to the initial spherical check.

John's notes from 20160229:
I have installed v0.9.12 of WRS in the lbceng account on the mountain.

I had to revert back to the older version of make_wrs2.pro because it
makes the following error regardless of whether I am running from
the WRS/src directory or not.

[lbceng@obs2 ~/WRS]$ source setup.csh
[lbceng@obs2 ~/WRS]$ idl
IDL Version 8.1 (linux x86 m32). (c) 2011, ITT Visual Information Solutions
Installation number: 223182.
Licensed for use by: LBTO-University of Arizona

IDL> dowrs
% Compiled module: DOWRS.
% Compiled module: MAKE_WRS2.
% Compiled module: FILE_COMPILE.
% FILE_DIRNAME: String expression required in this context: PATHNAME.
% Execution halted at: FILE_COMPILE       67
+/home/lbceng/WRS/src/file_compile.pro
%                      MAKE_WRS2           7 /home/lbceng/WRS/src/make_wrs2.pro
%                      DOWRS             208 /home/lbceng/WRS/src/dowrs.pro
%                      $MAIN$

I also had to change permissions on ddget.sh to 755 as usual.

20160214 - Olga and John testing modified code for correcting Z11

20160213 - John and Marco testing LBC-Blue convergence

20160124 - Marco testing WRS on Blue side with WRS v0.9.11

After the last specific changes made on the code and specific for the blue channel, it seems WRS is able to correctly estimate the large initial spherical aberration which is usually found on blue (see attached image for an example of estimation of Z11). During the tests, WRS correctly estimated the sph aberration many times without problems. However, for some reason which is under investigation, it seems that the estimated correction was not sent to the mirror, thus we could not converge. Indeed, after sending a large amount of Z11 to the mirror, the Z11 of the pupil at the following iteration was either not increasing or decreasing by the same amount. After a preliminary analysis of the code, it seems that this is a minor bug in the IDL wrap that sends the commands to the TCS. I'm working on that and hope to fix it very soon.

All in all, I believe it's good to finally have WRS properly estimating the initial aberrations even in the blue wing. This is an important step forward. I'm sure we will obtain the convergence in the blue after fixing this small bug.

20160114 - Marco testing WRS on Blue side.

ddget.sh wasn't executable. This caused dowrs to report that the LBC was not authorized. John resolved this problem.

Marco ran dowrs:
  • It corrected coma, but some adjustments were needed to spherical:
SPHTHR changed from 10 to 6
a11:0.8 changed from 0.8 to 0.5
NCYCLES changed from 9 to 15 (simply to allow more time to see whether it would converge).
The a11 scale factor magnitude was correct but sign may be incorrect. Marco took over editing the file from here (connection speed increased).

20160108 - Installed WRS v0.9.10 in /home/lbceng/WRS/src/

20151220 UT - First Blue On-Sky Tests

Marco wrote:
As you probably know,  yesterday we finally had the chance to do some short onsky test on blue.
Although the tests were done with a milky sky, due to the presence of an almost constant layer of high clouds, I had the opportunity to adjust several settings in the WRS configuration.

Unfortunately, we could not send the commands to M1 and check the convergence due to a compilation issue. It was almost impossible to find this bug without using the WRS version installed on the mountain, as it was caused by a combination of environment variables and the exact IDL version used, which was difficult to reproduce.

Attached you can find the new version of the code fixing this, and containing the new configuration file (please note that I have already included in the distribution the same dowrs.sh script used on the mountain).

Please let me know when some more test is possible. Hopefully we should be able to converge now also in the blue.

Finally, I take the chance to thank Steve for the support.

Date: Tue, 22 Dec 2015 17:57:30 +0100
Hi Olga,

we had a WRS library containing all the needed routines which was compiled at
the start up. For compatibility reasons we also had a copy of one of the
routines contained in the library, and the filename was the same name of the
routine in the lib.
Now, under IDL 8.4, if you compile the library at the beginning (@make_wrs
which is called by the dowrs.sh script in our case) all the routines included
in this library are used without problems.
This is not the case under previous versions of IDL. Indeed, even if you
compile the library at the beginning, if you have a file with the same name as
the one of the routine in the library, IDL forces the recompilation of the
latter at runtime. I don't know why this happens, but it is very annoying as
it is difficult to discover if you work under IDL 8.4 or newer.

Hope this helps.

Cheers,
Marco

20150706 UT - Installed WRS v0.9.8 in /home/lbceng/WRS/src/

  1. make_wrs2 call added to CALL_WRS. This compiles the WRS routines on the fly. (No @make_wrs needed anymore.)
  2. Separated output displays for RED and BLUE channels.
  3. Issue with unit 33 open when Ctrl+c fixed.

20150402 UT

JMH made the following software changes today:
  • Use /FIRST to send a -3000 nm Z4 to make an extrafocal bias in dowrs.pro.
  • Use environment variables WRS_HOME and WRS_DATADIR rather than their LBCFPIA equivalents.
  • Created dowrslow.pro (pronounce "do wrs low") to readout a lower section of the CCD chip for more consistent focus.

20150401 UT

Starting at about 10:15 UT working on LBC-Blue only. We learned that astigmatism will run away if you are on the wrong side of focus. This is a tricky problem because WRS uses fairly small (0.4 mm) extrafocal offsets. One possibility is to force the focus correction to be negative if the pupil is small. Another possibility is to pre-send a negative Z4 correction (as FPIA sends Z11). We also found that one of the astigatism signs was wrong (even when extrafocal) by comparing to the red parameter file. Moved global offset Z from +0.1 to -0.1 mm to push us slightly extrafocal.

11:45 Blue has converged to some very nice looking pupils.

11:50 start a superfoc 5 series.

20150331 UT - Installed WRS v0.9.7

  1. Blue and red param files separated (WRS.par becomes WRS_RED.par WRS_BLUE.par)
  2. Added sph_chek.pro Spherical aberration check before coma first order estimate. This is introduced for the evaluation of the Sph which often affects LBC-B
  3. CALL_WRS now reads blue and red param files depending on the keyword set

20150324 UT

Testing WRS with both Red and Blue. I copied in the new ICE version of TCSSendWavefront. Marco's first runs on LBC-Blue show a small bias in coma (it converges with a slight asymmetry in the pupil). Blue focus sequence at ~11:24 UT after convergence. The focus is perhaps 0.020 mm too high. WRS adds about 200 nm of Z11 on each iteration regardless of how Marco adjusts the modelled central obscuration. ~12:24 another Blue focus sequence with better Z11. All these data are collimated ONLY for Blue.

20150115 UT

Marco wrote:
This is to inform you about the tests of last night. Thanks to Eleonora, we got a chance to run WRS, and the good news is that the code converged again several times and on different targets. We also acquired some focused image that we are about to better analyze. We hope to run new tests this night.

The only thing that we noticed is that sometime the pupils are a little bit to large at the beginning of the collimation procedure. It might be useful to shrink them a little bit by reducing the focus offset. However, this is something that we will investigate more in detail in the next coming days.

John replies:
The focus is a tricky question because there is an uncertainty of focus position on nights with poor thermal stability. In my experience, this uncertainty can be as much as 30 pixels pupil diameter (0.4 mm focus) on the extreme nights. Thus, it is impractical to adjust the focus offset to avoid the problem as the uncertainty is approaching 100%.

201412

Marco Stangalini wrote: "In December we got one good night of tests. The tests were successful and after the tuning up of some parameter done in the last version of WRS, as well as the astigmatism definition, the algorithm converged without problems. It seems that now, after adjusting the configuration, the problems you encountered with the astigmatism are solved. However, I could not adjust the parameters of the trefoil and check its definition on the mirror because of clouds. It would be nice if we could have some more testing time to finish the optimization.

20141118 UT

Running WRS version 0.9.6 with interactive coma.

11:41 Preset to 09:00:00 0:00:00 Sky is clear. Seeing is ~1 arcsec. A bit of moon. Previously focussed on a different field by DOFPIALOW.

11:43 dowrs - but housekeeping inhibited the blue channel

11:49 dowrs - is putting in un-needed trefoil. Red diverges in astigmatism and trefoil as does blue. John stops the script after 6 iterations.

12:05 Clear Active Optics on both primaries. Now starting with lots of coma.

12:06 dowrs - does a good job on the coma in ~2 iterations. Then the model starts picking up stray astigmatism. John stops the script after 6 iterations - not as much diverged this time.

12:19 dofpia (without clearing active optics) Attempt to call undefined procedure/function: 'ANABLOB'

12:22 Apply +500 nm of Z10 manually to each primary.

12:23 dowrs - I'm confused. Now that the real red pupil is triangular, the model red pupil comes out circular, and wrs applies zero trefoil correction. Meanwhile blue is diverging in astigmatism. John stops the script after 4 iterations.

12:32 Remove the +500 nm of Z10 from each primary. Also remove 4000 nm Z6 from SX.

12:33 dowrs - Blue is diverging in Z6 again. Red seems better, but is not really converging. John stops the script.

12:43 Add +300 nm of Z9 to each side, and remove 2000 nm Z6 from each side.

12:44 dowrs - failed because the pupil was not completely in the box. Was there an overlapping faint pupil?

12:54 dofpia = ANABLOB again (it wasn't accidental)

20140903 UT

09:51 LBC preset to WT10_342. Sky is clear with seeing about 0.8 arcsec.

09:54 DOWRS

Had to add .r lbcfpia_WRS to make_wrs.pro

Marco has us change THRESHSVD from 0.4 to 1.5 in WRS.par This fixes the problem where the last iteration was diverging from an otherwise good model.

10:08 Marco is driving from Rome.

10:12 INTERACTIVE=1 FIRST_ORDER_ADJ=1 in WRS.par

10:36 INTERACTIVE=0 FIRST_ORDER_ADJ=0 in WRS.par

10:46 Switching to DOWRS, /REDONLY as Blue side seems to be diverging in astigmatism.
  • Is the sign we flipped two days ago wrong?
  • Does WRS have a different astigmatism angle?
  • Is the LBC rotator angle being applied in the wrong direction?

11:00 Commented out the Initial and Final Z11

11:20 Changed z4limit from 6000 to 26000 in lbcfpia.cfg. We need to make a wrs specific configuration file.

Red pupils look good, so we'll take an image in focus. Blue is not collimated at all.

11:34 WT10_342 x120

Red filter wheel had a problem. Try again.

11:37 WT10_342 x120 - guiding failed. lbcr.20140903.113743.fits Rotator didn't work on either side??, but red focus looks good.

11:43 Add Z9=+500 nm to Red manually

Trefoil has a rotation issue, and perhaps crosstalk with astigmatism. Apparently need a rotation of 45 degrees CCW.

11:54 Add Z5=+3000 nm to Red manually, and remove the Z9.

115553

20140902 UT - Installed WRS v0.9.6

We installed Marco's new version v0.9.6:
At first, I would like to thank you again for the time spent with me testing the code last night. Please find attached the new version which implements the improvements we discussed together. In particular I have implemented a new keyword which allows the operator to perform a fast check of the coma in the first iteration only if required (If the pupil is not good enough) Secondly, I have also implemented a new feature which allows the operator to interactively click on the approximative position of the pupil obscuration to correct very large coma (if needed). A window opens asking the operator to click on the approximative position of the pupil center. In addition, I have also corrected some minor bug and I have adjusted the internal numbers which affects the trefoil estimation.

Tasks for the next observing

  • DONETest WRS v0.9.6 on-sky
  • Why is astigmatism running away?
  • Measure the response to trefoil
  • Calibrate the focus gain and the focus offset

20140901 UT

JHill (mtn) and MStangalini(Rome) are using version 0.9.5 from 20140620. We are only using LBC-Red, and MODS1 is driving the telescope in pseudomono mode.

07:55 running DOWRS -- TCS connection error, DOWRS is not robust against me forgetting /REDONLY -- even though it knows that LBC-Blue is not authorized.

08:00:57 DOWRS, /REDONLY
First pass gets wrong answer

Clear Active Optics (on PSFGUI)

08:17 DOWRS, /REDONLY
First pass has a diamond ring, and it figured out that focus was needed.
It applied a bit too much focus and made the pupil oversized.
Second pass made the focus worse.
Third pass had a good looking model with a bit too much coma.
Fourth pass, too much coma in the other direction.
oscillating in Z8 -- the model is too comatic compared to the real pupil.

09:00 Marco Stangalini running DOWRS remotely from Rome.

09:09 changed focus and coma gains from 1.0 to 0.5 preserving signs. WRS.par

09:26 Tip 0 Tilt 0

09:28 Clear Active Optics

09:29 Tip 0 Tilt -40 (too far) -- Adjusting coma free pointing as MODS moves around the sky to keep primary mirror in range of travel and to get desirable pupils onto the array.

09:31 Tip 0 Tilt -10

09:39 Tip 10 Tilt -10 change filter in the OB from z-SLOAN to r-SLOAN. R_r40extra.ob

09:42 Tip -20 Tilt -10

09:47 Tip 0 Tilt -25

09:50 Tip 0 Tilt +15

change filter back to z-SLOAN

10:04 Tip 0 Tilt +25

10:07 Tip 0 Tilt 40

10:24 change trefoil gains (Z9, Z10) to 0.3, change astigmatism gains (Z5, Z6) to 0.5, Z11 to 0.5 (used only at 10:31 UT)

10:28 Tip 0 Tilt 60 (as far as we can go)

Clear Active Optics

(the two trefoil zernikes might be swapped)

Put focus (Z4) gain back to 1.0, otherwise the offset we subtract gives the wrong value.

Change astigmatism gain back from 0.5 to 1.0.

Clear Active Optics

10:52 Manual Z5=+3000

11:01 Z5 went the wrong direction, so change gain from -1.0 to +1.0

11:02 Apply Manual Z6=+3000 Tilt=56 (we were bumping the limit) WRS wanted -2500 Z6 (which was correct).

11:13 Clear Active Optics, move to a new field.

11:24 Tip +20 Tilt 0

11:37 Clear Active Optics while moving to a new target. Manually add Z9=+500

11:50 The correction was Z9=+235 Z10=-217 (which means a rotation of the trefoil zernikes)

11:54 Tilt=40 Z9=0 Z10=+500

next image had a MODS1 offset, so it was trailed

Residual coma is due to the fast mode which is fooled by the spider. Fast mode is good for very large coma but not for small coma.

estimate was Z9=300 Z10=389 confirming a rotation

20140615 UT

using v0.9.4

John added rotation of the Zernikes based on rotator angle to lbcfpia_wrs.pro, and changed the gain of Z7 to -1 in WRS.par. The rotation of coma has been verified correct on-sky. Other aberrations still need to be checked.

03:30 First frame of pupils was near Saturn, and background gradient across the field destroyed pupil selection. See lbcr.20140615.033415.fits. OK if it did not select any of these pupils, but it should not select a random bright spot on the right edge of the image.

We used DOWRS running both Red and Blue to remove the coma (only significant on LBC-Red) tonight before collimating with DOFPIA. It got the coma roughly correct.

Example: "save/WRS_images_Sun Jun 15 03:43:42 2014.jpg" -- Coma looks reasonably correct, but the focus/diameter of the pupil is off.

Closed for a while due to wind, switched to MODS on left side.

05:45 Now running dowrs, /redonly in parallel with MODS observations. Initial coma correction was good, but astigmatism ran away. Maybe my rotation is wrong? In general, the model looks good after ~4 iterations, but then it starts over-interpreting things and making crazy shapes. This is a good sequence to look at.
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 05:49 /Repository/20140615/lbcr.20140615.054849.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 05:50 /Repository/20140615/lbcr.20140615.055003.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 05:54 /Repository/20140615/lbcr.20140615.055339.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 05:57 /Repository/20140615/lbcr.20140615.055652.fits
06:01 Clear Active Optics on Right , manually add +2000 Z8 to get approximate collimation 06:06 dowrs, /redonly, /askme 

-- picked a double pupil each time - didn't send any results to telescope, but other pupils in the field may be interesting. 06:11 Added +2000 Z6 manually 06:15 

Added +2000 Z5 manually 06:17 Removed the +2000 Z6 manually

-rw-rw-r--. 1 1127 1005  3283200 Jun 15 06:07 /Repository/20140615/lbcr.20140615.060637.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 06:10 /Repository/20140615/lbcr.20140615.061022.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 06:13 /Repository/20140615/lbcr.20140615.061232.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 06:17 /Repository/20140615/lbcr.20140615.061630.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 06:18 /Repository/20140615/lbcr.20140615.061828.fits
-rw-rw-r--. 1 1127 1005  3283200 Jun 15 06:22 /Repository/20140615/lbcr.20140615.062227.fits

20140614 UT

Summary
We ran the latest version, WRS_v0.9.4. Daytime tests showed similar results to the previous version, although the files did differ by ~50-100 lines. Changes were needed to lbcfpia_WRS.pro to compensate for the focus offset given to produce the pupils. WRS.par was also changed to turn off sending of Z2 and Z3 (tip and tilt). With the high sky background, pupil finding became difficult. In crowded fields, overlapping pupils were sometimes found, and these strongly affected the pupil fitting algorithm --- two nearby pupils were fit over, introducing a lot of astigmatism or trefoil, for example. Towards the end of the night, we ran with an OB to obtain smaller pupils, 40-pixel diameter (FOCUSOFF -0.5 mm).

Issues noted:
  • pupils are not well centered in the box, but instead, the brightest spot appears centered.
  • Coma corrections appear not to take into account the rotator angle - they don't map to M1 correctly. (Fixed the following day.)
  • Focus estimate appears incorrect when there is a lot of coma.

Details
  • New version, WRS_v0.9.4, was installed on the mountain, and tested during the day:
  • With standalone_wrs, we found very similar output as we did using WRS_v0.9.3. Tested on files from 20140610 and 20140328 (example with output results in email), in particular:
    • z4 around 20 mic
    • coma still large
    • but the coma was small in an earlier iteration; in fact, for pupil image lbcr.20140610.082503.fits, although 9 cycles were done, best results appeared to be after 3 cycles, and after the 9 cycles, the model fit was notably worse.
  • We edited two files:
    • uncommented lines in WRS_LIB.pro to display the model pupil after each iteration:
        tmp = fltarr(512,256)
        tmp(0:255,*) = congrid(impix, 256,256)
        tmp(256:511,*) = congrid(model, 256,256 )
      ;  tmp(256:511,*) = congrid((impix-model-d1)/(d2-d1)*impixmax, 256,256 )
      ;  tmp(256:511,*) = congrid((impix-model+0.5*impixmax), 256,256 )
        tvframe, tmp, /asp

  • added lines to lbcfpia_WRS.pro to subtract the defocus that would be expected given the displacement of M1 needed to give the pupil image (CurrentFocus from the header value FOCUSOFF).
  • Scaling between z4[nm] and Z[mm] is: 1000 nm delta_z4 per 0.0379 mm delta_Z
  • Note, the z4 computed by WRS is ~20mic = 20,000 nm = 0.758 mm, and the displacement of M1 is -0.8 mm (or -0.055)
 ; added on 13 June 2014 JH OK
deltaZ4 = CurrentFocus * (1000 / 0.0379) ; converts focus offset of primary (mm) to deltaz4(nm)
res(3) = deltaZ4 + res(3) ; res(3) around 20, addition of deltaZ4 (negative number) should result in zero.
During on-sky testing (UT date 20140614), we found that z2 and z3 (tip and tilt) were being sent.

Edited WRS.par to set a2 and a3 to 0.

Twice I've noted the output "File probably incomplete: /newdata/lbcr.20140614.063438.fits" --- old dofpia had a "wait" in there.

This is OK - we did hit the "wait" problem when it took LBC a long time to obtain the data due to flushing.

Running on a field with 2 saturated stars and the remainder too faint (lbcr.20140614.063438.fits).

It seems that when WRS exits because it finds no pupils, it does not backout the z4 and z11 that were sent.

  • tried dofpia on this field. It did not work because coma was too large.
    But when we added +2000 Z8 manually, it would run and detect pupils. I think that dofpia uses the peak pixel whereas WRS uses the mean count level across the pupil - both relative to the mode(sky)

See, e.g. 2014064549 and previous image.
  • edited 1.1 to be 0.7 in findpup.pro
;if pupil_mean_signal/std lt 1.1 then begin
if pupil_mean_signal/std lt 0.7 then begin ; edited for full moon testing opk

Twice I've noted the output "File probably incomplete: /newdata/lbcr.20140614.063438.fits" --- but we also saw the "wait", so that part of the code is copied over. See 080419 --- in a crowded field, an isolated pupil was not chosen. (changed pupil_mean_signal/std back to 0.7). Around 08:20 UT, dowrs iterated 4 times on a field (same crowded field).

It chose two pupils near to one another, and, while it at first was doing OK, at the 3rd or 4th iteration, it fit both pupils at once and added significant astigmatism. 08:25 UT --- cleared active optics on DX and rerun dowrs.

Needed to cut out the cluster center, so edited ob to use rows 3901 to 4608 instead of 3201 to 4608.

Now, selected an isolated pupil (084242), but pupils were too small.

Cleared active optics again. lbcr.20140614.084706 is the first pupil image after that.

We've had this issue several times - after exiting via cnt-C, the file does not close.

2014-06-14
Processing: /newdata/lbcr.20140614.084706.fits
% OPENW: File unit is already open. Unit: 33, File: WRS_report.dat.
% Execution halted at: READPAR            12 /home/lbceng/WRS/src/WRS_LIB.pro 

Between 091637 and 092037, John cleared active optics. Prior to that, the dowrs was building up a lot of trefoil. 
Sent preset during 092258 (not very easily detected). 
Again shooting off a bit. A
 lot of trefoil build up: ~1800 mic trefoil (z9,z10) around 092258.
 09:28 Clearing active optics, and running dowrs again, this time with smaller pupils (FOCUS OFFSET is -0.5 instead of -0.64 mm)... No - didn't exit IDL 09:33. 
Now running dowrs with smaller pupils... this took some tries. 
John created R_r40extra.ob 09:49 Clearing active optics. 
Running dowrs... 095001 ... 095220. These pupils are smaller. 

* Problem with coma rotation 
* Problem with focus estimate 
09:55 Clearing active optics. Running dowrs again on the same field... sent preset... 
09:58 Now on a nearby field. The pupil is not well centered in the box - it appears that the centering is based on the brightest region, but not on the overall pupil.
10:34 Cleared active optics and restarted WRS. 103424... 10:42 Set WRS.par a9:0 and a10:0. Cleared active optics and restarted WRS: 104717... not converging. --- 

20140609 UT

  • John has renamed the WRS version of DOFPIA to "DOWRS". The old DOFPIA_WRS still exists and gives you WRS with FPIA-sized pupils (64 pixels).
  • John has created OBs to make smaller (52 pixel) pupils for the WRS.
    /home/lbceng/WRS/src :
    -rwxr-xr-x. 1 lbceng domain users 4375 May 14 03:57 B_V52extra.ob
    -rwxr-xr-x. 1 lbceng domain users 4375 Feb 18  2011 B_Vfastextra.ob
    -rwxr-xr-x. 1 lbceng domain users 4377 May 14 03:54 RB_rV52extra.ob
    -rwxr-xr-x. 1 lbceng domain users 4377 Feb 18  2011 RB_rVfastextra.ob
    -rwxr-xr-x. 1 lbceng domain users 4375 May 14 03:56 R_r52extra.ob
    -rwxr-xr-x. 1 lbceng domain users 4375 Feb 18  2011 R_rfastextra.ob 
  • John has created Perl scripts that load the OBs with smaller pupils:
    /home/lbceng/WRS/src :
    -rwxr-xr-x. 1 lbceng domain users 556 Jun  9 23:16 load-ob52.pl
    -rwxr-xr-x. 1 lbceng domain users 554 Jun  9 23:16 load-ob52-blue.pl
    -rwxr-xr-x. 1 lbceng domain users 554 Jun  9 23:17 load-ob52-red.pl

20140514 UT

We have installed the updated version v0.9?.2 from Marco:
after the testing during the engineering night, I have deeply investigated these kind of problems through the images provided and the simulations. As you say, the problem arises when one tries to correct a large coma and the central obscuration is not completely visible, or part of the pupil blends into the background. However, in the last days I have implemented some improvement to WRS that now allows the code to estimate the aberrations without requiring the operator to manually enter some coefficient. In the attached image you can see how the code now can reproduce the pupil observed by Kellee overcoming the issues found during the testing. In particular, these are the changes implemented: - coma estimation using adaptive thresholds and working with large starting aberrations. This makes possible to estimate coma even if pupils are not fully visible. - coma estimation added in the fast mode. Now we can estimate from z4 to z8 in less than 2 seconds. - if WRS detects a large starting coma, at first it will automatically try to adjust it before estimating the others aberrations. Hopefully, this will avoid the manual input of some large z4 at the start-of-night. - some bugs fixed I also attach the last version of WRS implementing that. In order to see whether the new version can bring some improvement or not, it would be nice to try to send commands to the primary mirror and see if the pupil improves.

20140506
Tried on-sky with the first stars of the TCS 2014B build testing (20140506). Found a problem with the GETIMAGE function used - Marco's version is conflicting with another we are picking up. Renamed the WRS GETIMAGE function and it ran, but takes ... f - o - r - e - v - e - r! Marco fixed it in the 0.9.2 version. Olga's comments:
I looked at some of the images from that night and tried the WRS code on these. (I attach a jpg to show a red and blue pupil from that night). The red pupil images do have strong coma. Unfortunately, this is not that uncommon and, we think it is due to temperature gradients along the swing arms or structure. The current dofpia does not handle this. Sometimes the ellipse which should be fit around the pupil is fit, instead, around the bright spot and is, therefore, too small, and other times illumination gradient is so great that, I think, the the opposite side blends into the background and the estimated pupil diameter is so large that the pupil is rejected (as below... 3000 pixels instead of ~62!) . In these cases, the operator or observers need to manually enter ~ +/-2000 nm Z7 or Z8 (or a combination of these), and, only after this, dofpia will work on the pupils. Running dofpia off-line (so just using the lbcfpia procedure) one of the red pupil images from 20140506, failed with:
IDL> lbcfpia, file="lbcr.20140506.025722.fits",datadir="/Repository/20140506/",/red,/dontsend,cfg=cfg
2014-05-13
Processing: /Repository/20140506//lbcr.20140506.025722.fits
Searching for pupils...
Computing aberrations using 2 pupils
Focus Offset = -0.80000001  Filter = r-SLOAN
BlueZ22Zero:   1.600
RedZ22Zero:   1.650
Not enough points for estimating Z22
Rejected pupil 0 with diameter 1632.39
Not enough points for estimating Z22
Rejected pupil 1 with diameter 3040.43
% Compiled module: ERRORLOG.
----------------------------------------------------
     Failed to compute aberration coefficients!
----------------------------------------------------
% Program caused arithmetic error: Floating divide by 0
IDL>

Work being done to correct this strong coma, which is usually only seen at the start-of-night, involves 1/ placement of temperature sensors along the swing arm to see whether it arises from thermal gradients along this structure (already there are some sensors along the telescope C-ring and mirror cell) and 2/ using a laser tracker to collimate the optics well enough that the pupils will be within the "keyhole" for fitting by dofpia. But I expect it will be some time before either of these corrects the start-of-night coma --- in the first case, the data will have to be collected from these sensors for a range of temperatures/conditions and analyzed. Large coma at the start of the night is one situation that is difficult for dofpia. Another one is strong spherical aberration: Z11 or Z22. This tends to arise when there is a temperature gradient across the primary. dofpia can have troubles discerning the inner hole and, in extreme cases when there is negative Z22 causing a central peak, the ellpise is fit around the central bright spot, grossly underestimating the pupil diameter. One relatively recent night with strong (but not extreme) Z11/Z22 was an INAF night, 20140328 (see attached FPIA log files). I have forgotten which two nights of pupil data you have from Fernando - is 20140328 one for which you have the data, and can you retrieve these pupil images - all have partner set to CALIBRATION in the archive - if needed ? cheers, Olga
Topic revision: r41 - 25 May 2018, JohnHill
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