Changeset 14471


Ignore:
Timestamp:
10/11/12 00:55:59 (12 years ago)
Author:
neise
Message:
fixed identation of former checkin
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/doc/examples.rst

    r14470 r14471  
    115115Have a look::
    116116
    117 #!/usr/bin/python -tti
    118 
    119 import time
    120 import numpy as np
    121 from pyfact import SlowData
    122 
    123 f = SlowData('20120601.FTM_STATIC_DATA.fits')
    124 #
    125 # do here --> f.show() if you are not sure about the column names
    126 #
    127 f.register('PatchThresh')
    128 f.register('Time')
    129 f.stack()
    130 
    131 # now loop over the file and let SlowData do the magic
    132 for row in f:
    133     pass
    134    
    135 # the stacked data can be found in the dict SlowData.stacked_cols
    136 # put the Time array into a variable and convert into seconds since 01.01.1970
    137 t = f.stacked_cols['Time'] * 24. * 3600
    138 
    139 # put the thresholds into another var, for convenience
    140 dtr = f.stacked_cols['PatchThresh']
    141 
    142 # give the user some diagnostic info
    143 print 'start time:', time.asctime(time.gmtime(t[0]))
    144 print 'stop time:', time.asctime(time.gmtime(t[-1]))
    145 
    146 print 'mean/median threshold:', dtr.mean(), np.median(dtr)
    147 print 'min/max threshold:', dtr.min(), dtr.max()
    148 print 'std deviation:', dtr.std()
     117  #!/usr/bin/python -tti
     118 
     119  import time
     120  import numpy as np
     121  from pyfact import SlowData
     122 
     123  f = SlowData('20120601.FTM_STATIC_DATA.fits')
     124  #
     125  # do here --> f.show() if you are not sure about the column names
     126  #
     127  f.register('PatchThresh')
     128  f.register('Time')
     129  f.stack()
     130 
     131  # now loop over the file and let SlowData do the magic
     132  for row in f:
     133      pass
     134     
     135  # the stacked data can be found in the dict SlowData.stacked_cols
     136  # put the Time array into a variable and convert into seconds since 01.01.1970
     137  t = f.stacked_cols['Time'] * 24. * 3600
     138 
     139  # put the thresholds into another var, for convenience
     140  dtr = f.stacked_cols['PatchThresh']
     141 
     142  # give the user some diagnostic info
     143  print 'start time:', time.asctime(time.gmtime(t[0]))
     144  print 'stop time:', time.asctime(time.gmtime(t[-1]))
     145 
     146  print 'mean/median threshold:', dtr.mean(), np.median(dtr)
     147  print 'min/max threshold:', dtr.min(), dtr.max()
     148  print 'std deviation:', dtr.std()
    149149
    150150
Note: See TracChangeset for help on using the changeset viewer.