firecrown.utils.save_to_sacc#
- firecrown.utils.save_to_sacc(sacc_data, data_vector, indices, strict=True)[source]#
Save a data vector into a (new) SACC object, copied from sacc_data.
Note that the original object sacc_data is not modified. Its contents are copied into a new object, and the new information is put into that copy, which is returned by this method.
If strict is True (the default), then we must overwrite the entire data vector. If strict is False, then we only overwrite the data at the specified indices.
- Parameters:
sacc_data (
Sacc) – SACC object to be copied. It is not modified.data_vector (
ndarray[tuple[int,...],dtype[float64]]) – Data vector to be saved to the new copy of sacc_data.indices (
ndarray[tuple[int,...],dtype[int64]]) – SACC indices where the data vector should be written.strict (
bool) – Whether to check if the data vector covers all the data already present in the sacc_data.
- Return type:
Sacc- Returns:
A copy of sacc_data, with data at indices replaced with data_vector.