Author: bugman Date: Thu Jan 24 10:57:51 2013 New Revision: 18291 URL: http://svn.gna.org/viewcvs/relax?rev=18291&view=rev Log: Implemented the N-state model specific return_data() method. This is needed for bootstrapping. Modified: trunk/specific_fns/n_state_model.py Modified: trunk/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_fns/n_state_model.py?rev=18291&r1=18290&r2=18291&view=diff ============================================================================== --- trunk/specific_fns/n_state_model.py (original) +++ trunk/specific_fns/n_state_model.py Thu Jan 24 10:57:51 2013 @@ -2347,6 +2347,33 @@ return self._param_num(), self._num_data_points(), cdp.chi2 + def return_data(self, data_id): + """Return the base data for the given data ID. + + @keyword data_id: The list of spin ID, data type, and alignment ID, as yielded by the base_data_loop() generator method. + @type data_id: list of str + @return: The base data. + @rtype: float + """ + + # Alias the spin or interatomic data container, data type and alignment ID. + container = data_id[0] + data_type = data_id[1] + align_id = data_id[2] + + # Return the RDC data. + if data_type == 'rdc' and hasattr(container, 'rdc') and align_id in container.rdc: + return container.rdc[align_id] + + # Return the NOESY data. + if data_type == 'noesy' and hasattr(container, 'noesy'): + return container.noesy + + # Return the PCS data. + if data_id[1] == 'pcs' and hasattr(container, 'pcs') and align_id in container.pcs: + return container.pcs[align_id] + + return_data_name_doc = Desc_container("N-state model data type string matching patterns") _table = uf_tables.add_table(label="table: N-state data type patterns", caption="N-state model data type string matching patterns.") _table.add_headings(["Data type", "Object name", "Patterns"])