astromodels.sources.point_source module
- class astromodels.sources.point_source.PointSource(source_name: str, ra: Optional[float] = None, dec: Optional[float] = None, spectral_shape: Optional[Function1D] = None, l: Optional[float] = None, b: Optional[float] = None, components=None, sky_position: Optional[SkyDirection] = None, polarization=None)[source]
-
A point source. You can instance this class in many ways.
with Equatorial position and a function as spectrum (the component will be automatically called ‘main’):
>>> from astromodels import * >>> point_source = PointSource('my_source', 125.6, -75.3, Powerlaw())
with Galactic position and a function as spectrum (the component will be automatically called ‘main’):
>>> point_source = PointSource('my_source', l=15.67, b=80.75, spectral_shape=Powerlaw())
with Equatorial position or Galactic position and a list of spectral components:
>>> c1 = SpectralComponent("component1", Powerlaw()) >>> c2 = SpectralComponent("component2", Powerlaw()) >>> point_source = PointSource("test_source",125.6, -75.3,components=[c1,c2]) Or with Galactic position: >>> point_source = PointSource("test_source",l=15.67, b=80.75,components=[c1,c2])
NOTE: by default the position of the source is fixed (i.e., its positional parameters are fixed)
- Parameters:
source_name – name for the source
ra – Equatorial J2000 Right Ascension (ICRS)
dec – Equatorial J2000 Declination (ICRS)
spectral_shape – a 1d function representing the spectral shape of the source
l – Galactic latitude
b – Galactic longitude
components – list of spectral components (instances of SpectralComponent)
sky_position – an instance of SkyDirection
- Returns:
- property free_parameters: Dict[str, Parameter]
Returns a dictionary of free parameters for this source. We use the parameter path as the key because it’s guaranteed to be unique, unlike the parameter name.
- Returns:
- property has_free_parameters: bool
Returns True or False whether there is any parameter in this source
- Returns: