! Procedure reduce.nic ! ! Fast reduction of several types of scans : ! - ON-THE-FLY ! - ONOFF ! - FOCUS ! - POINTING ! ! define character file*5 got*1 define real max_rms sig1 sig2 let file "s&1" if (file.ne."s") then symbol number &1 else symbol number /inquire "Scan number to reduce : " endif find /scan 'number' 'number' /file delete.me if (found.eq.0) then say "Scan is not available..." del /sym number return endif ! @ p_signal 'number' ! read and display data if (scan_type.lt.3) then ! ! Despiking and calibrating the signal ! say " " symbol answer "Y" symbol answer /inquire "Despiking requested ? (Yes) : " let got 'answer' if got.eq."Y" then despike /iter 3 /interp @ p_signal symbol answer "N" symbol answer /inquire "Any spike left ? (No) : " let got 'answer' if got.eq."Y" then say "Please flag manually with command DESPIKE" say " ... and type CONTINUE to proceed" say " " pause endif endif endif ! if (scan_type.ne.3) then ! only if scan_type different from SKYDIP !!! compute sig1 mean signal[1] set opacity on compute sig2 mean signal[1] if sig1.eq.sig2 then var flag wr let opacity_flag .false. var flag say " " say "No zenith opacity available for this scan" symbol answer "Y" symbol answer /inquire "Atmospheric opacity correction ? (Yes) : " let got 'answer' if got.eq."Y" then symbol answer /inquire "Enter zenith opacity : " set opacity on 'answer' else say "Proceeding with uncorrected data ..." endif endif if (counts_per_jy.eq.0) then say " " symbol answer "Y" symbol answer /inquire "(Counts/Jy) factor available ? (Yes) : " let got 'answer' if got.eq."Y" then symbol answer /inquire "Calibration factor (counts/Jy) : " set jansky on 'answer' ! Calibration factor to physical map unit else say "Proceeding with uncalibrated data ..." endif else say "Using a Counts/Jy conversion factor of "'counts_per_jy' endif endif ! ! Special reduction according to type of scan ! if (scan_type.eq.1) then ! ONOFF let noise no say "Correlated noise removal is recommended only for point sources" symbol answer "'answer_noise'" if (answer_noise.eq."N") then symbol answer /inquire "Correlated noise removal ? (No) : " else symbol answer /inquire "Correlated noise removal ? (Yes) : " endif let answer_noise 'answer' if answer_noise.eq."Y" then let noise yes endif @ p_onoff @ p_signal ! else if (scan_type.eq.2) then ! ON-THE-FLY var * let smooth_el .true. say " " symbol answer "Y" symbol answer /inquire "Standard baseline removal ? (Yes) : " let got 'answer' if got.eq."Y" then symbol answer 'answer_order' symbol answer /inquire "Select polynomial order (/ORDER) ("'answer_order'") : " let answer_order 'answer' symbol answer "'answer_support'" if (answer_support.eq."Y") then symbol answer /inquire "Use default polynom (/SUPPORT) ? (Yes) : " else symbol answer /inquire "Use default polynom (/SUPPORT) ? (No) : " endif let answer_support 'answer' if answer_support.eq."Y" then support base /order answer_order else @ p_makplan base /order answer_order /curs endif else say "For a better baseline, just do it yourself !" say "...and type CONTINUE to proceed" say " " pause endif symbol answer "N" symbol answer /inquire "You want to omit some channel ? (No) : " let got 'answer' if got.eq."Y" then compute max_rms max chan_rms for i 1 to nchan if chan_rms[i].eq.max_rms then symbol answer "Y" symbol answer /inquire "You want to omit channel "'I'" ? (Yes) : " let got 'answer' if got.eq."Y" then flag /chan i else say "Type command FLAG /CHANNEL Chan to remove Chan" pause endif endif next flag endif symbol answer "'answer_noise'" if answer_noise.eq."N" then symbol answer /inquire "Correlated noise removal ? (No) : " else symbol answer /inquire "Correlated noise removal ? (Yes) : " endif let answer_noise 'answer' if answer_noise.eq."Y" then base /noise endif @ p_makplan @ p_map ! ! Restoring the double-beam maps ! say " " if beamsep.ne.0 then say "The chopper throw is set to "'beamsep'" arcsec" else say "The chopper throw is unknown" endif symbol answer /inquire "Give effective beam separation : " let beamsep 'answer' @ p_restore @ p_map ! ! Converting the multi-channel maps ! @ p_convert @ p_map ! else if (scan_type.eq.3) then ! SKYDIP solve ! else if (scan_type.eq.4) then ! POINTING solve ! else if (scan_type.eq.5) then ! FOCUS solve ! else if (scan_type.ge.6) then say 'Unknown type of scan' endif ! del /sym answer number