src::smalldata::SmallData Class Reference

List of all members.

Public Member Functions

def __init__
def master
def currevt
def missing
def event
def sum
def max
def min
def save
def close

Detailed Description

On master,
  * numbers (int/float) are lists of arrays, representing workers (items
    in the list) and events (items in the array)
  * arrays are lists of lists (!) of arrays, representing workers (items
    in the outter list) and events (items in the inner list) and values
    of the original array (arrays)

Definition at line 101 of file smalldata.py.


Member Function Documentation

def src::smalldata::SmallData::__init__ (   self,
  datasource_parent,
  filename = None,
  save_on_gather = False 
)

Parameters
----------
gather_interval : int
    The number of events a single process must see before the results
    get gathered for processing. If `None`, then only gather results
    when `save` is called.

save_on_gather : bool
    Whether to save the results to disk periodically (after the
    results get gathered)

Definition at line 104 of file smalldata.py.

def src::smalldata::SmallData::close (   self  ) 

Close the HDF5 file used for writing.

Definition at line 774 of file smalldata.py.

def src::smalldata::SmallData::currevt (   self  ) 

Definition at line 145 of file smalldata.py.

def src::smalldata::SmallData::event (   self,
  args,
  kwargs 
)

Save some data from this event for later use.

Parameters
----------
*args : dictionaries
    Save HDF5 group heirarchies using nested dictionaries. Each level
    of the dictionary is a level in the HDF5 group heirarchy.

**kwargs : datasetname, dataset
    Save an arbitrary piece of data from this run. The kwarg will
    give it an (HDF5 dataset) name that appears in the resulting 
    HDF5 file.

Examples
--------
>>> # save the status of a laser
>>> smldata.event(laser_on=laser_on)

>>> # save "data' at a special location "/base/next_group/data"
>>> smldata.event({'base': {'next_group' : data}})

Definition at line 447 of file smalldata.py.

def src::smalldata::SmallData::master (   self  ) 

Definition at line 140 of file smalldata.py.

def src::smalldata::SmallData::max (   self,
  value 
)

Definition at line 602 of file smalldata.py.

def src::smalldata::SmallData::min (   self,
  value 
)

Definition at line 606 of file smalldata.py.

def src::smalldata::SmallData::missing (   self,
  key 
)

Use the send_list to figure out the correct types and fill
values for missing data

Definition at line 184 of file smalldata.py.

def src::smalldata::SmallData::save (   self,
  args,
  kwargs 
)

Save registered data to an HDF5 file.

There are 3 behaviors of the arguments to this function:

    1. Decide what 'event data' (declared by SmallData.event())
       should be saved
    2. Add summary (ie. any non-event) data using key-value
       pairs (similar to SmallData.event())
    3. Add summary (ie. any non-event) data organized in a
       heirarchy using nested dictionaries (als similar to 
       SmallData.event())

These data are then saved to the file specifed in the SmallData
constructor.

Parameters
----------
*args : strings
    A list of the event data names to save, if you want to save a
    subset. Otherwise save all data to disk. For example, imagine
    you had called SmallData.event(a=..., b=...). Then smldata.save('b')
    would not save data labelled 'a'. smldata.save() would save both
    'a' and 'b'.

*args : dictionaries
    In direct analogy to the SmallData.event call, you can also pass
    HDF5 group heirarchies using nested dictionaries. Each level
    of the dictionary is a level in the HDF5 group heirarchy.

**kwargs : datasetname, dataset
    Similar to SmallData.event, it is possible to save arbitrary
    singleton data (e.g. at the end of a run, to save an average over
    some quanitity).

event_data : bool
    Special kwarg. If `False`, do not save the event data, just
    the run summary data. If `True` (default), do.

Examples
--------
>>> # save all event data
>>> smldata.save()

>>> # save all event data AND "array_containing_sum"
>>> smldata.save(cspad_sum=array_containing_sum)

>>> # save 'b' event data, and no other
>>> smldata.save('b')

>>> # save all event data AND "/base/next_group/data"
>>> smldata.save({'base': {'next_group' : data}})

Definition at line 647 of file smalldata.py.

def src::smalldata::SmallData::sum (   self,
  value 
)

Definition at line 598 of file smalldata.py.


The documentation for this class was generated from the following file:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7