# Format the HOPE FEDU data into separate ascii tables for each of the sectors # for detector 3, which I believe is the belly band of RBSP. # Modes starting with 24.974eV are selected and exported while other modes are # dropped. It is assumed that the first channel (containing 24.794eV) will be # different for different modes. TODO: check on this with HOPE team. tr= getParam( 'timerange', '2012-11-01', 'timerange to load' ) sc= getParam( 'sc', 'b', 'RBSP Spacecraft', [ 'a','b'] ) from java.io import File print 'formatting data to %s..' % ( File('.').getAbsolutePath() ) ff= 'http://www.rbsp-ect.lanl.gov/data_pub/rbsp%s/hope/level2/rbsp%s_rel01_ect-hope-sci-L2_$Y$m$d_v$(v,sep).cdf' % ( sc,sc ) ds= getDataSet( '%s?FEDU' % ff, tr, monitor ) idet=2 # detector 3, which I believe is the belly band of RBSP sects= ds.property( QDataSet.DEPEND_2 ) dets= ds.property( QDataSet.DEPEND_1 ) ens= ds.property( QDataSet.DEPEND_3 ) if ( ens.rank()!=2 ): raise Exception('expected ens.rank()==2') # make sure the energies are constant by omitting modes where the energies are different. modeEnergy0= dataset( '24.974 eV' ) epsilon= dataset('0.01 eV') rmode= where( abs(ens[:,0]-modeEnergy0).lt(epsilon) ) # this assumes that the first channel will be different for different modes. TODO: check on this with HOPE team ens= ens[rmode[0]] ds= ds[rmode] ds= putProperty( ds, QDataSet.DEPEND_3, ens ) ds= putProperty( ds, QDataSet.BUNDLE_3, None ) for isect in xrange(16): ds1= ds[:,idet,isect,:] ds1= putProperty( ds1, QDataSet.TITLE, 'HOPE DEF @ %s %s' % ( dets[idet], sects[isect] ) ) sfilename= 'hope.fedu.sect%02d.%s.dat' % ( isect, tr ) print 'formatting data to %s...' % ( File( sfilename ).getAbsolutePath() ) formatDataSet( ds1,sfilename ) print 'done.'