pro make_h2 ;+ ; Modified from read_h1 ; wkp 3/28/08 read in the name of a cdf file ; 5/5/08 make a h2 cdf outputfile ; and stuff it all in this code!!!! ; ; ; the h1 file has too much stuff and in 4 element arrays ; here put out the fluence of H and O He1 and He2 only ; in a h2 data format.... ;- !path='/disks/fast1/software/delivery/idl:'+!path !path='/disks/fast3/users/bill/fast/idl/src:'+!path dirlist=['/timas/flowdb/1996/','/timas/flowdb/1997/','/timas/flowdb/1998/'] for iloop=0,2 do begin ; get data for 2006, 2007, and 2008 cmnd='ls '+dirlist(iloop)+'*.cdf >! cdf_filelist' spawn, cmnd openr,lun,'cdf_filelist',/get_lun file_name='' while not eof(lun) do begin readf,lun,file_name ;/timas/flowdb/1996/po_h1_tim_19960317_v01.cdf ;123456789012345678901234567890123456789012345 infile=strmid(file_name,0,41) print, infile cdfid=cdf_open(infile) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; make a h1_cdf file to stuff here year=0L month=0L day=0L ;/timas/flowdb/1996/po_h1_tim_19960317_v01 ;12345678901234456789012345678 reads,infile,year,month,day, $ format='(29x,i4,i2,i2)' make_h2_cdf,year,month,day yeardaystring='' reads,infile,yeardaystring,format='(29x,a8)' h2_cdf_name='po_h2_tim_'+yeardaystring+'_v01' h2_id=cdf_open(h2_cdf_name) ; print,'CDFID in:',cdfid print,'CDFID out:',h2_id info=cdf_inquire(cdfid) ;help,/structure, info ;print, 'Dimensions: ',info.dim ;print, '' ;print,'Z Variable names and Types' ;for i=0, info.nzvars-1 do begin ; vinfo= cdf_varinq(cdfid,i,/zvariable) ; print, vinfo.name, ' Type:', vinfo.datatype, ' DIMS:', vinfo.DIM ;endfor cdf_control,cdfid,variable=0,/zvariable,get_var_info=einfo max_records=einfo.maxrec print, 'NOTE: The NO_PADVALUE_SPECIFIED: error is a feature of idl. no problem/wkp.' ;% CDF_CONTROL: Function completed but: NO_PADVALUE_SPECIFIED: A pad value has ; not been specified. print,'MAXRECORDS= ',max_records if max_records eq 0 then begin print, 'No valid Summary Data for this UT day' print_null,cdfid,einfo ; call to print_null.pro ???? print,cdfname stop endif if max_records lt 0 then begin print, 'ERRORR NO FILL RECORD IN THIS CDF' print, 'KEY PARAMETER CDF NOT CLOSED when generated' print, ' ..... or .......' print, 'you forgot to specify bin when you used ftp ' print, 'to transfer the file here! ' print, cdfname stop endif i=0 ; make the record star===0 (insruance statement status='' ; epoch ; ; cdf_varget,cdfid,'Start_Epoch',Start_EPOCH, rec_start=i,/zvariable cdf_varget,cdfid,'Start_Epoch',Start_EPOCH, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Start_epoch call/',Result,'/', status ; you don't really need epoch!!! use pb5 time.... cdf_varget,cdfid,'Stop_Epoch',Stop_EPOCH, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Stop_epoch call/',Result,'/', status cdf_varget,cdfid,'Fluence',Fluence, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Fluence call/',Result,'/', status cdf_varget,cdfid,'Sigma_flu',Sigma_flu, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Sigma_flu call/',Result,'/', status cdf_varget,cdfid,'E_flux',E_flux, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for E_flux call/',Result,'/', status cdf_varget,cdfid,'Sigma_ef',Sigma_ef, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Sigma_ef call/',Result,'/', status cdf_varget,cdfid,'Spins',spins, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Spins call/',Result,'/', status cdf_varget,cdfid,'Quality',Quality, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Quality call/',Result,'/', status ;print, 'NOW figure out H_Epoch etd ' h_epoch=dblarr(max_records) o_epoch=dblarr(max_records) he1_epoch=dblarr(max_records) he2_epoch=dblarr(max_records) fill= -1.0e+31 ; when these are figured out then we need ; _fluence h_fluence=fltarr(max_records) o_fluence=fltarr(max_records) he1_fluence=fltarr(max_records) he2_fluence=fltarr(max_records) ; _sigma h_sigma=fltarr(max_records) o_sigma=fltarr(max_records) he1_sigma=fltarr(max_records) he2_sigma=fltarr(max_records) ; _eflux h_eflux=fltarr(max_records) o_eflux=fltarr(max_records) he1_eflux=fltarr(max_records) he2_eflux=fltarr(max_records) ; _efluxsigma h_efluxsigma=fltarr(max_records) o_efluxsigma=fltarr(max_records) he1_efluxsigma=fltarr(max_records) he2_efluxsigma=fltarr(max_records) ; _spins h_spins=fltarr(max_records) o_spins=fltarr(max_records) he1_spins=fltarr(max_records) he2_spins=fltarr(max_records) ; _spins h_quality=bytarr(max_records) o_quality=bytarr(max_records) he1_quality=bytarr(max_records) he2_quality=bytarr(max_records) ;; for irec=0, max_records-1 do begin for im=0, 3 do begin; , H, O, He1, and He2 if Start_epoch(im,irec) eq fill or Stop_epoch(im,irec) eq fill then begin print, 'IREC IM problem in time ', irec, im print,'STARTS: ',time_to_str(start_epoch(*,irec) ) print,'STOPS: ',time_to_str(stpp_epoch(*,irec) ) print,'Fluence: ',fluence(*,irec) print,'Sigma_flu:',sigma_flu(*,irec) print,'E_flux: ',e_flux(*,irec) print,'E_flx_sig:',sigma_ef(*,irec) print,'Quality:' ,quality(*,irec) print,'Spins: ',spins(*,irec) print,'this is the bad stuff you have to deal with!!!!!' stop endif else begin if im eq 0 then begin H_Epoch(irec)=(start_epoch(0,irec)+stop_epoch(0,irec))/2.0 H_Fluence(irec)=fluence(0,irec) H_sigma(irec)=sigma_flu(0,irec) H_Eflux(irec)=e_flux(0,irec) H_efluxsigma(irec)=sigma_ef(0,irec) H_spins(irec)=spins(0,irec) H_quality(irec)=quality(0,irec) endif if im eq 1 then begin o_Epoch(irec)=(start_epoch(1,irec)+stop_epoch(1,irec))/2.0 o_Fluence(irec)=fluence(1,irec) o_sigma(irec)=sigma_flu(1,irec) o_Eflux(irec)=e_flux(1,irec) o_efluxsigma(irec)=sigma_ef(1,irec) o_spins(irec)=spins(1,irec) o_quality(irec)=quality(1,irec) endif if im eq 2 then begin He1_Epoch(irec)=(start_epoch(2,irec)+stop_epoch(2,irec))/2.0 He1_Fluence(irec)=fluence(2,irec) He1_sigma(irec)=sigma_flu(2,irec) He1_Eflux(irec)=e_flux(2,irec) He1_efluxsigma(irec)=sigma_ef(2,irec) He1_spins(irec)=spins(2,irec) He1_quality(irec)=quality(2,irec) endif if im eq 3 then begin He2_Epoch(irec)=(start_epoch(3,irec)+stop_epoch(3,irec))/2.0 He2_Fluence(irec)=fluence(3,irec) He2_sigma(irec)=sigma_flu(3,irec) He2_Eflux(irec)=e_flux(3,irec) He2_efluxsigma(irec)=sigma_ef(3,irec) He2_spins(irec)=spins(3,irec) He2_quality(irec)=quality(3,irec) endif endelse endfor ;im endfor ; irec loop ; add extra stuff here ;print, 'Write CDF STUFF HERE TO cdf_h2 cdfid=h2_id !!!! CDF_VARPUT,h2_id,'H_Epoch',H_epoch,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_epoch ',Result,'/', status CDF_VARPUT,h2_id,'O_Epoch',O_epoch,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put O_epoch ',Result,'/', status CDF_VARPUT,h2_id,'He1_Epoch',He1_epoch,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_epoch ',Result,'/', status CDF_VARPUT,h2_id,'He2_Epoch',He2_epoch,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_epoch ',Result,'/', status ; H_Fluence(irec)=fluence(0,irec) CDF_VARPUT,h2_id,'H_Fluence',H_Fluence,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_Fluence ',Result,'/', status CDF_VARPUT,h2_id,'He1_Fluence',He1_Fluence,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_Fluence ',Result,'/', status CDF_VARPUT,h2_id,'O_Fluence',O_Fluence,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put O_Fluence ',Result,'/', status CDF_VARPUT,h2_id,'He2_Fluence',He2_Fluence,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_Fluence ',Result,'/', status ; H_sigma(irec)=sigma_flu(0,irec) CDF_VARPUT,h2_id,'H_sigma',H_sigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_sigma ',Result,'/', status CDF_VARPUT,h2_id,'O_sigma',O_sigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put O_sigma ',Result,'/', status CDF_VARPUT,h2_id,'He1_sigma',He1_sigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_sigma ',Result,'/', status CDF_VARPUT,h2_id,'He2_sigma',He2_sigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_sigma ',Result,'/', status ; H_Eflux(irec)=e_flux(0,irec) CDF_VARPUT,h2_id,'H_Eflux',H_Eflux,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_Eflux ',Result,'/', status CDF_VARPUT,h2_id,'O_Eflux',O_Eflux,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_Oflux ',Result,'/', status CDF_VARPUT,h2_id,'He1_Eflux',He1_Eflux,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_Eflux ',Result,'/', status CDF_VARPUT,h2_id,'He2_Eflux',He2_Eflux,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_Eflux ',Result,'/', status ; H_efluxsigma(irec)=sigma_ef(0,irec) CDF_VARPUT,h2_id,'H_efluxsigma',H_efluxsigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_efluxsigma ',Result,'/', status CDF_VARPUT,h2_id,'O_efluxsigma',O_efluxsigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put O_efluxsigma ',Result,'/', status CDF_VARPUT,h2_id,'He1_efluxsigma',He1_efluxsigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_efluxsigma ',Result,'/', status CDF_VARPUT,h2_id,'He2_efluxsigma',He2_efluxsigma,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_efluxsigma ',Result,'/', status ; H_spins(irec)=spins(0,irec) CDF_VARPUT,h2_id,'H_spins',H_spins,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_spins ',Result,'/', status CDF_VARPUT,h2_id,'O_spins',O_spins,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put O_spins ',Result,'/', status CDF_VARPUT,h2_id,'He1_spins',He1_spins,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_spins ',Result,'/', status CDF_VARPUT,h2_id,'He2_spins',He2_spins,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_spins ',Result,'/', status ; H_quality(irec)=quality(0,irec) CDF_VARPUT,h2_id,'H_quality',H_quality,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put H_quality ',Result,'/', status CDF_VARPUT,h2_id,'O_quality',O_quality,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put O_quality ',Result,'/', status CDF_VARPUT,h2_id,'He1_quality',He1_quality,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He1_quality ',Result,'/', status CDF_VARPUT,h2_id,'He2_quality',He2_quality,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put He2_quality ',Result,'/', status ;;;;; sza/consza stuff cdf_varget,cdfid,'SZA',h1_SZA, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SZA call/',Result,'/', status cdf_varget,cdfid,'SZA_status',h1_SZA_status, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SZA_status call/',Result,'/', status ; sza is afud .... for the 3/17/96 day that I was checing..... ; sza was ok on other days....and hte sza_status flag was set correctly!!! ; SZA=fltarr(max_records) Conjugate_SZA=fltarr(max_records) SZA_status=fltarr(max_records) Conjugate_SZA_status=fltarr(max_records) for irec=0, max_records-1 do begin sza(irec)=h1_sza(0,irec) conjugate_sza(irec)=h1_sza(1,irec) sza_status(irec)=h1_sza_status(0,irec) conjugate_sza_status(irec)=h1_sza_status(1,irec) endfor ;SZA=fltarr(max_records) CDF_VARPUT,h2_id,'SZA',SZA,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SZA ',Result,'/', status ;Conjugate_SZA=fltarr(max_records) CDF_VARPUT,h2_id,'Conjugate_SZA',Conjugate_SZA,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Conjugate_SZA ',Result,'/', status ;SZA_status=fltarr(max_records) CDF_VARPUT,h2_id,'SZA_status',SZA_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SZA_status ',Result,'/', status ;Conjugate_SZA_status=fltarr(max_records) CDF_VARPUT,h2_id,'Conjugate_SZA_status',Conjugate_SZA_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Conjugate_SZA_status ',Result,'/', status ;;;;;;;;;;;;;;;;;;all variables below are passed straigt from the H1 cdf data set ;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,,,,,,,,<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=========== cdf_varget,cdfid,'R',in_R, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for R call/',Result,'/', status r=fltarr(max_records) ; (*_)(*^)*(%^% IDL r=in_r(0:max_records-1) CDF_VARPUT,h2_id,'R',R,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put R ',Result,'/', status cdf_varget,cdfid,'L',in_L, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for L call/',Result,'/', status L=fltarr(max_records) ; (*_)(*^)*(%^% IDL L=in_L(0:max_records-1) CDF_VARPUT,h2_id,'L',L,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put L ',Result,'/', status cdf_varget,cdfid,'MLT',in_MLT, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for MLT call/',Result,'/', status MLT=fltarr(max_records) ; (*_)(*^)*(%^% IDL MLT=in_MLT(0:max_records-1) CDF_VARPUT,h2_id,'MLT',MLT,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put MLT ',Result,'/', status cdf_varget,cdfid,'LocT',in_LocT, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for LocT call/',Result,'/', status LocT=fltarr(max_records) ; (*_)(*^)*(%^% IDL LocT=in_LocT(0:max_records-1) CDF_VARPUT,h2_id,'LocT',LocT,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put LocT ',Result,'/', status cdf_varget,cdfid,'Mlat',in_Mlat, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Mlat call/',Result,'/', status Mlat=fltarr(max_records) ; (*_)(*^)*(%^% IDL Mlat=in_Mlat(0:max_records-1) CDF_VARPUT,h2_id,'Mlat',Mlat,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Mlat ',Result,'/', status cdf_varget,cdfid,'ILA',in_ILA, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for ILA call/',Result,'/', status ILA=fltarr(max_records) ; (*_)(*^)*(%^% IDL ILA=in_ILA(0:max_records-1) CDF_VARPUT,h2_id,'ILA',ILA,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put ILA ',Result,'/', status cdf_varget,cdfid,'MagField',MagField, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for MagField call/',Result,'/', status CDF_VARPUT,h2_id,'MagField',MagField,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put MagField ',Result,'/', status cdf_varget,cdfid,'SC_Potential',in_SC_Potential, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SC_Potential call/',Result,'/', status SC_Potential=fltarr(max_records) ; (*_)(*^)*(%^% IDL SC_Potential=in_SC_Potential(0:max_records-1) CDF_VARPUT,h2_id,'SC_Potential',SC_Potential,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SC_Potential ',Result,'/', status cdf_varget,cdfid,'Imf_Gsm',Imf_Gsm, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Imf_Gsm call/',Result,'/', status CDF_VARPUT,h2_id,'Imf_Gsm',Imf_Gsm,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Imf_Gsm ',Result,'/', status ; imf_gsm was invalid for the first day checked... cdf_varget,cdfid,'IMF_status',in_IMF_status, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for IMF_status call/',Result,'/', status IMF_status=fltarr(max_records) ; (*_)(*^)*(%^% IDL IMF_status=in_IMF_status(0:max_records-1) CDF_VARPUT,h2_id,'IMF_status',IMF_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put IMF_status ',Result,'/', status cdf_varget,cdfid,'SW_pressure',in_SW_pressure, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SW_pressure call/',Result,'/', status SW_pressure=fltarr(max_records) ; (*_)(*^)*(%^% IDL SW_pressure=in_SW_pressure(0:max_records-1) CDF_VARPUT,h2_id,'SW_pressure',SW_pressure,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SW_pressure ',Result,'/', status cdf_varget,cdfid,'SW_density',in_SW_density, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SW_density call/',Result,'/', status SW_density=fltarr(max_records) ; (*_)(*^)*(%^% IDL SW_density=in_SW_density(0:max_records-1) CDF_VARPUT,h2_id,'SW_density',SW_density,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SW_density ',Result,'/', status cdf_varget,cdfid,'SW_velocity',SW_velocity, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SW_velocity call/',Result,'/', status CDF_VARPUT,h2_id,'SW_velocity',SW_velocity,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SSW_velocity ',Result,'/', status cdf_varget,cdfid,'Fec',in_Fec, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Fec call/',Result,'/', status Fec=fltarr(max_records) ; (*_)(*^)*(%^% IDL Fec=in_Fec(0:max_records-1) CDF_VARPUT,h2_id,'Fec',Fec,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Fec ',Result,'/', status cdf_varget,cdfid,'Bcr',in_Bcr, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Bcr call/',Result,'/', status Bcr=fltarr(max_records) ; (*_)(*^)*(%^% IDL Bcr=in_Bcr(0:max_records-1) CDF_VARPUT,h2_id,'Bcr',Bcr,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Bcr ',Result,'/', status cdf_varget,cdfid,'Energy_range',in_Energy_range, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Energy_range call/',Result,'/', status Energy_range=fltarr(max_records) ; (*_)(*^)*(%^% IDL Energy_range=in_Energy_range(0:max_records-1) CDF_VARPUT,h2_id,'Energy_range',Energy_range,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Energy_range ',Result,'/', status cdf_varget,cdfid,'Intervals',in_Intervals, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Intervals call/',Result,'/', status Intervals=fltarr(max_records) ; (*_)(*^)*(%^% IDL Intervals=in_Intervals(0:max_records-1) CDF_VARPUT,h2_id,'Intervals',Intervals,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Intervals ',Result,'/', status cdf_varget,cdfid,'SCPot_status',in_SCPot_status, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SCPot_status call/',Result,'/', status SCPot_status=fltarr(max_records) ; (*_)(*^)*(%^% IDL SCPot_status=in_SCPot_status(0:max_records-1) CDF_VARPUT,h2_id,'SCPot_status',SCPot_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SCPot_status ',Result,'/', status cdf_varget,cdfid,'SW_status',in_SW_status, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for SW_status call/',Result,'/', status SW_status=fltarr(max_records) ; (*_)(*^)*(%^% IDL SW_status=in_SW_status(0:max_records-1) CDF_VARPUT,h2_id,'SW_status',SW_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put SW_status ',Result,'/', status cdf_varget,cdfid,'Mag_status',in_Mag_status, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Mag_status call/',Result,'/', status Mag_status=fltarr(max_records) ; (*_)(*^)*(%^% IDL Mag_status=in_Mag_status(0:max_records-1) CDF_VARPUT,h2_id,'Mag_status',Mag_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Mag_status ',Result,'/', status cdf_varget,cdfid,'Orbit_status',in_Orbit_status, rec_count=max_records,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Orbit_status call/',Result,'/', status Orbit_status=fltarr(max_records) ; (*_)(*^)*(%^% IDL Orbit_status=in_Orbit_status(0:max_records-1) CDF_VARPUT,h2_id,'Orbit_status',Orbit_status,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Orbit_status ',Result,'/', status ;;;;;;;;;;;;;;;;;;;end of data variables the rest are ; ; here just for completeness ; set to get just one record... ; I don't understand what is in these variables ; wkp 3/30/00 cdf_varget,cdfid,'Mag_axis',Mag_axis, rec_count=1,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_varget for Mag_axis call/',Result,'/', status CDF_VARPUT,h2_id,'Mag_axis',Mag_axis,/zvariable Result=CDF_ERROR(status) if result ne 'CDF_OK: Function completed successfully.' then $ print, 'Status after cdf_put Mag_axis ',Result,'/', status CDF_CLOSE,cdfid CDF_CLOSE,h2_id print,'CDF FILEs CLOSED' print, 'now verify h2 files are good' print, 'read them in and so weiter ' start_year=0 start_month=0 start_day=0 stop_year=0 stop_month=0 stop_day=0 cdf_epoch, start_epoch(0,0), start_year, start_month, start_day,/breakdown cdf_epoch, stop_epoch(0,N_elements(R)-1),stop_year,stop_month, stop_day,hour,min,sec,/breakdown cdf_epoch, begin_of_day,start_year,start_month,start_day,/compute print, 'FILE: ' ,infile print, 'START: ',start_year, start_month, start_day print, 'STOP: ',stop_year, stop_month, stop_day, hour, min, sec ; put some plots here to !p.multi=[0,2,2] plot,(h_epoch-begin_of_day)/3600000.,H_fluence,/ylog, $ title='Upward H+ Fluence', xrange=[0,24], xstyle=1, yrange=[1e2, 1e10],ystyle=1, $ Xtitle='Year/Month/Day ='+string(start_year)+string(start_month)+string(Start_day) plot,(o_epoch-begin_of_day)/3600000.,O_fluence,/ylog, $ title='O+ Fluence', xrange=[0,24], xstyle=1, $ ; yrange=[-1e8, 1e10], $ live with bad plots such as 3/27/96 Xtitle='LAST H/M/S ='+string(hour)+string(min)+string(sec) plot,(he1_epoch-begin_of_day)/3600000.,He1_fluence,/ylog, $ title='He1+ Fluence', xrange=[0,24], xstyle=1, $ ; yrange=[-1e8, 1e10], $ live with bad plots such as 3/27/96 Xtitle='LAST H/M/S ='+string(hour)+string(min)+string(sec) plot,(he2_epoch-begin_of_day)/3600000.,He2_fluence,/ylog, $ title='He2+ Fluence', xrange=[0,24], xstyle=1, $ ; yrange=[-1e8, 1e10], $ live with bad plots such as 3/27/96 Xtitle='LAST H/M/S ='+string(hour)+string(min)+string(sec) !p.multi=[0,1,1] dum='' print,' Hit return to continue ;read,dum ;let it rip endwhile ; end of the big loop endfor ; end of the year loop stop end