pro norp_rdt2data_80g,rdata,timejo,mvalid,fi,fv $ ,nocalib=nocalib,ndata=ndata,npa=npa,stat=stt0 ;+ ; NAME: ; NORP_RDT2DATA_80G ; ; PURPOSE: ; This procedure is for getting 80GHz data from the raw NoRP data ; ; CALLING SEQUENCE: ; norp_rdt2data_80g,rdata,mvalid,timejo,fi,fv ; ; INPUTS: ; rdata: structure of the raw data ; timejo: structure array with 'time internal format' ; that must be given by 'norp_rdt2timej'. ; ; OPTIONAL INPUT: ; ndata: 2-elements long-integer array indicating the ; position of data corresponding to the given timerange ; ; OUTPUTS: ; mvalid: byte array indicating the data is valid or not. ; e.g. if the data(123) obtained at time(123) ; was the calibration data mvalid(123)=0. ; If the data(124) was the real Sun flux mvalid(124)=1. ; fi: I (R+L) data array (mfreq,ndata) ; data(0,*) is the time-sequencial array of the 1st ; frequency which are read (indicated by 'rdfreq'). ; fv: V (R-L) data array (mfreq,ndata) ; ; OPTIONAL OUTPUT: ; ; HISTORY: ; programmed by T. Kosugi in 1984 May as Fortran program ; for old NoRP data format ; re-programmed by H.Sekiguchi 1987 July - 1988 Dec. ; ; 1995 July,20 N,Shinox for new format NoRP data ; 95.04.19 ed. add ATT correction for pol data ,correction data type ; changed intarr() to fltarr()., ; 95.09.04 Ver.2.0 M. Nishio and K. Hori ; 95.11.10 Ver.3.0 M. Nishio refernce level at 9.4GHz= amb -> zero ; <> ; 95.12.12 Ver.3.1 M. Nishio and K. Shibasaki (1GHz ATT 7dB -> 4.3) ; 98.08.25 Ver.0 S.Sekiguchi & Shinox ; input data = r_cos,l_cos,r_sin,l_sin,sqd80 ; 98.08.28 Ver.0' sekix ; 98.10.01 Ver.0" sekix ; 98.11.17 Ver.1 KH - Procedure ; Separate 80GHz strarr from that of other ; frequencies (cal_data). ; Cal.time is determined based on IPOS1. ; 98.09.03 sekix & shinox add 80GHz ; 98.09.02 Ver.0: sekix ; 98.10.01 sekix Pre burst level is specified to +/-?? min from ; ??-th sky start time. ; ; 98.11.20 K. Hori ; 1999-1-12 TY unify program for old/new NoRP data ; 2000-3-15 TY & H. Nakajima ; 2000-4-19 TY add fix procedure for 1990-7-23 -- 1991-5-13 ; 2000-5-09 TY threshold for calib became 1000 from 100 ; 2000-8-02 TY calibration existance check ; 2001-5-08 TY change dtatt ; ;- if not keyword_set(ndata) then begin ndata=lonarr(2) ndata(0)=0 & ndata(1)=n_elements(timejo)-1 endif case tag_names(rdata,/structure_name) of 'NORP0' : version =0 'NORP' : version =1 endcase date=gt_day(timejo(0),/st) flxref=4500.0 ; SFU of reference device mattxmax=100 ; In the following duration ATT status was anomalous utime_anom0=anytim('1990-7-23') utime_anom1=anytim('1991-5-14') utime_date=anytim(date) case version of 0: begin ; old format vatt=[125.,25.,5.,1.0] npclb=0 iatt=[-512,512,1433] case 1 of (utime_date lt anytim('1991-06-29')) : begin mcx=10 & tmp=28800000+3600000*lindgen(mcx) ; 8:00 JST - 60min - 17:00 timec0=replicate(timejo(0),mcx) & timec0.time=tmp-29000 timec1=timec0 & timec1.time=tmp timejsune= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp timec1=timec0 & timec1.time=tmp+30000 timejskye= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp+30000 timec1=timec0 & timec1.time=tmp+60000 timejskyw= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp+60000 timec1=timec0 & timec1.time=tmp+90000 timejsunw= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) end (utime_date ge anytim('1991-06-29') $ and utime_date lt anytim('1991-07-13')) : begin mcx=10 & tmp=28800000+3600000L*lindgen(mcx) ; 8:00 JST - 60min - 17:00 timec0=replicate(timejo(0),mcx) & timec0.time=tmp-29000 timec1=timec0 & timec1.time=tmp timejsunw= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp timec1=timec0 & timec1.time=tmp+30000 timejskyw= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp+30000 timec1=timec0 & timec1.time=tmp+60000 timejskye= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp+60000 timec1=timec0 & timec1.time=tmp+90000 timejsune= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) end else : begin ; after 1991-07-13 mcx=5 & tmp=28800000+7200000L*lindgen(mcx) ; 8:00 JST - 120min - 16:00 timec0=replicate(timejo(0),mcx) & timec0.time=tmp-29000 timec1=timec0 & timec1.time=tmp timejsunw= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp timec1=timec0 & timec1.time=tmp+30000 timejskyw= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp+30000 timec1=timec0 & timec1.time=tmp+60000 timejskye= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) timec0=replicate(timejo(0),mcx) & timec0.time=tmp+60000 timec1=timec0 & timec1.time=tmp+90000 timejsune= transpose([[anytim(timec0,/ccsds)],[anytim(timec1,/ccsds)]]) endelse endcase dtskyw=[6000,6000] ; msec dtskye=[6000,6000] ; msec dtsunw=[6000,6000] ; msec dtsune=[6000,6000] ; msec dtatt=[2000,2000] ;msec nintquiet=10 npquiet=3 mqx=69 timejq0=21900000+600000*lindgen(mqx)-30000 ; 6:05 JST - 10min - 17:05 timejq1=21900000+600000*lindgen(mqx)+30000 ; 6:05 JST - 10min - 17:05 timejquiet0=replicate(timejo(0),mqx) timejquiet1=replicate(timejo(0),mqx) timejquiet0.time=timejq0 timejquiet1.time=timejq1 timejquiet= $ transpose([[anytim(timejquiet0,/ccsds)],[anytim(timejquiet1,/ccsds)]]) dtquiet=[0,0] ; msec end 1: begin ; new format vatt=[1.,5.,25.,125.,125.] iatt=0 npclb=4 dtskyw=[6000,6000] ; msec dtskye=[6000,6000] ; msec dtsunw=[6000,6000] ; msec dtsune=[6000,6000] ; msec dtatt=[100,0] ;msec flagskyw=69 ; Sky-W flagskye=67 ; Sky-E flagsunw=68 ; Sun-W flagsune=66 ; Sun-E mqx=69 timejq0=21900000+600000*lindgen(mqx)-30000 ; 6:05 JST - 10min - 17:05 timejq1=21900000+600000*lindgen(mqx)+30000 ; 6:05 JST - 10min - 17:05 npquiet=0 & nintquiet=1 timejquiet0=replicate(timejo(0),mqx) timejquiet1=replicate(timejo(0),mqx) timejquiet0.time=timejq0 timejquiet1.time=timejq1 timejquiet= $ transpose([[anytim(timejquiet0,/ccsds)],[anytim(timejquiet1,/ccsds)]]) dtquiet=[0,0] ; msec end endcase ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; case version of 0: intego=rdata.integ 1: intego=bytarr(n_elements(rdata))+1b endcase integ=intego(ndata(0):ndata(1)) timej=timejo(ndata(0):ndata(1)) ndx=ndata(1)-ndata(0)+1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; rc=rdata.rc80 & rs=rdata.rs80 & lc=rdata.lc80 & ls=rdata.ls80 & sqd=rdata.sqd80 stat=rdata.stat80 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; extract the calibration data norp_nclb_time,timejquiet,dtquiet,timejo,mquietx,nquiet,nquieti if (version eq 0) $ then norp_nclb_time,timejskyw,dtskyw,timejo,mskywx,nskyw,nskywi $ else norp_nclb_stat,stat,flagskyw,dtskyw,timejo,mskywx,nskyw,nskywi if (version eq 0) $ then norp_nclb_time,timejskye,dtskye,timejo,mskyex,nskye,nskyei $ else norp_nclb_stat,stat,flagskye,dtskye,timejo,mskyex,nskye,nskyei if (version eq 0) $ then norp_nclb_time,timejsunw,dtsunw,timejo,msunwx,nsunw,nsunwi $ else norp_nclb_stat,stat,flagsunw,dtsunw,timejo,msunwx,nsunw,nsunwi if (version eq 0) $ then norp_nclb_time,timejsune,dtsune,timejo,msunex,nsune,nsunei $ else norp_nclb_stat,stat,flagsune,dtsune,timejo,msunex,nsune,nsunei if keyword_set(nocalib) then begin gainrs=1. gainls=1. gainrc=1. gainlc=1. rcsky=0. rssky=0. lcsky=0. lssky=0. a0=1. mvalidg=bytarr(n_elements(timej))+1b goto,L100 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; check the calibration data if ((mskywx eq 0) or (msunwx eq 0) $ or (mskyex eq 0) or (msunex eq 0)) then begin print,'***************************************' print,' There is no calibration data 80G ! ' print,' # of valid data for SKY-E ',mskyex print,' # of valid data for SKY-W ',mskywx print,' # of valid data for SUN-E ',msunex print,' # of valid data for SUN-W ',msunwx print,'***************************************' ndx=ndata(1)-ndata(0)+1 fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; For handling the anomalous status in 1990-7-23 -- 1991-5-13 if (utime_date ge utime_anom0) and (utime_date le utime_anom1) then begin print,'********************************************' print,' The ATT status record of 80G is anomalous ' print,' during 1990-7-23 -- 1991-5-13' print,' Assume Att levels' print,'********************************************' stat_org=stat stat(*)=20000 sz=size(nskywi) & if (sz(0) eq 2) then m0x = sz(2) else m0x=1 for m0=0,m0x-1 do stat(nskywi(0,m0):nskywi(1,m0))=-10000 sz=size(nskyei) & if (sz(0) eq 2) then m0x = sz(2) else m0x=1 for m0=0,m0x-1 do stat(nskyei(0,m0):nskyei(1,m0))=-10000 sz=size(nsunwi) & if (sz(0) eq 2) then m0x = sz(2) else m0x=1 for m0=0,m0x-1 do stat(nsunwi(0,m0):nsunwi(1,m0))=-10000 sz=size(nsunei) & if (sz(0) eq 2) then m0x = sz(2) else m0x=1 for m0=0,m0x-1 do stat(nsunei(0,m0):nsunei(1,m0))=-10000 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; S/N sigma norp_clb_sn,mquietx,nquiet,npquiet,nintquiet,stat,vatt,oksnrs,intego $ ,timejo,timejquiet_m,rs,rs_sigma_m,iatt=iatt norp_clb_sn,mquietx,nquiet,npquiet,nintquiet,stat,vatt,oksnrc,intego $ ,timejo,timejquiet_m,rc,rc_sigma_m,iatt=iatt norp_clb_sn,mquietx,nquiet,npquiet,nintquiet,stat,vatt,oksnlc,intego $ ,timejo,timejquiet_m,lc,lc_sigma_m,iatt=iatt norp_clb_sn,mquietx,nquiet,npquiet,nintquiet,stat,vatt,oksnls,intego $ ,timejo,timejquiet_m,ls,ls_sigma_m,iatt=iatt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; integarage the calibration data norp_clb_integ,mquietx,nquiet,npquiet,stat,vatt,okquiet0,intego $ ,timejo,timejquiet_m,rs,rsquiet_m,ls,lsquiet_m,iatt=iatt norp_clb_integ,mquietx,nquiet,npquiet,stat,vatt,okquiet1,intego $ ,timejo,timejquiet_m,rc,rcquiet_m,lc,lcquiet_m,iatt=iatt norp_clb_integ,mskywx,nskyw,npclb,stat,vatt,okskyw,intego $ ,timejo,timejskyw_m,rs,rssky_m,ls,lssky_m,sqd,sqdskyw_m,iatt=iatt norp_clb_integ,mskyex,nskye,npclb,stat,vatt,okskye,intego $ ,timejo,timejskye_m,rc,rcsky_m,lc,lcsky_m,sqd,sqdskye_m,iatt=iatt norp_clb_integ,msunwx,nsunw,npclb,stat,vatt,oksunw,intego $ ,timejo,timejsunw_m,rs,rssun_m,ls,lssun_m,sqd,sqdsunw_m,iatt=iatt norp_clb_integ,msunex,nsune,npclb,stat,vatt,oksune,intego $ ,timejo,timejsune_m,rc,rcsun_m,lc,lcsun_m,sqd,sqdsune_m,iatt=iatt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; check calibration data whr=where(oksnrs,moksn) whr=where(okquiet0,mokquiet0) whr=where(okquiet1,mokquiet1) if ((moksn eq 0) or (mokquiet0 eq 0) or (mokquiet1 eq 0)) then begin print,'***************************************' print,' There is no calibration data 80G ! ' print,' # of valid data for S/N ',moksn print,' # of valid data for Quiet 0 ',mokquiet0 print,' # of valid data for Quiet 1 ',mokquiet1 print,'***************************************' ndx=ndata(1)-ndata(0)+1 fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; spline fit ; Noise whr=where(oksnrs,mok) case 1 of (mok ge 2) : begin rs_sigma=total(rs_sigma_m(whr))/float(mok) ls_sigma=total(ls_sigma_m(whr))/float(mok) rc_sigma=total(rc_sigma_m(whr))/float(mok) lc_sigma=total(lc_sigma_m(whr))/float(mok) end (mok eq 1) : begin rs_sigma=(rs_sigma_m(whr))(0) ls_sigma=(ls_sigma_m(whr))(0) rc_sigma=(rc_sigma_m(whr))(0) lc_sigma=(lc_sigma_m(whr))(0) end (mok eq 0) : begin rs_sigma=0 ls_sigma=0 rc_sigma=0 lc_sigma=0 end endcase ; Quiet Sun whr=where(okquiet0,mok) case 1 of (mok ge 3) : begin ; rsquiet=spline(timejquiet_m(whr).time,rsquiet_m(whr),timej.time) ; lsquiet=spline(timejquiet_m(whr).time,lsquiet_m(whr),timej.time) rsquiet=total(rsquiet_m(whr))/n_elements(rsquiet_m(whr)) lsquiet=total(lsquiet_m(whr))/n_elements(lsquiet_m(whr)) end (mok eq 2) : begin rsquiet=total(rsquiet_m(whr))*0.5 lsquiet=total(lsquiet_m(whr))*0.5 end (mok eq 1) : begin rsquiet=(rsquiet_m(whr))(0) lsquiet=(lsquiet_m(whr))(0) end endcase whr=where(okquiet1,mok) case 1 of (mok ge 3) : begin ; rcquiet=spline(timejquiet_m(whr).time,rcquiet_m(whr),timej.time) ; lcquiet=spline(timejquiet_m(whr).time,lcquiet_m(whr),timej.time) rcquiet=total(rcquiet_m(whr))/n_elements(rcquiet_m(whr)) lcquiet=total(lcquiet_m(whr))/n_elements(lcquiet_m(whr)) end (mok eq 2) : begin rcquiet=total(rcquiet_m(whr))*0.5 lcquiet=total(lcquiet_m(whr))*0.5 end (mok eq 1) : begin rcquiet=(rcquiet_m(whr))(0) lcquiet=(lcquiet_m(whr))(0) end endcase ; Calibration whr=where(okskyw,mok) case 1 of (mok ge 3) : begin ; rssky=spline(timejskyw_m(whr).time,rssky_m(whr),timej.time) ; lssky=spline(timejskyw_m(whr).time,lssky_m(whr),timej.time) ; sqdskyw=spline(timejskyw_m(whr).time,sqdskyw_m(whr),timej.time) rssky=total(rssky_m(whr))/n_elements(rssky_m(whr)) lssky=total(lssky_m(whr))/n_elements(lssky_m(whr)) sqdskyw=total(sqdskyw_m(whr))/n_elements(sqdskyw_m(whr)) end (mok eq 2) : begin rssky=total(rssky_m(whr))/n_elements(rssky_m(whr)) lssky=total(lssky_m(whr))/n_elements(lssky_m(whr)) sqdskyw=total(sqdskyw_m(whr))/n_elements(sqdskyw_m(whr)) end (mok eq 1) : begin rssky=(rssky_m(whr))(0) lssky=(lssky_m(whr))(0) sqdskyw=(sqdskyw_m(whr))(0) end endcase whr=where(okskye,mok) case 1 of (mok ge 3) : begin ; rcsky=spline(timejskye_m(whr).time,rcsky_m(whr),timej.time) ; lcsky=spline(timejskye_m(whr).time,lcsky_m(whr),timej.time) ; sqdskye=spline(timejskye_m(whr).time,sqdskye_m(whr),timej.time) rcsky=total(rcsky_m(whr))/n_elements(rcsky_m(whr)) lcsky=total(lcsky_m(whr))/n_elements(lcsky_m(whr)) sqdskye=total(sqdskye_m(whr))/n_elements(sqdskye_m(whr)) end (mok eq 2) : begin rcsky=total(rcsky_m(whr))/n_elements(rcsky_m(whr)) lcsky=total(lcsky_m(whr))/n_elements(lcsky_m(whr)) sqdskye=total(sqdskye_m(whr))/n_elements(sqdskye_m(whr)) end (mok eq 1) : begin rcsky=(rcsky_m(whr))(0) lcsky=(lcsky_m(whr))(0) sqdskye=(sqdskye_m(whr))(0) end endcase whr=where(oksunw,mok) case 1 of (mok ge 3) : begin ; rssun=spline(timejsunw_m(whr).time,rssun_m(whr),timej.time) ; lssun=spline(timejsunw_m(whr).time,lssun_m(whr),timej.time) ; sqdsunw=spline(timejsunw_m(whr).time,sqdsunw_m(whr),timej.time) rssun=total(rssun_m(whr))/n_elements(rssun_m(whr)) lssun=total(lssun_m(whr))/n_elements(lssun_m(whr)) sqdsunw=total(sqdsunw_m(whr))/n_elements(sqdsunw_m(whr)) end (mok eq 2) : begin rssun=total(rssun_m(whr))/n_elements(rssun_m(whr)) lssun=total(lssun_m(whr))/n_elements(lssun_m(whr)) sqdsunw=total(sqdsunw_m(whr))/n_elements(sqdsunw_m(whr)) end (mok eq 1) : begin rssun=(rssun_m(whr))(0) lssun=(lssun_m(whr))(0) sqdsunw=(sqdsunw_m(whr))(0) end endcase whr=where(oksune,mok) case 1 of (mok ge 3) : begin ; rcsun=spline(timejsune_m(whr).time,rcsun_m(whr),timej.time) ; lcsun=spline(timejsune_m(whr).time,lcsun_m(whr),timej.time) ; sqdsune=spline(timejsune_m(whr).time,sqdsune_m(whr),timej.time) rcsun=total(rcsun_m(whr))/n_elements(rcsun_m(whr)) lcsun=total(lcsun_m(whr))/n_elements(lcsun_m(whr)) sqdsune=total(sqdsune_m(whr))/n_elements(sqdsune_m(whr)) end (mok eq 2) : begin rcsun=total(rcsun_m(whr))/n_elements(rcsun_m(whr)) lcsun=total(lcsun_m(whr))/n_elements(lcsun_m(whr)) sqdsune=total(sqdsune_m(whr))/n_elements(sqdsune_m(whr)) end (mok eq 1) : begin rcsun=(rcsun_m(whr))(0) lcsun=(lcsun_m(whr))(0) sqdsune=(sqdsune_m(whr))(0) end endcase ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; gain mvalidg=bytarr(n_elements(timej))+1b a0e=sqdsune-sqdskye & a0w=sqdsunw-sqdskyw whr=where((a0w le 1.) or (a0e le 1.),count) if count ge 1 then begin mvalidg(whr)=0b a0w(whr)=1. endif a0=1./sqrt(a0e*a0w) gainrs=a0w*flxref/(rssun-rssky) gainls=a0w*flxref/(lssun-lssky) gainrc=a0e*flxref/(rcsun-rcsky) gainlc=a0e*flxref/(lcsun-lcsky) whr=where((abs(rssun-rssky) le 1000.),count) if count ge 1 then begin if ((n_elements(rssun) ne 1) and (n_elements(rssky) ne 1)) then begin mvalidg(whr)=0b gainrs(whr)=1. endif else begin print,'***************************************' print,' Calibration invalid for 80G! ' print,' No 80G data available' print,'***************************************' fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endelse endif whr=where((abs(lssun-lssky) le 1000.),count) if count ge 1 then begin if ((n_elements(lssun) ne 1) and (n_elements(lssky) ne 1)) then begin mvalidg(whr)=0b gainls(whr)=1. endif else begin print,'***************************************' print,' Calibration invalid for 80G! ' print,' No 80G data available' print,'***************************************' fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endelse endif whr=where((abs(rcsun-rcsky) le 1000.),count) if count ge 1 then begin if ((n_elements(rcsun) ne 1) and (n_elements(rcsky) ne 1)) then begin mvalidg(whr)=0b gainrc(whr)=1. endif else begin print,'***************************************' print,' Calibration invalid for 80G! ' print,' No 80G data available' print,'***************************************' fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endelse endif whr=where((abs(lcsun-lcsky) le 1000.),count) if count ge 1 then begin if ((n_elements(lcsun) ne 1) and (n_elements(lcsky) ne 1)) then begin mvalidg(whr)=0b gainlc(whr)=1. endif else begin print,'***************************************' print,' Calibration invalid for 80G! ' print,' No 80G data available' print,'***************************************' fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endelse endif L100: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; restore the attainator, and check the valid data stt0=stat(ndata(0):ndata(1)) npa=norp_gt_npa(stt0,iatt=iatt) natt=where((npa-shift(npa,1) ne 0),mattx) if (mattx ge mattxmax) then begin print,'***************************************' print,' Too many att-mode-shift for 80G! ' print,' # of att-mode-shift', mattx print,'***************************************' fi=fltarr(ndx) fv=fltarr(ndx) mvalid=bytarr(ndx) return endif natti=norp_gt_natti(npa,timej,dtatt) frs=vatt(npa)*float(rs(ndata(0):ndata(1)))/float(integ) fls=vatt(npa)*float(ls(ndata(0):ndata(1)))/float(integ) frc=vatt(npa)*float(rc(ndata(0):ndata(1)))/float(integ) flc=vatt(npa)*float(lc(ndata(0):ndata(1)))/float(integ) fr=a0*sqrt((gainrc*(frc-rcquiet))^2+(gainrs*(frs-rsquiet))^2) fl=a0*sqrt((gainlc*(flc-lcquiet))^2+(gainls*(fls-lsquiet))^2) fro=fr & flo=fl r_sigma=a0*sqrt((gainrc*(rc_sigma))^2+(gainrs*(rs_sigma))^2) $ /sqrt(float(integ))/sqrt(2.) l_sigma=a0*sqrt((gainlc*(lc_sigma))^2+(gainls*(ls_sigma))^2) $ /sqrt(float(integ))/sqrt(2.) fr=norp_clb_snfix(fr,r_sigma) fl=norp_clb_snfix(fl,l_sigma) fi=fr+fl+9000 ; add quiet sun fv=fr-fl mvalid=(norp_mvalid(ndx,natti) $ and norp_mvalid(ndx,nskywi-ndata(0)) $ and norp_mvalid(ndx,nskyei-ndata(0)) $ and norp_mvalid(ndx,nsunwi-ndata(0)) $ and norp_mvalid(ndx,nsunei-ndata(0)) $ and mvalidg) return end