コード例 #1
0
 def lbl(self, name):
     if name.lower() == 'lshell':
         return format(self.avg('lshell'), '.1f')
     elif name.lower() == 'mlt':
         return notex(timestr(3600 * self.avg('mlt'))[1][:5])
     elif name.lower() == 'mlat':
         return notex(format(self.avg('mlat'), '+.0f') + '^\\circ')
     else:
         return '???'
コード例 #2
0
ファイル: day.py プロジェクト: UMN-Space-Physics/rbsp-ulf
 def lbl(self, name):
   if name.lower()=='lshell':
     return format(self.avg('lshell'), '.1f')
   elif name.lower()=='mlt':
     return notex( timestr( 3600*self.avg('mlt') )[1][:5] )
   elif name.lower()=='mlat':
     return notex(format(self.avg('mlat'), '+.0f') + '^\\circ')
   else:
     return '???'
コード例 #3
0
ファイル: day.py プロジェクト: UMN-Space-Physics/rbsp-ulf
 def descr(self, mode, imax=None, harm=None):
   sfft = self.sfft(mode)
   # Choose the mode with the most power in the standing wave. 
   if imax is None:
     imax = np.argmax( np.abs( np.imag(sfft) ) )
   # Figure out the harmonic parity. 
   if harm is None:
     harm = self.harm(mode)[imax]
   # Give the structure of this wave. 
   modename = notex( {'p':'POL', 't':'TOR'}[mode] )
   harmname = notex( {1:'ODD', 2:'EVEN'}[harm] )
   freqname = 'f=' + format(self.frq()[imax], '.0f') + tex('mHz')
   lllsname = tex('L3S') + '=(' + cmt(sfft[imax], digs=2) + ')' + tex('mW/m^2')
   return '\\;\\;'.join( (modename, harmname, freqname, lllsname) )
コード例 #4
0
 def descr(self, mode, imax=None, harm=None):
     sfft = self.sfft(mode)
     # Choose the mode with the most power in the standing wave.
     if imax is None:
         imax = np.argmax(np.abs(np.imag(sfft)))
     # Figure out the harmonic parity.
     if harm is None:
         harm = self.harm(mode)[imax]
     # Give the structure of this wave.
     modename = notex({'p': 'POL', 't': 'TOR'}[mode])
     harmname = notex({1: 'ODD', 2: 'EVEN'}[harm])
     freqname = 'f=' + format(self.frq()[imax], '.0f') + tex('mHz')
     lllsname = tex('L3S') + '=(' + cmt(sfft[imax],
                                        digs=2) + ')' + tex('mW/m^2')
     return '\\;\\;'.join((modename, harmname, freqname, lllsname))
コード例 #5
0
 def coords(self, style, cramped=False):
     # Assemble a keyword dictionary to be plugged right into the Plot Window.
     kargs = {}
     # Plot electric and magnetic fields as a function of time.
     if style.lower().startswith('wave'):
         # Horizontal axis.
         kargs['x'] = self.get('t')
         kargs['xlims'] = (self.t0, self.t1)
         kargs['xlabel'] = notex('Time (hh:mm)')
         nxticks = 5 if cramped else 9
         kargs['xticks'] = np.linspace(self.t0, self.t1, nxticks)
         kargs['xticklabels'] = [
             '$' + notex(timestr(t)[1][:5]) + '$' for t in kargs['xticks']
         ]
         kargs['xticklabels'][1::2] = [''] * len(kargs['xticklabels'][1::2])
         # Vertical axis.
         #      kargs['ylabel'] = notex('\\cdots (nT ; \\frac{mV}{m})')
         kargs['ylabel'] = notex('E  (\\frac{mV}{m})   B  (nT)')
         kargs['ylabelpad'] = -2
         kargs['ylims'] = (-4, 4)
         kargs['yticks'] = range(-4, 5)
         kargs['yticklabels'] = ('$-4$', '', '$-2$', '', '$0$', '', '$+2$',
                                 '', '$+4$')
     # Plot coherence, cross-spectral density, etc in the frequency domain.
     else:
         # Horizontal axis.
         kargs['x'] = self.frq()
         kargs['xlims'] = (0, 40)
         kargs['xlabel'] = notex('Frequency (mHz)')
         nxticks = 5 if cramped else 9
         kargs['xticks'] = np.linspace(0, 40, nxticks)
         kargs['xticklabels'] = [
             '$' + znt(t) + '$' for t in kargs['xticks']
         ]
         kargs['xticklabels'][1::2] = [''] * len(kargs['xticklabels'][1::2])
         # Vertical axis.
         kargs['ylabel'] = tex('S') + notex(' (\\frac{mW}{m^2})')
         kargs['ylims'] = (-3, 0)
         kargs['yticks'] = (-3., -2.5, -2., -1.5, -1., -0.5, 0.)
         kargs['yticklabels'] = ('$0.001$', '', '$0.01$', '', '$0.1$', '',
                                 '$1$')
         kargs['axright'] = True
         ylabelpad = -50
     return kargs
コード例 #6
0
ファイル: day.py プロジェクト: UMN-Space-Physics/rbsp-ulf
  def coords(self, style, cramped=False):
    # Assemble a keyword dictionary to be plugged right into the Plot Window. 
    kargs = {}
    # Plot electric and magnetic fields as a function of time. 
    if style.lower().startswith('wave'):
      # Horizontal axis. 
      kargs['x'] = self.get('t')
      kargs['xlims'] = (self.t0, self.t1)
      kargs['xlabel'] = notex('Time (hh:mm)')
      nxticks = 5 if cramped else 9
      kargs['xticks'] = np.linspace(self.t0, self.t1, nxticks)
      kargs['xticklabels'] = [ '$' + notex( timestr(t)[1][:5] ) + '$' for t in kargs['xticks'] ]
      kargs['xticklabels'][1::2] = ['']*len( kargs['xticklabels'][1::2] )
      # Vertical axis. 
#      kargs['ylabel'] = notex('\\cdots (nT ; \\frac{mV}{m})')
      kargs['ylabel'] = notex('E  (\\frac{mV}{m})   B  (nT)')
      kargs['ylabelpad'] = -2
      kargs['ylims'] = (-4, 4)
      kargs['yticks'] = range(-4, 5)
      kargs['yticklabels'] = ('$-4$', '', '$-2$', '', '$0$', '', '$+2$', '', '$+4$')
    # Plot coherence, cross-spectral density, etc in the frequency domain. 
    else:
      # Horizontal axis. 
      kargs['x'] = self.frq()
      kargs['xlims'] = (0, 40)
      kargs['xlabel'] = notex('Frequency (mHz)')
      nxticks = 5 if cramped else 9
      kargs['xticks'] = np.linspace(0, 40, nxticks)
      kargs['xticklabels'] = [ '$' + znt(t) + '$' for t in kargs['xticks'] ]
      kargs['xticklabels'][1::2] = ['']*len( kargs['xticklabels'][1::2] )
      # Vertical axis. 
      kargs['ylabel'] = tex('S') + notex(' (\\frac{mW}{m^2})')
      kargs['ylims'] = (-3, 0)
      kargs['yticks'] = (-3., -2.5, -2., -1.5, -1., -0.5, 0.)
      kargs['yticklabels'] = ('$0.001$', '', '$0.01$', '', '$0.1$', '', '$1$')
      kargs['axright'] = True
      ylabelpad = -50
    return kargs
コード例 #7
0
ファイル: day.py プロジェクト: UMN-Space-Physics/rbsp-ulf
 def label(self):
   probename = notex( 'RBSP-' + self.probe.upper() )
   lname = 'L\\!=\\!' + self.lbl('lshell')
   mltname = self.lbl('mlt') + notex('MLT')
   mlatname = self.lbl('mlat') + notex('MLAT')
   lppname = 'L_{PP}\\!=\\!' + format(self.lpp, '.1f')
   dstname = notex('Dst') + '\\!=\\!' + format(self.dst, '.0f') + notex('nT')
   t0name = timestr(self.t0)[1][:5]
   t1name = timestr(self.t1)[1][:5]
   return '\\quad{}'.join( (probename, notex(self.date), lname, mltname, mlatname, lppname, dstname) )
コード例 #8
0
 def label(self):
     probename = notex('RBSP-' + self.probe.upper())
     lname = 'L\\!=\\!' + self.lbl('lshell')
     mltname = self.lbl('mlt') + notex('MLT')
     mlatname = self.lbl('mlat') + notex('MLAT')
     lppname = 'L_{PP}\\!=\\!' + format(self.lpp, '.1f')
     dstname = notex('Dst') + '\\!=\\!' + format(self.dst,
                                                 '.0f') + notex('nT')
     t0name = timestr(self.t0)[1][:5]
     t1name = timestr(self.t1)[1][:5]
     return '\\quad{}'.join((probename, notex(self.date), lname, mltname,
                             mlatname, lppname, dstname))