! ! Open the file ! if (HFILE_NAME.ne."not yet defined") then on error FILE BO "!"'HFILE_NAME' FILE BO 'HFILE_NAME' on error if hold_file.ne.HFILE_NAME then if exist(RF_USB) then DELETE /VARIABLE RF_USB RF_LSB endif if exist(amp_err) then DELETE /VARIABLE AMP_ERR endif if exist(pha_err) then DELETE /VARIABLE PHA_ERR endif endif LET hOLD_FILE 'HFILE_NAME' else SAY "E-HOLO_SELECT, Please define the file name (Press FILE)" return endif SET TIME * ! ! 1.2 Define additional parameters ! SIC PREC DOUBLE ! ! Reset CLIC defaults ! SET DEFAULT set flux all /reset set quality 'hmin_qual' set level 6 set receiver hrec set phase internal SET PHAS BASE ABS SET RF BASE OFF SET AMPL BASE ABS SET PHAS CONT SET PLOT BAR ! IF (.NOT.EXIST(SCAN)) THEN VARIABLE GENERAL ON ENDIF IF (.NOT.EXIST(NBAS)) THEN VARIABLE CONFIG ON ENDIF IF (.NOT.EXIST(IN_FILE)) THEN VARIABLE READ_WRITE ON ENDIF IF (.NOT.EXIST(N_LINE_BANDS)) THEN VAR LINE ON ENDIF IF (.NOT.EXIST(FLUX)) THEN VAR POSITION ON ENDIF IF (.NOT.EXIST(ISB)) THEN VAR RF ON ENDIF IF (.NOT.EXIST(GAIN_IMAGE)) THEN VAR ATM ON ENDIF IF (.NOT.EXIST(dh_offlam)) THEN VAR data_header ON ENDIF IF (EXIST(CAL_BAND)) THEN del /var CAL_BAND BAND_SOURCE b_flux endif DEFINE CHARACTER CAL_BAND*3 BAND_SOURCE*12 /GLOBAL define double b_flux /global ! SET AVER SCAN ! ! 2 --- Define the subbands ! SET SCAN hSCAN[1] hSCAN[2] FIND GET FIRST SET BASE ALL set sub all if .not.exist(rf_usb) then DEFINE REAL RF_USB[2,NBAS] RF_LSB[2,NBAS] /GLOBAL endif if .not.exist(amp_err) then DEFINE REAL AMP_ERR[NBAS] /GLOBAL endif if .not.exist(PHA_ERR) then define real PHA_ERR[NBAS] /GLOBAL endif ! ! 4 --- Find the bandpass calibrator ! say " " FIND /SOURCE * /TYPE P /PROC CORR if (found.eq.0) then FIND /SOURCE * /TYPE * /PROC CORR endif LIST /SOURCE if n_source.le.0 then say "No calibrators" return endif LET B_FLUX 0 FOR I 1 TO N_SOURCE FIND /SOURCE 'C_SOURCE[I]' /PROC CORR GET FIRST SAY "Source " 'I' 'SOURCE' " Flux " 'FLUX' " Jy" - /format a i2 a12 a f6.2 a IF (flux.GT.B_FLUX) THEN LET BAND_SOURCE 'C_SOURCE[I]' LET B_FLUX flux ENDIF NEXT SAY " " SAY "Found Bandpass Calibrator "'BAND_SOURCE' ! DEFINE REAL A FIND /SOURCE 'band_source' /PROC CORR get f let a 10. for i 1 to nant let a min(a,gain_image[i]) next IF (A.LT.0.2) THEN IF (ISB.EQ.-1) THEN ! Signal == LSB LET CAL_BAND LSB ELSE LET CAL_BAND USB ENDIF ELSE LET CAL_BAND DSB ENDIF SAY " " SAY 'CAL_BAND'" tuning " ! ! Find first and last scan for Phase calibration ! if .not.exist(first_scan) then define integer first_scan last_scan /global endif find /proc holo ! !get first ! !def integer nmob j !def real bmin[nant] bmax[nant] imob[nant] smin[nant] smax[nant] ! !Say "Scanned Antenna(s) :" !for i 1 to nant ! if ((dh_offbet[i].ne.0).or.(dh_offlam[i].ne.0)) then ! Say " "'phys_ant[i]'" (Logical "'i'")" !! endif !next ! get cx_num[1] let i1 scan /new integer get cx_num[found] let i2 scan /new integer ! if scan 1 in range: if i2-i1.gt.9000 then fin /proc holo /scan 5000 10000 get cx_num[1] let i2 scan fin /proc holo /scan 1 5000 get cx_num[found] let i1 scan endif fin /proc corr /scan mod(i1-20-1,10000)+1 i1 if found.ne.0 then get cx_num[found] let first_scan scan else let first_scan i1 endif fin /proc corr /scan i2 mod(i2+20-1,10000)+1 if found.ne.0 then get cx_num[1] let last_scan scan else let last_scan i2 endif say "Scan range: "'first_scan'" to "'last_scan' ! ! Decide on the subb range : all or only the narrows (masers) ! if .not.exist(sub_chain) then def character sub_chain*80 /global endif if .not.exist(n_sub_bands) then variables continuum endif def real mwidth if hmode.eq.1 then let mwidth 180. else let mwidth 20. endif fin /proc corr /scan 'first_scan' 'last_scan' get first let sub_chain "ALL" for i 1 to n_sub_bands if cfwid[i].le.mwidth then if sub_chain.eq."ALL" then let sub_chain "C0"'i' else let sub_chain 'sub_chain'" and C0"'i' endif endif next Say "Subbands used : "'sub_chain' ! ! find /proc corr holo /scan 'first_scan' 'last_scan' ! ! Now check which antenna moved in that scan range: ! get first set antenna all set x scan set y beta ! def integer nmob j def real bmin[nant] bmax[nant] imob[nant] smin[nant] smax[nant] ! set lev 6 set aver time 10 set antenna all plot /nodra let nmob 0 for i 1 to nant def real wy /like y_data[i] let wy y_data[i]*w_data[i] compute bmin[i] min wy compute bmax[i] max wy del /var wy if bmin[i].ne.bmax[i] then let nmob nmob+1 let imob[nmob] i endif next if nmob.eq.0 then say "No antenna was scanned." return else if nmob.ne.1 then say 'nmob'" antennas were scanned.:" for i 1 to nmob let j imob[i] say "Antenna "'phys_ant[j]'" (Logical "'j'")" next else let j imob[1] say "Antenna "'phys_ant[j]'" (Logical "'j'") was scanned." let hcant 'j' endif ! ! Plot lambda beta vs time ! symbol ss 'hcant' set antenna 'ss' del /symbol ss set x time set y lambda beta find /proc holo /scan 'first_scan' 'last_scan' set plot points plot