12 meter pointing model
Last Update: 26oct21
History: (top)
 19jan15: had left off refraction correction (see main
history). corrected 19jan15
 27jan15: 17:00 model 2A installed.
 28jan15: 325 crosses on casA using model2A to check the model.
 feb16mar16: model3A made
 jul21 : switched to using regular mock
cross scans to make model
 sep21 : model 4A
The 12meter model:(top)
The 12meter controller has the ability to
evaluate a model every computational cycle (4 milliseconds). to do
this you:
 Use the model that is hard coded in the controller (defined by
mark goddard ..8 parameters)
 load the model parameters into the controller memory
 select the option for the controller to apply the refraction
and then model correction
 You supply a value for dut1 to the controller (ut1utc). The
controller then runs its system clock on ut1 (not utc).
 You need be sure and update dut1 whenever
needed.
 This ability is needed if you want to use the controller to
track in ra,dec (it does the conversion to az,el and then model
correction).
 The only problem here is that the controller does not do
precession or nutation, so you must provide ra,dec of Date.
AO only uses the controller in az,el tracking
mode. This allows us to:
 The model is evaluated in the computer. this gives more
flexibility in what kind of model we use.
 I'm using mark's model because it seems to work.
 We turn off the options for the controller to apply any
refraction or model corrections (it is done outside of the
controller).
 We can set dut1 to 0. in the controller (so it is
running on UTC)
 So all of the time stamps returned from the controller do
not need to be converted from ut1 to utc.
 the model values are added to the az,el computed by the
ra,dec to az,el conversions before being sent to the
controller.
 azenc=AzComputed + (azmodel)*gcToLittleCirle
 The model values are great circle errors...
 elenc = ElComputed + elmodel (including refraction)
The model parameters:
The model parameters were defined by mark
goddard. There are 8 parameters in the model.
When converting ra,dec to azEncoder,Elencoder (that is sent to the
controller):
 Convert ra,dec to az,el
 convert el > elRefract (apply the refraction
correction to the elevation)
 evaluate the model use az,elRefract > azModDelta,
elModDelta (these are great circle)
 The values to send to the 12meter are then
 azEncoder= Az + azModDelta/cos(elRefract) (to go
greatcircle to little circle)
 elEncoder = ElRefract + elModDelta
The AzModDelta,elModDelta are (the results are great circle)
Model parameters
azModDelta =

P1 + P2*cos(elR) + P3*sin(elR) +
P4*sin(elR)*cos(elR) + P5*(sin(elR)*sin(az)

elModDelta =

P4*sin(az) + P5*cos(az) + P7 +
P8*cos(elR) + P9*cot(elR)


Mark's description of the parameters (see
p102 of antenna controller operations and maintenance man.)

P1

azimuth collimation error

P2

azimuth encoder offset

P3

elevation axis skew angle

P4

phi * sin(Ka). phi=azimuth axis tilt angle
and Ka=azimuth angle defining the direction of the tilt.

P5

phi*cos(Ka)

P6

not used

P7

elevation encoder offset and collimation
error.

P8

gravitational deflection coef.

P9

Residual refraction coef.

Notes:
 P4 and P5 are common to the azimuth and elevation computation.
 P6 is not used
 azimuth axis tilt (phi) and direction (Ka) can be computed
from P4 and P5
 azTiltDirection(Ka) = atan(P4/P5) = atan(
(phi*sin(Ka))/(phi*cos(KA))*!radeg
 azTiltAngle(phi)
=P5/cos(Ka) = P4/sin(Ka)
 this should also be a consistency check.
Making the model: (top)
 Taking the data:
 Currently only xband is used to make the model since the rfi
from sband is saturating the system.
 Crosses are done while tracking continuum sources.
 A strip in azimuth followed by a strip in elevation
 spectral data is taken with the mock spectrometers during
each strip (1 scan/file per strip).
 The total power is computed throwing out band edges and rfi.
 7 172Mhz bands spanning 1 Ghz are taken during the
datataking and processing.
 Computing the offsets:
 For each cross a 2d gaussian is fit to the data giving beam
offsets for pointing errors (as well as bmwidth,amplitude,etc)
 Fitting the model:
 After tracking multiple source across the dish (doing
crosses), the measured offsets are then fit to the beam
model giving the 8 model parameters.
Taking the data: The crosses
A cross consists of a strip in azimuth through
the source followed by a strip in elevation through the source.
The mock spectrometer takes a scan of data during each
strip. The newer models are using xband.
The table shows the parameters used for the
crosses.
rcvr

bmWidth

stripLen

stripTm

bms/strip

smpRate

smp/Strip

smp/Bm

Notes

xb

10.Amin

120Amin

120sec

12

10hz

1200

100

mod4A sep21,nocal

 Mock setup:
 7 mocks used
 Each mock:
 172Mhz bw, 1024 freq channels, .1 sec sampling, 32 bit
spectra
 If/lo setup
 mock 172Mhz bw spaced by 142 Mhz in iflo (for overlap)
covering xb Rf: 8135 to 9159MHz (the downstairs IF has a 1 Ghz
filter).
 mock cfr:8221.00 8363.00 8505.00 8647.00 8789.00 8931.00
9073.00 MHz
 The udc lo is set to map the center of the mock bands
(8647MHz) to the center of the 12 GHz IF.
 The udc attn is set to 15,15 db (max)
 the software: basedir:/share/megs/phil/svn/aosoft/p12m/
 ./x101/ location to run on galfas2 tcl session
 contains the tcl scripts used for each days observation
 210909_cross.tcl for 9sep21
 setupcross.tcl  generic cross setup
 ./tcl/pnet/cross.proc  tcl cross procedure
 ./tcl/gen/ifsetup.proc  setup the if/lo
 ./tcl/pnt/pnt tcl interface to pointing.
 ./tcl/logfiles/user/.. user log files for a day (may
continue into next day if datataking crosses midnight)
 user_20210909.log .. has ra,dec, scan az,za and time
for az,el scans.
Computing the total power from
the spectra
The crosses are input using the idl routine
crossinp.pro. When computing the total power from the spectra:
 Each spectral band is 172Mhz wide. There are 7 bands recorded
covering the 1Ghz.
 By default 6% of the band is excluded on each side (where the
filter changes rapidly)
 the user can input frequency ranges that will be excluded when
computing the total power
 currently 8319 to 8349 Mhz is excluded because of recurrent
rfi. (see model/init.pro)
 the rms/mean by freq channel is used to further exclude rfi
 Only the azimuth strip is used (since the za strip has a
larger change in tsys)
 the first 400 spectra and the last 400 spectra of the strip
(1st 1/3 and last 1/3) are used. the middle 1/3 is
excluded so the source does not affect the rms/channel.
 the rms/mean by channel is then computed for the 800 spectra
and a linear fit is done to the rms. Any freq channels
with > 3sigma outliers are not included in the total power
computation.
 We end up with 1200 total power numbers per pol per freq band
per strip (there are 7 freq bands).
Fitting the 2d gaussians to
the total power crosses.
A 2d gaussian is fit to each cross to get the
measured pointing offset (as well as other info). The total power
from the two polarizations is combined prior to the fit.
The gauss fit is:
 There are 8 parameters. It includes a rotation of the gaussian
in case the beam is elliptical.
 a0  constant
 a1 : amplitude
 a2 : xoffset ,az coord direction
 a3 : yoffset ,el coord direction
 a4 : sigx^2 ,in prime coordinate system
 a5 : sigy^2 ,in prime coordinate system
 a6 : theta ,rotate unprimed to primed system so
xp,yp are aligned along ellipsoid of beam
 a7 : slope ,fit for slope of Y (usually el during
strip)
 z(x,y) = a0 + a1*exp[xp^2/sigxp^2  yp^2/sigyp^2]
 xm=(x  a[2]) . .remove x offset
 ym=(y  a[3]) .. remove y offset
 xp=xm*cos(th) + ym*sin(th)
 yp=xm*sin(th) + ym*cos(th) .. rotate to align xp,yp
with ellipse major,minor axis
 The processing is done in idl
 The 2d fitting routines:
 /share/megs/phil/svn/aosoft/p12m/pro
 gsfit2d_12m.pro
Fitting the model to the
pointing offsets:
The pointing model used for the 305meter had
separate parameters for the az and el (there were no shared
parameters). That made it easier to fit to the measured az and el
errors.
The 12meter model parameters P4 and P5 are
used in the az and the el error computation. I played around a
little trying to fit the 2 data sets (azerr,elerr) separately but
ended up fitting them both at once:
 modAz=P1 + p2*cos(elR) + P3*sin(elR) ....
 modEl =P4*sin(az) + P5*cos(az) .....
 fitFunct= (MeasuredAzErrAsec  modAz)^2 +
(MeasuredElErrAsec modEl)^2
 When calling the curvefit routine the expected value is 0. for
all crosses.
 Prior to calling the non linear curvefit routine, i do a
linear fit on the az and el errors separately (getting two
values for p4 and p5). I use the output of these fits as the
starting values for the nonlinear fit (averaging the two values
for p4 and p5).
 the current idl fitting routine is in p12mfitmoda.pro (a is
for all params at once).
Example session: (top)
Track 3C273 rise to set doing crosses
 connect to vnc session on galfas2
 cd /share/megs/phil/svn/aosoft/p12m/x101/
 If the tclsh session is not running:
 source startup.tcl .. to initialize
things
 the commands to execute are in 210908_cross.tcl
 you could just source this file , or copy and paste
executing 1 line at a time.
 I'll list the commands here:
 chknewday .. so log file names use current day.
 set source 3C461 ; will set variables
ra,dec
 source setupcross.tcl ; inits for cross.
 # spaced by 142 Mhz.
 setfreq m 8221.00 8363.00 8505.00 8647.00 8789.00
8931.00 9073.00
 #move off to adjust power
 pnt tr 90 75 cx
 pnt mode tr
 waittrk tmI 1
 # set power levels
 attn if2 5 8
 if2mp
 1 42.56 42.44 ;; reply
 mockadjpwr 30 reply
 b0s1g0 rms:A 30.5 29.0 B
29.5 30.9 mn:A 0.1
0.5 B 0.4 0.5 gn: 9
8
 b1s1g0 rms:A 29.4 27.4 B
26.6 26.4 mn:A 0.1
0.6 B 0.1 0.1 gn: 4
10
 b2s1g0 rms:A 29.7 29.7 B
30.4 28.2 mn:A 0.4
0.5 B 0.2 0.0 gn: 13 11
 b3s1g0 rms:A 29.8 29.2 B
25.1 26.1 mn:A 0.1 0.4
B 0.5 0.7 gn: 6
11
 b4s1g0 rms:A 32.1 29.8 B
28.8 28.3 mn:A 0.3
2.4 B 0.5 1.3 gn: 14 12
 b5s1g0 rms:A 25.9 25.6 B
26.9 26.7 mn:A 0.2
0.7 B 0.3 0.1 gn: 18 19
 b6s1g0 rms:A 31.7 28.0 B
31.1 31.1 mn:A 0.6 0.7
B 0.7 0.6 gn: 17 18
 set scram(source) $source .. so srcname ends up
in header
 pnt tr $ra $dec
.. track source ra,dec (variables set by srcget)
 pnt mode tr
.. goto tracking mode
 waitsecs 20
 pnt dbg gc 0 0
 set toloop 1440
,, set times to loop on crosses
 cross $ra $dec j $toloop ,,
execute the crosses.. will kick out when source sets.
 pnt mode pwroff
.. turn off the motors.
 monitoring the cross's with a stripchart recording in
idl. hitting the space bar will bring up a menu.
 idl
 @phil
 @masinit
 maxpnt=1200*4 ; max
points in window
 masmonstripch,bsg='b1s1g0',date=yyyymmdd,maxpnt=maxpnt
Fitting 2d gaussian to each cross and then computing the model.
 Note that each model will use a separate directory in
p12m/model
 you can copy the routines from model4A and update them.
 cd
/share/megs/phil/svn/aosoft/p12m/model/model4A/inpdat/210908_inp.pro
 idl
 .run ../init
 .run 210908_inp.pro
 .. this will input all the crosses taken on 210908
 It will remove rfi and the compute total power from each
spectra.
 A save file will be generated for each source with the total
power and location info for each cross.
 (eg inpdat/2109009_3C273.sav)
 when you've created all the save files with total power data,
you can fit 2d gaussians to all of the crosses.
 in model4A
 .run fit2dall
 this will generate the save file fitI2draw.sav .
 .run fit2dfilter
 The routine fit2dfilter will try and remove bad
crosses (rain, etc).
 And then compute the median values for each cross
(there are 7 crosses . one at each of the 7 freq bands).
 it will generate the array of structs fitIM[]
 .run plt2dfit
 plots the values, by running it multiple times you can
adjust the final clipping limits for which crosses to exclude.
 It generates fitIMclp[]
 .run computemodel
 plotmodelres,...
 this will plot the model residuals
 printmodfiti,.. this will print out the values for
the model
 you can enter these values in the model parameter file
 /share/megs/phil/svn/aosoft/p12m/etc/model12m
 > note that you will need to restart the p12mProg on
galfas2 since it loads the model parameters at startup
 Just kill it.. see /etc/rc.local for starting it.
 All of these routines are gathered in model4A/doall.pro
Disc locations: (top)
 base directory: base=/share/megs/phil/svn/aosoft/p12m
 idl routines:
 $base/pro/: some p12m idl routines
 /share/megs/phil/svn/idl/p12m .. generic p12m routines
 making a model
 $base/model/ : all models under this dir.
 $base/model/model4A/  model processing , general
 $base/model/model4A/inpdat  holds routines to input and
compute total power for each day.
 Pointing program source:
 $base/Prog/ : hold source code for pointing program:
p12mProg.c
 etc routines
 $base/etc/model12m  holds model
parameters
<
page
up
home_~phil
j