Package pylal :: Module ligolw_dataUtils :: Class Data
[hide private]
[frames] | no frames]

Class Data

source code

object --+    
         |    
      dict --+
             |
            Data

Class to store statistics and livetime for plotting.

Nested Classes [hide private]
  DataElement
Sub-class to store individual data elements.
Instance Methods [hide private]
new empty dictionary

__init__(self)
A list of all the data elements is kept as an index.
source code
 
add_data(self, _id, categories, data)
Adds a new DataElement to self.
source code
None
update(self, _id, categories=[], data=None, addToExistingCat=True, errOnMissing=True)
Updates all DataElements in self that have the given id.
source code
 
add_livetime(self, livetime, category, match_criteria=[])
Adds livetime to all categories in self that match the given criteria.
source code
 
get_livetime(self, category, match_criteria=[], time_units='yr')
Returns the sum of all the livetimes of categories that match the given category via the given match_criteria.
source code
 
create_background(self, match_criteria=[])
Creates background categories out of the slide categories and adds this to all slide elements' categories lists.
source code
 
compute_cumrates(self, stat, foreground_datatype, rank_by='max', group_by=[], num_slides=100.)
Computes the cumulative rates for all the distinct groups that exist in self.
source code
 
get_cumrates(self, group, stat, rank_by='max')
Returns a sorted list (by stat) of stats, cumrates, and ids for the given group.
source code
 
get_data(self, _id=None, category=None, category_match_criteria=[])
Returns a list of DataElements that matches a given id, a given category, or both.
source code
 
get_categories(self, category, match_criteria=[])
Returns a list of categories in self that match the given category via the match_criteria.
source code
 
collapse(self, args)
Cycles over the DataElements in self, keeping only the given args.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

A list of all the data elements is kept as an index.

Returns:
new empty dictionary

Overrides: object.__init__

update(self, _id, categories=[], data=None, addToExistingCat=True, errOnMissing=True)

source code 

Updates all DataElements in self that have the given id. If no DataElement is found with the given id and errOnMissing is False, adds a new entry.

Returns: None
Overrides: dict.update

create_background(self, match_criteria=[])

source code 

Creates background categories out of the slide categories and adds this to all slide elements' categories lists. Default action is to create a background for each veto-category, on_instruments, ifos, and param_group. However, this can be overridden with the match_criteria argument.

compute_cumrates(self, stat, foreground_datatype, rank_by='max', group_by=[], num_slides=100.)

source code 

Computes the cumulative rates for all the distinct groups that exist in self. Distinct groups are determined by group_by.

get_data(self, _id=None, category=None, category_match_criteria=[])

source code 

Returns a list of DataElements that matches a given id, a given category, or both. If category_match_criteria is specified, will get data that matches the specified elements in category. Otherwise, will use Category.default_match_criteria for comparing category to the stored categories.