IOM_plugin_lincombwp¶
About the IOM_plugin_lincombwp class¶
The WaveBlocks Project
@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License
Class documentation¶
The WaveBlocks Project
IOM plugin providing functions for handling linear combinations of general wavepackets.
@author: R. Bourquin @copyright: Copyright (C) 2013, 2016 R. Bourquin @license: Modified BSD License
-
IOM_plugin_lincombwp.add_lincombwp(self, parameters, timeslots=None, lincombsize=None, blockid=0)[source]¶ Add storage for the linear combination of general wavepackets.
Parameters: - parameters – An
ParameterProviderinstance with at least the keyncomponents. - timeslots – The number of time slots we need. Can be set to
Noneto get automatically growing datasets. - lincombsize – The (maximal) size
Jof the linear combination of wavepackets. If specified this remains fixed for all timeslots. Can be set toNone(default) to get automatically growing datasets. - blockid – The ID of the data block to operate on.
- parameters – An
-
IOM_plugin_lincombwp.delete_lincombwp(self, blockid=0)[source]¶ Remove the stored linear combination.
Parameters: blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.has_lincombwp(self, blockid=0)[source]¶ Ask if the specified data block has the desired data tensor.
Parameters: blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.load_lincombwp(self, timestep, blockid=0)[source]¶ Load a linear combination at a given timestep and return a fully configured
LinearCombinationOfWPsinstance. This method just calls some otherIOManagermethods in the correct order. It is included only for convenience and is not particularly efficient.Parameters: - timestep – The timestep
we load the wavepacket. - blockid – The ID of the data block to operate on.
Returns: A
LinearCombinationOfWPsinstance.- timestep – The timestep
-
IOM_plugin_lincombwp.load_lincombwp_coefficients(self, timestep=None, blockid=0)[source]¶ Load the coefficients of this linear combination.
Parameters: - timestep – Load only the data of this timestep.
- blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.load_lincombwp_description(self, blockid=0)[source]¶ Load the description of this linear combination.
Parameters: blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.load_lincombwp_size(self, timestep=None, blockid=0)[source]¶ Load the size (number of packets) of this linear combination.
Parameters: - timestep – Load only the data of this timestep.
- blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.load_lincombwp_timegrid(self, blockid=0, key=('coeffs', 'packets'))[source]¶ Load the timegrid of this linear combination.
Parameters: - blockid – The ID of the data block to operate on.
- key (Tuple of valid identifier strings that are
coeffsandpackets. Default is("coeffs", "packets").) – Specify which linear combination timegrids to load. All are independent.
-
IOM_plugin_lincombwp.load_lincombwp_wavepacket_refs(self, timestep=None, blockid=0)[source]¶ Load the references of the wavepackets being part of this linear combination. References can be used as
blockidfor loading selected wavepackets manually. If for example arefobtained through this method is:>>> refs = anIom.load_lincombwp_wavepacket_refs(timestep=4) >>> refs array(['673290fd36a0fa80f28973ae31f10378', '075dc9d7d2c558c97608e2fe08a7d53d', '0aed8bf3e21b5894bf89ef894d3f7d0c'], dtype='|S32')
>>> ref = refs[0] '673290fd36a0fa80f28973ae31f10378'
the the corresponding block ID is:
>>> bid = "LC" + str(blockid) + "WP" + ref 'LC0WP673290fd36a0fa80f28973ae31f10378'
with
blockidthe block ID where the linear combination was stored. With thatbidwe can now for example load data of a selected wavepacket:>>> Pi = anIom.load_wavepacket_parameters(timestep=4, blockid=bid)
in case of a Hagedorn wavepacket.
Parameters: - timestep – Load only the data of this timestep.
- blockid – The ID of the data block to operate on.
Returns: A
ndarrayof strings.
-
IOM_plugin_lincombwp.load_lincombwp_wavepackets(self, timestep, packetindex=None, blockid=0)[source]¶ Load the wavepackets being part of this linear combination.
Note that this is quite an expensive operation.
Parameters: - timestep – Load only the data of this timestep.
- packetindex – Load only the packet with this index. If
Nonethen load all packets for the given timestep. - blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.save_lincombwp(self, lincomb, timestep, blockid=0)[source]¶ Save a linear combination of general wavepackets at a given timestep and read all data to save from the
LinearCombinationOfWPsinstance provided. This method just calls some otherIOManagermethods in the correct order. It is included only for convenience and is not particularly efficient. We assume the linear combination is already set up with the correctadd_lincombwp()method call.Parameters: - lincomb – The
LinearCombinationOfWPsinstance we want to save. - timestep – The timestep
at which we save the linear combination. - blockid – The ID of the data block to operate on.
- lincomb – The
-
IOM_plugin_lincombwp.save_lincombwp_coefficients(self, coefficients, timestep=None, blockid=0)[source]¶ Save the coefficients of the linear combination to a file.
Parameters: - coefficients (A single, suitable
ndarray.) – The coefficients of the linear combination of wavepackets. - timestep – The timestep at which we save the data.
- blockid – The ID of the data block to operate on.
- coefficients (A single, suitable
-
IOM_plugin_lincombwp.save_lincombwp_description(self, descr, blockid=0)[source]¶ Save the description of this linear combination.
Parameters: - descr – The description.
- blockid – The ID of the data block to operate on.
-
IOM_plugin_lincombwp.save_lincombwp_wavepackets(self, packetlist, timestep=None, blockid=0)[source]¶ Save the wavepackets being part of this linear combination.
Warning
This is quite an expensive operation.
Parameters: - timestep – Load only the data of this timestep.
- blockid – The ID of the data block to operate on.