lrs2_acam_xy

A routine for transorming between X,Y coordinates measured on the ACAM and the LRS2 images from lmap. You can go from ACAM to LRS2 or LRs2 to ACAM. Both the LRS2 channels, B and R, are supported. As of Aug8,2016, this routine supports two methods of coordinate transformations (coefs = uses two independent linear equations, trs = translation, rotation, and scaling).

% 
% lrs2_acam_xy 
Usage: lrs2_acam_xy file.xy trs LRS2 ACAM B  
arg1 = file with simple X,Y values
arg2 = transformation file type (coefs,trs) 
arg3 = name of system transforming from (LRS2,ACAM)
arg4 = name of system transforming to (LRS2,ACAM)
arg5 = name of LRS2 channel being used (R,B) 

A typical XY file might look like: 
% cat xy.lrs2
# XY LRS2-R 
# data 
  -2.001133 -3.227448  
  -0.237180 -1.144305 
   2.920943 -1.446680
   0.098678 0.485128   
   0.619500 1.627367  
   0.283495 -2.437880
  -3.328190 1.997003 

The output (to standard out) might look like: 
% lrs2_acam_xy xy.lrs2 trs LRS2 ACAM R
719.088	545.778
727.338	551.607
727.239	563.343
733.450	552.320
737.827	553.871
722.737	553.944
737.918	539.202

 
Note that at this time, the input XY files have different formats for the "coefs" and the "trs" methods. A trs approach will require the XY file to have a header delimited by a "# data" line. The coefs approch simply takes two raw columns of numbers. I have considered adding headers to the coefs-related methods, but these routines are buried ina lot of different scripts that are actively being used in HET obaserving. I have elected to leave this source code alone for now.

As an aside, but relevant here, we might want to compare these coordinates with another file of LRS2 positions (XY.lrs2_B). Here is a quick way to do it:



NOTE: We must have two XY files with NO HEADERS. 

% cat xy.1  
719.088	545.778
727.338	551.607
727.239	563.343
733.450	552.320
737.827	553.871
722.737	553.944
737.918	539.202

% cat xy.2 
 720.57 545.90  
 727.34 552.20 
 727.68 563.33   
 733.45 552.32   
 738.76 554.00   
 721.35 555.98   
 736.41 539.27   


%  xy_tranrot_res.sh xy.1 xy.2  
       1.115        0.742        7

These quantities are the standard deviations in X, and Y, and the number of points compared. 

A very useful file from this last run is: 
% cat xy_tranrot_res.resids_list 

# List of XY residuals from xy_tranrot_res.sh
  line       X1        Y1           X2        Y2           dX        dY          Res       Res_norm
    1     719.088   545.778      720.570   545.900       -1.482    -0.122        1.487      1.1103
    2     727.338   551.607      727.340   552.200       -0.002    -0.593        0.593      0.4428
    3     727.239   563.343      727.680   563.330       -0.441     0.013        0.441      0.3294
    4     733.450   552.320      733.450   552.320        0.000     0.000        0.000      0.0000
    5     737.827   553.871      738.760   554.000       -0.933    -0.129        0.942      0.7033
    6     722.737   553.944      721.350   555.980        1.387    -2.036        2.464      1.8395
    7     737.918   539.202      736.410   539.270        1.508    -0.068        1.510      1.1272
   

We can use the last file above to identify problematic points.




Back to SCO CODES page