;+ ; NAME: ; TAPECHNG ; PURPOSE: ; Estimating tape change schedule for Eureka Polar Camera operation. ; CATEGORY: ; Planning ; CALLING SEQUENCE: ; TAPECHNG,SYR,SMO,SDY,FYR,FMO,FDY $ ; [,SDA=sda,OHEAD=ohead,TAPESIZE=tapesize,STEP=step] $ ; [,JUNK=junk,/DEBUG] ; INPUTS: ; SYR,SMO,SDY: Start year, month, day (UT) ; FYR,FMO,FDY: Finish year, month, day (UT) ; OPTIONAL INPUTS: ; None. ; KEYWORD PARAMETERS: ; SDA: Solar depression angle below which camera operates (D=8). ; OHEAD: Log file volume (as a fraction of data file volume) (D=0.13) ; TAPESIZE: Tape volume in bytes (nominally 2 GB) (D=1.5E9) ; STEP: Minutes per operation cycle of Polar Camera, truncated (D=4) ; JUNK: File volume in bytes of unrelated stuff that gets backed up ; each day and not deleted (D=0) ; OUTPUTS: ; None. ; OPTIONAL OUTPUTS: ; None. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; None. ; RESTRICTIONS: ; None. ; PROCEDURE: ; Straightforward; operating time is estimated from interval between ; consecutive solar crossings of specified SDA. Number of cycles ; estimated using STEP. Data volume estimated using known number of ; files per cycle and bytes per file. Total volume estimated using ; OHEAD. Daily backup sets added until TAPESIZE is reached. Sketchy ; tape change schedule is generated. ; EXAMPLE: ; ; SEE ALSO: ; ; MODIFICATION HISTORY: ; Written by: D P Steele, ISAS, October 1995. ;- PRO tapechng,sy,sm,sd,fy,fm,fd $ ,sda=sda,ohead=ohead,tapesize=tapesize,step=step,junk=junk $ ,debug=debug IF N_ELEMENTS(sda) EQ 0 THEN sda=8. IF sda LT 0 THEN sda=-sda IF N_ELEMENTS(ohead) EQ 0 THEN ohead=0.13 ; estimate IF N_ELEMENTS(tapesize) EQ 0 THEN tapesize=1.5E9 ; minutes between ephemeris calcs, about cycle length IF N_ELEMENTS(step) EQ 0 THEN step=4.4 ; step=FLOOR(step) IF N_ELEMENTS(junk) EQ 0 THEN junk=0L PRINT,ymd2date(sy,sm,sd,form='n$ d$ y$') $ ,ymd2date(fy,fm,fd+1,form='n$ d$ y$') $ ,FORMAT='("Start: ",A,"; finish: ",A)' PRINT,-sda,ohead*100,tapesize,step,junk $ ,FORMAT='("Take data when SDA below ",F4.0," deg;"/' $ +'"estimated log file overhead is ",F3.0,"%"/' $ +'"nominal tape volume is ",E8.1," bytes"/' $ +'"cycle length is ",F3.1," minutes"/' $ +'E8.1," bytes of extra stuff in daily backup.")' IF sy LT 100 THEN IF sy LT 50 THEN sy=sy+2000 ELSE sy=sy+1900 IF fy LT 100 THEN IF fy LT 50 THEN fy=fy+2000 ELSE fy=fy+1900 sjd=julday(sm,sd,sy) fjd=julday(fm,fd,fy)-1 ncycles=INTARR(fjd-sjd+1) ; hr=SHIFT(REFORM(REBIN(INDGEN(1,24),60/step,24),1440/step) $ ; ,-(1440/step)/4) ; mn=SHIFT(REFORM(REBIN(INDGEN(60/step)*step,60/step,24),1440/step) $ ; ,-(1440/step)/4) ; PRINT,hr(0),mn(0) ; STOP uts=FLOOR(FINDGEN(1440/step)*(60*step)) nt=N_ELEMENTS(uts) hr=uts/3600L mn=(uts-hr*3600L)/60L sec=(uts-(hr*60L+mn)*60L) w18=WHERE(hr GE 18) w18=w18(0) hr=SHIFT(hr,-w18) mn=SHIFT(mn,-w18) sec=SHIFT(sec,-w18) loc=pocaloc(sy,sm,sd) IF KEYWORD_SET(debug) THEN t0=SYSTIME(1) FOR jd=sjd,fjd DO BEGIN caldat,jd,om,od,oy caldat,jd+1,nm,nd,ny ; sy=REBIN([oy,ny,ny,ny],1440/step) ; sm=REBIN([om,nm,nm,nm],1440/step) ; sd=REBIN([od,nd,nd,nd],1440/step) sy=[REPLICATE(oy,nt-w18),REPLICATE(ny,w18)] sm=[REPLICATE(om,nt-w18),REPLICATE(nm,w18)] sd=[REPLICATE(od,nt-w18),REPLICATE(nd,w18)] sunazel,sy,sm,sd,hr,mn,sec,az,el ncycles(jd-sjd)=TOTAL(el LE -sda) IF KEYWORD_SET(debug) THEN BEGIN t1=SYSTIME(1) PRINT,jd,oy,om,od,ncycles(jd-sjd)*step,t1-t0 t0=t1 ; STOP ENDIF ENDFOR bytesperfile=2L^15+512 ; 33280 filespercycle=8L ; 4 files * 2 cameras bytespercycle=bytesperfile*filespercycle bytesperday=bytespercycle*ncycles*(1+ohead)+junk IF KEYWORD_SET(debug) THEN STOP tapenum=0 tapecont=[0L] nsets=[0] FOR jd=sjd,fjd DO BEGIN tapecont(tapenum)=tapecont(tapenum)+bytesperday(jd-sjd) nsets(tapenum)=nsets(tapenum)+1 IF tapecont(tapenum) GT tapesize THEN BEGIN caldat,jd+1,tcm,tcd,tcy PRINT,ymd2date(tcy,tcm,tcd,form='n$ d$ y$'),tapenum $ ,nsets(tapenum),tapecont(tapenum),tapenum+1 $ ,FORMAT='("After backup on ",A/' $ +'"tape ",I0," contains ",I0," backup sets and "' $ +',I0," bytes;"/"change to tape ",I0/)' tapenum=tapenum+1 tapecont=[tapecont,0] nsets=[nsets,0] ENDIF IF jd EQ FJD THEN BEGIN caldat,jd+1,tcm,tcd,tcy PRINT,ymd2date(tcy,tcm,tcd,form='n$ d$ y$'),tapenum $ ,nsets(tapenum),tapecont(tapenum) $ ,FORMAT='("After backup on ",A/' $ +'"tape ",I0," contains ",I0," backup sets and "' $ +',I0," bytes;"/"end of operations!")' ENDIF ENDFOR RETURN END