FluxComponents#
- class jolideco.models.FluxComponents(modules: Mapping[str, Module] | None = None)[source]#
Bases:
ModuleDictFlux components
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Attributes Summary
Usampled total flux
Total summed flux (~torch.tensor)
Usampled total flux
Fluxes (dict of ~numpy.ndarray)
Upsampled fluxes (dict of ~numpy.ndarray)
Priors associated with the componenet
Methods Summary
from_dict(data)Create flux components from dict
Parameter list
plot([figsize, kwargs_norm])Plot images of the flux components
read(filename[, format])Read flux components from file
set_flux_errors(flux_errors)Set flux errors
to_dict([include_data])Convert flux component configuration to dict, with simple data types.
Fluxes as tuple (tuple of ~torch.tensor)
to_numpy()Fluxes of the components (dict of ~numpy.ndarray)
write(filename[, overwrite, format])Write flux components to file
Attributes Documentation
- flux_total_numpy#
Usampled total flux
- flux_upsampled_total#
Total summed flux (~torch.tensor)
- flux_upsampled_total_numpy#
Usampled total flux
- fluxes_numpy#
Fluxes (dict of ~numpy.ndarray)
- fluxes_upsampled_numpy#
Upsampled fluxes (dict of ~numpy.ndarray)
- priors#
Priors associated with the componenet
Methods Documentation
- classmethod from_dict(data)[source]#
Create flux components from dict
- Parameters:
data (dict) – Parameter dict.
- Returns:
flux_components – Flux components
- Return type:
FluxComponents
- classmethod read(filename, format=None)[source]#
Read flux components from file
- Parameters:
filename (str or Path) – Output filename
format ({'asdf', 'yaml', 'fits'}) – Format to use.
- Returns:
flux_components – Flux components
- Return type:
FluxComponents