# filter below a threshold T
from array import array
import string
from math import log


resourcesc= getParam( 'resourcesc', 'A', 'Spacecraft', ['A','B'])
resourcetype= getParam( 'resourcetype', '-diagonal-merged', 'File Type to Open', ['','-diagonal','-diagonal-burst','-diagonal-merged'])
resourcechannel= getParam('resourcechannel', 'BuBu', 'Channel',['BuBu','BvBv','BwBw','EuEu','EvEv','EwEw'])
resourcefactor= getParam( 'NoiseFactor', 0.65, 'Noise level factor' )
lowsc= resourcesc.lower()

resourcefile_on='http://emfisis.physics.uiowa.edu/events/rbsp-'+lowsc+'/backgrounds/peak_wfr_'+resourcechannel[0:2].lower()+'_'+resourcesc+'_attenuator_on.qds'
resourcefile_off='http://emfisis.physics.uiowa.edu/events/rbsp-'+lowsc+'/backgrounds/peak_wfr_'+resourcechannel[0:2].lower()+'_'+resourcesc+'_attenuator_off.qds'
inputfile='http://emfisis.physics.uiowa.edu/Flight/RBSP-'+resourcesc+'/L2/$Y/$m/$d/rbsp-'+lowsc+'_WFR-spectral-matrix'+resourcetype+'_emfisis-L2_$Y$m$d_v$(v,sep).cdf?'
inputfileALT='http://emfisis.physics.uiowa.edu/Flight/RBSP-'+resourcesc+'/Quick-Look/$Y/$m/$d/rbsp-'+lowsc+'_WFR-spectral-matrix'+resourcetype+'_emfisis-Quick-Look_$Y$m$d_v$(v,sep).cdf?'

ttr= getParam( 'timerange', '2012-10-01', 'timerange to load' )