; mir2018.raw is located in /sma/SMAusers/cqi/mir2018 on CF machines mir_restore,'mir2018.raw' select,/p,/re plot_continuum result=dat_filter(s_f,'"integ" lt "10"',/reset) flag,/flag select,/p,/re,source='3c84',sideband='u' plot_spectra,ntrim=1000,color='band' ; s2, s3 spike select,/p,/re uti_checkspike,source='3c84',/baseline,ntrim=1000 select,/p,/re uti_checkspike,source='05',/baseline,ntrim=1000 ;Spike found in RX 240, Sideband U, Band s2, Baseline 3-8,Channel 8192 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-2,Channel 4740 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-2,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-3,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-3,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-5,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-8,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-8,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-8,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-3,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-3,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-4,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-4,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-4,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-5,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-8,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-4,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-4,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3957 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3958 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3963 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3964 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3963 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-8,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3958 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3963 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-8,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 6-8,Channel 3961 select,/p,/re uti_checkspike,source='04',/baseline,ntrim=1000 ;Spike found in RX 240, Sideband U, Band s2, Baseline 3-5,Channel 12095 ;Spike found in RX 240, Sideband U, Band s2, Baseline 3-8,Channel 8192 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-2,Channel 4740 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-2,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-3,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-3,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-4,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-5,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-8,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-8,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-8,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-3,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-3,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-4,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-4,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-5,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-8,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 2-8,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-4,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-4,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-4,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-4,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-5,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 3-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3957 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3958 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3963 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 3964 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 4741 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-5,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3958 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 3963 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 4-8,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3959 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3961 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3962 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 3963 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-6,Channel 5521 ;Spike found in RX 240, Sideband U, Band s3, Baseline 5-8,Channel 3960 ;Spike found in RX 240, Sideband U, Band s3, Baseline 6-8,Channel 5521 select,band='s2',/reset uti_chanfix,chan=8192,sample=3 select,band='s3',/reset uti_chanfix,chan=[4740,4741,5521,5522],sample=5 select,band='s3',/reset for i=3953,3968 do uti_chanfix,chan=i,sample=20 select,/p,/re uti_checkspike,source='04',/baseline,ntrim=1000 ;Spike found in RX 240, Sideband U, Band s2, Baseline 3-5,Channel 12095 ;Spike found in RX 240, Sideband U, Band s3, Baseline 1-2,Channel 4742 uti_checkspike,source='05',/baseline,ntrim=1000 select,/p,/re uti_checkspike,source='04',/baseline,ntrim=1000,/fix select,baseline='4-6',band='s3',/p,/re uti_chanfix,chan=12152 select,/p,/re uti_avgband select,/p,/re uti_tsys_fix, high=500,loose=100,/refit select,/re tsys_ant tsys_replace ;x=3 ;y=6 tsys_bsl select,/p,/re apply_tsys select,/p,/re mir_save,'mir2018.cal' select,/p,/re,source='uranus',band='s2',ant=-5 plot_spectra,ntrim=1200,preavg=128,frame_v='rec',color='blcd',/norm ; pass cal select,/p,/re pass_cal,cal_type='pha',preavg=32, smoothing=1,ntrim=1024,tel_bsl='telescope',refant=4 ; 3c84 yes ; 3c279 yes ; uranus yes select,/p,/re uti_avgband select,/p,/re pass_cal,cal_type='amp',preavg=32, smoothing=1,ntrim=1024,tel_bsl='telescope',refant=4 ; select,/p,/re mir_save,'mir2018.cal2' ; This will be restored before the gain calibration ; flux measurement select,/p,/re, band='c1' gain_cal,cal_type='pha',/connect,tel_bsl='telescope',refant=4,/non_point ; all yes select,/p,/re,band='c1' gain_cal,cal_type='amp',x='hours',poly=0,tel_bsl='telescope',refant=4,/preavg,/non_point ; all no ; uranus yes select,/p,/re,band='c1' flux_measure ;# Source Flags Nscans Flux(Jy) SNR meantime REAL IMAG ; 0449+113 126 0.3789 191 8.02 0.3789 0.0001 ; 0510+180 81 1.4392 364 8.07 1.4392 0.0001 ; 3c84 14 8.2962 477 7.94 8.2962 -0.0036 ; 3c279 98 7.1218 345 13.18 7.1218 -0.0019 select,/p,/re,band='c1' result=dat_filter(s_f,'"el" ge "40" and "el" le "50"') flux_measure ; 0449+113 12 0.4046 62 6.86 0.4046 -0.0031 ; 0510+180 8 1.4210 159 8.24 1.4210 -0.0013 ; 3c279 62 7.1190 272 13.33 7.1190 -0.0045 ; gain cal mir_restore,'mir2018.cal2' ; Restore the dataset saved after bandpass calibration. select,/p,/re gain_cal,cal_type='pha', x='hours',smoothing=0.3,/preavg,tel_bsl='telescope',refant=4 ; 0510+180 yes 1.42 ; 0449+113 yes 0.40 gain_cal,cal_type='amp',x='hours',smoothing=0.6,/preavg,tel_bsl='telescope',refant=4 select,/p,/re autofits,source='xxx' ; xxx is your target source