SpatialFluxComponent#
- class jolideco.models.SpatialFluxComponent(flux_upsampled, flux_upsampled_error=None, mask=None, use_log_flux=True, upsampling_factor=1, prior=None, frozen=False, wcs=None)[source]#
Bases:
Module
Flux component
- flux_upsampled#
Initial flux tensor
- Type:
~torch.Tensor
- flux_upsampled_error#
Flux tensor error
- Type:
~torch.Tensor
- upsampling_factor#
Spatial upsampling factor for the flux.
- Type:
None
- prior#
Prior for this flux component.
- Type:
Prior
- wcs#
World coordinate transform object
- Type:
~astropy.wcs.WCS
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Attributes Summary
Flux as torch tensor
Flux as numpy array
Flux
Flux error as torch tensor
Flux error upsampled as numpy array
Flux upsampled as numpy array
Shape of the flux component
Image shape of the flux component
Use log flux
Flux error
Methods Summary
Convert to Gammapy map
from_dict
(data)Create flux component from dict
from_flux_init_datasets
(datasets, **kwargs)Compute flux init from datasets by averaging over the raw flux estimate.
from_numpy
(flux[, mask])Create flux component from downsampled data.
parameters
([recurse])Parameter list
plot
([ax, kwargs_norm])Plot flux component as sky image
read
(filename[, format])Read flux component from file
to_dict
([include_data])Convert flux component configuration to dict, with simple data types.
write
(filename[, format, overwrite])Write flux component to file
Attributes Documentation
- flux#
Flux as torch tensor
- flux_numpy#
Flux as numpy array
- flux_upsampled#
Flux
- flux_upsampled_error#
Flux error as torch tensor
- flux_upsampled_error_numpy#
Flux error upsampled as numpy array
- flux_upsampled_numpy#
Flux upsampled as numpy array
- is_sparse = False#
- shape#
Shape of the flux component
- shape_image#
Image shape of the flux component
- use_log_flux#
Use log flux
- wcs#
Flux error
Methods Documentation
- as_gp_map()[source]#
Convert to Gammapy map
- Returns:
map – Gammapy WCS map
- Return type:
~gammapy.maps.WcsNDmap
- classmethod from_dict(data)[source]#
Create flux component from dict
- Parameters:
data (dict) – Parameter dict.
- Returns:
flux_component – Flux component
- Return type:
FluxComponent
- classmethod from_flux_init_datasets(datasets, **kwargs)[source]#
Compute flux init from datasets by averaging over the raw flux estimate.
- classmethod from_numpy(flux, mask=None, **kwargs)[source]#
Create flux component from downsampled data.
- Parameters:
flux (~numpy.ndarray) – Flux init array with 2 dimensions
**kwargs (dict) – Keyword arguments passed to FluxComponent
- Returns:
flux_component – Flux component
- Return type:
FluxComponent
- classmethod read(filename, format=None)[source]#
Read flux component from file
- Parameters:
filename (str or Path) – Output filename
format ({'asdf', 'yaml', 'fits'}) – Format to use.
- Returns:
flux_component – Flux component
- Return type:
FluxComponent