PointingFit
fit_pointing(Double hpbw, Double bg_flux, listof TrialPosition trials)
Fit a guassian beam to the fluxes and offsets of a list of trial pointings.
Double hpbw
Double bg_flux
listof TrialPosition trials
# Set up a list of trial offset positions, with initially zeroed fluxes
listof TrialPosition trials = {
{-0:1:0, 0, 0}, # A -1 arcminute position offset
{ 0:0:0, 0, 0}, # A 0 arcminute position offset
{+0:1:0, 0, 0} # A +1 arcminute position offset
}
# Start moving to a suitable point source.
track saturn
# Measure a flux a degree off source in azimuth, to estimate the
# background flux.
offset x=-1.0 # Move to the offset position.
until $acquired(source) # Wait to acquire the source.
request_flux kuband, ant, 0:0:10 # Ask for a 10s integrated flux.
until $acquired(flux) # Wait for the flux to be returned.
Double bg_flux = $requested_flux().flux # Record the background flux.
# Measure the flux at each of the above trial offsets from Saturn.
foreach(TrialPosition p) $trials {
offset x=$p.offset # Move to the latest offset position.
until $acquired(source) # Wait to acquire the source.
request_flux kuband, ant, 0:0:10 # Ask for a 10s integrated flux.
until $acquired(flux) # Wait for the flux to be returned.
p.flux = $requested_flux().flux # Record the flux in the list.
p.sdev = $requested_flux().sdev # Record the uncertainty in the list.
}
# Attempt to fit a gaussian beam to the above offset fluxes.
PointingFit fit = $fit_pointing(0:2:6, $bg_flux, $trials)
# Display the results.
print "Fit: good=", $fit.ok, " x=", $fit.offset, " flux=", $fit.flux
fit_pointing, one could also do place the
pointing measurements in separate TrialPosition variables, and
assemble them into a list on the fly, like:
PointingFit fit = $fit_pointing(0:2:6, $bg_flux, {$left, $middle, $right})
Note that in this example, left, middle
and right are the individual TrialPosition
variables.