lmap_solutions

Use an lmap.RESULTS files (made from running lmap) to derive the XY transformations needed to convert XY_LRS2 to XY_acm. The results, if approved by the user, are archived in a local archive directory. The important files (to be used by lmap after they are copied manually to $LRS2DAT/xytrans) will be:

 
 
  trs.LRS2_to_ACAM_R    =  converts X,Y in LRS2-R to X,Y on acm 
  trs.LRS2_to_ACAM_B    =  converts X,Y in LRS2-B to X,Y on acm 
 

Since everything stars with the lmap.RESULTS file, I show one below. This is from a single night (20171009) of engineering work done after maintenance of the IHMP in early Oct2017.

% 
% lmap  
# TABLE entries from the lmap code.
# Col01: X from lrs2 map in pixels
# Col02: Y from lrs2 map in pixels
# Col03: X from acam in pixels
# Col04: Y from acam in pixels
# Col05: X from lrs2 map in arcseconds
# Col06: Y from lrs2 map in arcseconds
# Col07: lrs2 obs number
# Col08: lrs2 exp number
# Col09: lrs2 channel
# Col10: date string (yyyymmdd)
# Col11: acam image base name
# Xlrs2   Ylrs2     Xacm    Yacm    Xlarc   Ylarc    obs exp ch    Date           acm_image 
# data
 540.42  250.14    745.47  582.02   0.4192 -0.0864   010  01  rd  20171009    20171009T052907.2_acm_sci.fits 
 533.57  238.15    743.50  581.98   0.3182 -0.2633   011  01  rd  20171009    20171009T054059.3_acm_sci.fits 
 516.43  251.86    746.02  582.17   0.0653 -0.0611   012  01  rd  20171009    20171009T054800.7_acm_sci.fits 
 794.10  378.70    751.17  596.44   4.1610  1.8098   013  01  rd  20171009    20171009T060318.5_acm_sci.fits 
 237.04  400.98    752.23  564.91  -4.0557  2.1385   015  01  rd  20171009    20171009T061003.4_acm_sci.fits 
 230.18  150.73    738.30  565.49  -4.1568 -1.5527   016  01  rd  20171009    20171009T061841.2_acm_sci.fits 
 692.97  118.16    737.03  590.47   2.6693 -2.0331   017  01  rd  20171009    20171009T062609.6_acm_sci.fits 
 572.99  356.42    748.80  584.73   0.8996  1.4812   018  01  rd  20171009    20171009T063212.7_acm_sci.fits 
 470.15  231.29    741.66  210.74  -0.6173 -0.3645   019  01  or  20171009    20171009T065116.5_acm_sci.fits 
 490.72  257.00    741.24  212.15  -0.3139  0.0148   020  01  or  20171009    20171009T065813.5_acm_sci.fits 
 794.10  352.99    747.43  228.19   4.1610  1.4306   021  01  or  20171009    20171009T070730.8_acm_sci.fits 
 334.74  363.27    747.43  203.24  -2.6146  1.5822   022  01  or  20171009    20171009T071331.7_acm_sci.fits 
 322.74  123.30    734.53  201.64  -2.7916 -1.9573   023  01  or  20171009    20171009T072023.5_acm_sci.fits 
 794.10  186.72    735.65  225.79   4.1610 -1.0219   024  01  or  20171009    20171009T072717.7_acm_sci.fits 
 459.86  246.72    740.86  209.67  -0.7691 -0.1369   025  01  or  20171009    20171009T073359.8_acm_sci.fits 
 492.43  253.57    743.83  578.53  -0.2887 -0.0358   026  01  rd  20171009    20171009T095112.9_acm_sci.fits 
 537.00  258.71    740.64  212.84   0.3688  0.0400   027  01  or  20171009    20171009T101601.0_acm_sci.fits 
 

The file above is for one night because I wanted to show a complete, but small, file. However, I usually combine files from multiple nights. The point of lmap_solutions is having a tool that lets you select data for the IFU (R,B) and data interval that you want for a run. To get more information:


% lmap_solutions --help 
lmap_solutions:
  Use an lmap.RESULTS file to derive the transformation parameters 
needed to map LRS2 to acm cooridinates. 

Usage: lmap_solutions lmap.RESULTS_apr-jun_2017 rd 20170101 20170520 Jun28
arg1 = lamp data file name (usually lmap.RESULTS) 
arg2 = channel (uv,or,rd,fr) 
arg3 = date1 (can be none) 
arg4 = date2 (can be none) 
arg5 = Name of archive directory to staore results 

The code will give some information about about two fits: 
    LRS2 to acm   and    acm to LRS2 

IFor each fit you are shown the original coordinates and the the 
transformed coordintaes. For intance, in the LRS2_to_ACM fit you 
will see the X,Y locations of the points in the original acm frame 
plotted as small blue squares. Also, you are shown the X,Y positions 
of the LRS2 frame measurements transformed to the acm system plotted as 
larger red quares. These should all line up in the case of a good solution. 

To have a solution archived, make a hard copy of the show() plot with the 
default name. After both solutions are accepted you will see a subdirectory 
(with the name specified by arg5) that looks like: 
RED_20171008_20171010_ACAM_to_LRS2.png			 trs.ACAM_to_LRS2_R
RED_20171008_20171010_Final_Residuals.List_ACAM_to_LRS2  trs.ACAM_to_LRS2_RED_20171008_20171010
RED_20171008_20171010_Final_Residuals.List_LRS2_to_ACAM  trs.LRS2_to_ACAM_R
RED_20171008_20171010_LRS2_to_ACM.png			 trs.LRS2_to_ACAM_RED_20171008_20171010

The png files show the coordinates plots. The "Final_Residuals.List" files list 
all points  and their residuals. The solution files are printed with two 
different names: 
  trs.ACAM_to_LRS2_RED_20171008_20171010:
     The trs solution showing the IFU channel (RED) and the date 
     range used. 
  trs.ACAM_to_LRS2_R:
     The same file, but with a standard name that can be retrieved 
     by lmap. This is the file you will copy to $LRS2DAT/xytrans. 

Note that there is no autometaed transferal of the solutions file (e.g. trs.ACAM_to_LRS2_R) to $LRS2DAT/xytrans. This is still done manually after the user (always sco) is satisifed with the solutions.

You can pull a complete set of test data for Oct2017 HERE and use it to make test runs of lmap_solutions.




Back to SCO CODES page