SparseSpatialFluxComponent#
- class jolideco.models.SparseSpatialFluxComponent(flux, x_pos, y_pos, shape, use_log_flux=True, prior=None, frozen=False, wcs=None)[source]#
Bases:
ModuleSparse flux component to represent a list of point sources
- flux#
Initial flux tensor
- Type:
~torch.Tensor
- x_pos#
x position in pixel coordinates
- Type:
~torch.Tensor
- y_pos#
y position in pixel coordinates
- Type:
~torch.Tensor
- 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 (~torch.Tensor)
Flux as numpy array
Upsampled flux
Shape of the flux component
Shape of the flux component
Positions as SkyCoord
Use log flux
Flux error
x pos as numpy array
y pos as numpy array
Methods Summary
from_numpy(flux, x_pos, y_pos, **kwargs)Create sparse flux component from numpy arrays
from_sky_coord(skycoord, wcs, **kwargs)Create sparse flux component from sky coordinates
parameters([recurse])Parameter list
plot([ax, kwargs_norm])Plot flux component as sky image
read(filename[, format])Read sparse flux component from file
to_dict(**kwargs)Convert sparse flux component configuration to dict, with simple data types.
write(filename[, format, overwrite])Write flux component to file
Attributes Documentation
- flux#
Flux (~torch.Tensor)
- flux_numpy#
Flux as numpy array
- flux_upsampled#
Upsampled flux
- indices#
Shape of the flux component
- is_sparse = True#
- shape#
Shape of the flux component
- sky_coord#
Positions as SkyCoord
- upsampling_factor = 1#
- use_log_flux#
Use log flux
- wcs#
Flux error
- x_pos_numpy#
x pos as numpy array
- y_pos_numpy#
y pos as numpy array
Methods Documentation
- classmethod from_numpy(flux, x_pos, y_pos, **kwargs)[source]#
Create sparse flux component from numpy arrays
- flux#
Initial flux tensor
- Type:
~numpy.ndarray
- x_pos#
x position in pixel coordinates
- Type:
~numpy.ndarray
- y_pos#
y position in pixel coordinates
- Type:
~numpy.ndarray
- \*\*kwargs
Keyword arguments forwarded to SparseFluxComponent
- Type:
- Returns:
sparse_flux_component – Sparse flux component
- Return type:
SparseFluxComponent
- classmethod from_sky_coord(skycoord, wcs, **kwargs)[source]#
Create sparse flux component from sky coordinates
- Parameters:
skycoord (~astropy.coordinates.SkyCoord) – Sky coordinates
wcs (~astropy.wcs.WCS) – World coordinate transform object
- Returns:
sparse_flux_component – Sparse flux component
- Return type:
SparseFluxComponent
- classmethod read(filename, format=None)[source]#
Read sparse flux component from file
- Parameters:
filename (str or Path) – Output filename
format ({'fits'}) – Format to use.
- Returns:
flux_component – Flux component
- Return type:
SparseFluxComponent