;+ make_h2_cdf wkp march 2008 copied from ; make_h1_cdf ; creates empty cdf file with ISTP standard name and ; istp standard documentation information that ; is openened and filed by the h2_production code ; to be run at CU and put on the web site and sent to CDAWeb ; TIMAS event data. ; inputs yy,mm,dd in ISTP standard format ; ; output is the name of the cdf file created ; note it is created in the same directory as ; the code is run.... the directory positon ; is changed in this code.... ; ; ;- pro make_h2_cdf,yy,mm,dd,name,DEST=dest print,'Making CDF file for...',yy,mm,dd if keyword_set( dest ) then begin dl = strlen( dest ) if strpos( dest, '/', dl-1 ) lt 0 then dest = dest + '/' print, 'Destination changed to >'+dest+'<' endif else begin dest = '' endelse openr,lun1, 'timas_h2_v0.skt', /get_lun ;print,'lun1 = ',lun1 dum='' for i=0,4 do begin readf,lun1,dum ; print,dum endfor ; ;======================== ; open and name the output cdf file ; get_lun, lun2 name = dest + 'po_h2_tim_' $ + string( yy, mm, dd, format = '(i4.4,i2.2,i2.2)') + '_v01' print,'creating skeleton table...',name openw, lun2, name+'.skt' printf,lun2,'#header CDF NAME: '+name ; ;===================================== ; stuff the skeleton table while not eof(lun1) do begin readf,lun1,dum printf,lun2,dum endwhile ;close,lun1 free_lun, lun1 ;close,lun2 free_lun, lun2 ; ;===================================== ; make the cdf... NOTE cdfskelton command bombs ; on older versions 2.5 versions of CDF ; ;dum='cdfskeleton -delete '+name ; NAME change with version 2.6 of cdf dum='skeletoncdf -delete '+name print,'Spawing unix command ....DELETES EXISTING CDF WITH SAME NAME',dum spawn,dum ; ;================================= ;get rid of skeletontable you don't need it no more ; dum='/usr/bin/rm '+name+'.skt' spawn, dum return end