edges.analysis.datamodel

Data models for GSData objects.

class edges.analysis.datamodel.GSDataLinearModel(model: Model, parameters: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Quantity | None)[source]

A model of a GSData object.

classmethod from_gsdata(model: ~edges.modeling.core.Model, gsdata: ~pygsdata.gsdata.GSData, nsamples_strategy: <NsamplesStrategy.FLAGGED_NSAMPLES: 0>, **fit_kwargs) Self[source]

Create a GSDataModel from a GSData object.

Parameters:
  • model – The model to use. Applied separately to each time, load and pol.

  • gsdata (GSData object) – The GSData object to fit to.

  • nsamples_strategy – The strategy to use when defining the weights of each sample.

classmethod from_h5(fl: File | Group, path: str = '') Self[source]

Read the object from an HDF5 file, potentially from a particular path.

get_residuals(gsdata: GSData) ndarray[source]

Calculate the residuals of the model given the input GSData object.

get_spectra(gsdata: GSData) ndarray[source]

Calculate the data spectra given the input GSData object.

property nloads: int

Number of loads in the model.

property nparams: int

Number of parameters in the model.

property npols: int

Number of polarisations in the model.

property ntimes: int

Number of times in the model.

update(**kw) Self[source]

Return a new GSDataModel instance with updated attributes.

write(fl: File | Group, path: str = '')[source]

Write the object to an HDF5 file, potentially to a particular path.

edges.analysis.datamodel.add_model(data: GSData, *, model: Model, nsamples_strategy: NsamplesStrategy = NsamplesStrategy.FLAGGED_NSAMPLES) GSData[source]

Return a new GSData instance which contains a data model.

Parameters:
  • data – The GSData instance to add the model to.

  • model – The model to add/fit.

  • append_to_file – Whether to directly add the model residuals to the file that is attached to the GSData object. DON’T DO THIS.

  • nsamples_strategy – The strategy to use when defining the weights of each sample.