#Autoplot jython script, R. Friedel, October 13, 2012 # #LABEL: EMFISIS / MagEphem Data minus model comparison #TITLE: EMFISIS / MagEphem Data minus model comparison #DESCRIPTION: Quicklook Emfisis GSM mag field minus gsm evaluated magentic field model data tr= getParam( 'timerange', '2012-09-26', 'timerange to load' ) sc= getParam( 'sc', 'rbspa', 'RBSP Spacecraft Name', ['rbspa','rbspb'] ) co= getParam( 'co', 'xdiff', 'Coordinate', ['xdiff','ydiff', 'zdiff'] ) scab= sc[-1] scui= sc[0:4]+'-'+scab # U. Iowa is rbsp-a #File to read for the emfisis mag field data f1_root='http://emfisis.physics.uiowa.edu/Flight/RBSP-%s/L3/$Y/$m/$d/' % scab.upper() f1=f1_root+'%s_magnetometer_4sec-gsm_emfisis-L3_$Y$m$d_v$(v,sep).cdf' % (scui) monitor.setTaskSize(10) monitor.started() print f1 + '?Mag&timerange=%s' % (tr) ds1= getDataSet( f1 + '?Mag&timerange=%s' % (tr), monitor.getSubtaskMonitor(0,5,'read mag') ) T= ds1.property(QDataSet.DEPEND_0) #File to read for the MagEphem model mag data f2_root='http://www.rbsp-ect.lanl.gov/data_pub/%s/MagEphem/pre/' % (sc) f2=f2_root+'%s_pre_MagEphem_OP77Q_$Y$m$d_v1.0.0.txt' % (sc) print f2 + '?column=Bsc_gsm&timerange=%s' % (tr) ds2= getDataSet( f2 + '?column=Bsc_gsm&timerange=%s' % (tr), monitor.getSubtaskMonitor(5,10,'get Bsc_gsm') ) # getb indices to interpolate onto data resolution ff= findex( ds2.property( QDataSet.DEPEND_0 ), T ) x_gsm_model= interpolate(ds2[:,0], ff) y_gsm_model= interpolate(ds2[:,1], ff) z_gsm_model= interpolate(ds2[:,2], ff) x_gsm_diff= ds1[:,0] - x_gsm_model y_gsm_diff= ds1[:,1] - y_gsm_model z_gsm_diff= ds1[:,2] - z_gsm_model x_gsm_diff.putProperty( QDataSet.DEPEND_0, T) y_gsm_diff.putProperty( QDataSet.DEPEND_0, T) z_gsm_diff.putProperty( QDataSet.DEPEND_0, T) if (co=='xdiff'): result = x_gsm_diff result= putProperty( result, QDataSet.LABEL, 'B X GSM - Model, nT' ) result= putProperty( result, QDataSet.TITLE, 'B Field X - B Model X (GSM)' ) elif (co=='ydiff'): result = y_gsm_diff result= putProperty( result, QDataSet.LABEL, 'B Y GSM - Model, nT' ) result= putProperty( result, QDataSet.TITLE, 'B Field Y - B Model Y (GSM)' ) else: result = z_gsm_diff result= putProperty( result, QDataSet.LABEL, 'B Z GSM - Model, nT' ) result= putProperty( result, QDataSet.TITLE, 'B Field Z - B Model Z (GSM)' )