Enable using multiple and multi-banded ROQ bases
This patch enables using multiple ROQ bases in a single PE run and computing ROQ weights from multi-banded bases. The new file format of ROQ basis and weights for this code change is described here. We discussed this new file format in a PE call and decided to continue discussions in this MR. This code change does not break the workflow of using conventional .npy bases, .npz weights or .json weights.
The main code changes are summarized below:
-
self.weights["{ifo}_linear/quadratic"]
is now not a single ndarray of ROQ weights but a list of ndarrays for the use of multiple ROQ bases. The propertybasis_number_linear/quadratic
specifies which basis should be used, and is automatically updated based onself.parameters
. -
self.weights
containsfrequency_nodes_linear/quadratic
, which is a list of ndarrays of frequency nodes. Whenself.waveform_generator
is called, its frequency nodes is automatically updated toself.weights["frequency_nodes_linear/quadratic"][self.basis_number_linear/quadratic]
. -
self.weights
containsprior_range_linear/quadratic
as it is necessary information to determine which basis should be used for a likelihood evaluation. - Only weights with the .hdf5 format can contain multiple weights. If another format is used for multiple weights, ValueError is raised.
- Basis numbers and frequency nodes are not updated when
self.parameters
is the same as cached parameters or only a single basis is used. - If conventional .npy basis, .npz weight or .json weight is passed, the likelihood automatically assumes it uses only a single basis.
-
_set_weights_linear/quadratic_multiband
are implemented to compute ROQ weights from multibanded bases using the algorithm introduced in arXiv:2104.07813. -
roq_params
are automatically retrieved from .hdf5 basis if not specified.
Edited by Soichiro Morisaki