IF (OLD_FILE.NE.FILE_NAME) THEN SAY "Please use SELECT option before" RETURN ENDIF if do_atm then set phase atm else set phase noatm endif define integer ir define character psf*40 define real a ! ! 5 - Calibrate the RF for receiver irec ! for kr 1 to 2 let ir irec[kr] if irec[kr].gt.0 then set rece irec[kr] set phase internal FIND /PROC CORR /SOURCE 'BAND_SOURCE' if found.eq.0 then FIND /PROC CORR POIN FOCU /SOURCE 'BAND_SOURCE' endif SET GIBB 1 SET Y AMPLI PHASE get first /header if n_line_bands.gt.1 then set sub l01 to l0'n_line_bands' else set sub l01 endif Say "... Self-calibrating the phase to improve S /N ratio ..." store phase /self set phase antenna relative internal SET X I_F SET BIN 5 let a 0.001 for i 1 to nant let a max(a,gain_image[i]) next ! ! LSB if (cal_band[ir].eq."LSB").or.(a.gt.0.1) then SET BAND LSB if ir.eq.2 then SOLVE RF 6 12 /PLOT say "LSB Bandpass Calibration for receiver "'ir'":" say "Command was SOLVE RF 6 12 /PLOT" else if ir.eq.1 then SOLVE RF 6 18 /PLOT say "LSB Bandpass Calibration for receiver "'ir'":" say "Command was SOLVE RF 6 18 /PLOT" endif stop LET PSF 'short_file'"-rflsb-"'IR'".ps" SYS "rm "'psf' HARD 'psf' /DEV EPS color LET RF_LSB[ir] RMS_ERR ENDIF ! ! USB if (cal_band[ir].eq."USB").or.(a.gt.0.1) then SET BAND USB if ir.eq.2 then SOLVE RF 6 12 /PLOT say "USB Bandpass Calibration for receiver "'ir'":" say "Command was SOLVE RF 6 12 /PLOT" else if ir.eq.1 then SOLVE RF 6 18 /PLOT say "USB Bandpass Calibration for receiver "'ir'":" say "Command was SOLVE RF 6 18 /PLOT" endif stop LET PSF 'short_file'"-rfusb-"'IR'".ps" SYS "rm "'psf' HARD 'psf' /DEV EPS color LET RF_USB[ir] RMS_ERR ENDIF set phase absolute say "... Storing the RF calibration for Receiver "'ir'" ..." FIND /PROC CORR POIN FOCU FLUX /TYPE * STORE RF endif next ! @ x_calib_save