! ! Procedure SKYDIP.NIC ! ! This procedure calculates the atmospheric opacity for multibeam ! bolometer observations. ! ! Normally channel 1 is used for the focus evaluation. ! var header define real airmass[nrecord] counts[nrecord] f_eff b_eff define real len fitx[300] fity[300] a b c d2 d3 e2 e3 define integer ic foc points[3] channel let channel 1 if ("&1A".ne."A") then if (&1.le.n_receivers.and.&1.ge.1) then let channel &1 else say "Number of channels is "'N_RECEIVERS' say "Skydip can not be done for channel "'&1' say "Opacity is calculated for channel 1" endif endif ! set /def cl al set box 4 20 4 16 set mar 20 3 0.1 set exp .8 let airmass 1|sin(el*pi|180) let counts abs(signal[channel]) lim /var airmass counts box label "Air mass" /x label "Countrate (Hz)" /y point airmass counts if (forward_eff.eq.0) then let f_eff .85 endif if (beam_eff.eq.0) then let b_eff .45 endif ! ! initialize values for fit ! let tau (counts[nrecord]-counts[1])|f_eff| pause let focus_pos[1] scan_coord[channel] for i 1 to nrecord let ic 1 let val1 scan_coord[i] let val2 focus_pos[ic] for /while (val1.ne.val2) let ic ic+1 if (focus_pos[ic].eq.0) then let focus_pos[ic] scan_coord[i] endif let val1 scan_coord[i] let val2 focus_pos[ic] next let focus_pos[ic] scan_coord[i] let counts[ic] counts[ic]+signal[i,channel] let points[ic] points[ic]+1 next let counts counts|points let d2 counts[1]-counts[2] let d3 counts[1]-counts[3] let e2 focus_pos[1]-focus_pos[2] let e3 focus_pos[1]-focus_pos[3] let e4 focus_pos[1]^2-focus_pos[2]^2 let e5 focus_pos[1]^2-focus_pos[3]^2 let a (d3*e2-d2*e3)|(e5*e2-e4*e3) let b (d2-a*e4)|e2 let c counts[2]-a*focus_pos[2]^2-b*focus_pos[2] let fitx[i] focus_pos[1]+(focus_pos[3]-focus_pos[1])*(i-1)|299 let fity a*fitx^2+b*fitx+c conn fitx fity let foc -nint(b|(2*a)) ! microns let len (user_ymax-user_ymin)|2 let val1 a*foc^2+b*foc+c if (a.lt.0) then draw tex foc 2*val1-user_ymax "\S{" 5 /user draw rel foc 2*val1-user_ymax /user draw lin foc 2*val1-user_ymax-len /user draw tex foc 1.99*val1-user_ymax-len "\\ISFCZ = "'FOC' 2 /user else draw tex foc 2*val1-user_ymin "\S}" 5 /user draw rel foc 2*val1-user_ymin /user draw lin foc 2*val1-user_ymin+len /user draw tex foc 2*val1-user_ymin+len "\\ISFCZ = "'FOC' 8 /user endif draw text .7 -.152 "\\ISCAN : "'SCAN_NUMBER' 6 /box 9 draw text .7 -.752 "\\ISOURCE : "'SOURCE_NAME' 6 /box 9 draw text .7 -1.352 "\\ICHANNEL : "'CHANNEL' 6 /box 9