Astronomy Objects¶
Galaxies¶
- class deepbench.astro_object.GalaxyObject(image_dimensions, amplitude=1, radius=25, n=1.0, noise_level=0.2, ellipse=0.45663448506266835, theta=0.09685431929984922, seed=None)¶
Produce a 2D galaxy using a Sersic2D distribution. View https://docs.astropy.org/en/stable/api/astropy.modeling.functional_models.Sersic2D.html for implimentation details.
- Parameters:
image_dimensions (Union[tuple(int,int), tuple(float,float)]) – The dimension(s) of the object to be produced.
amplitude (Union[int, float]) – The amplitude of the object to be produced, surface brightness at radius.
noise_level (Union[float, list[float]]) – The Poisson noise level (lambda, the expected seperation) to be applied to the object.
radius (int, optional) – Effective half-light radius of the galaxy. Defaults to 25.
n (float, optional) – Sersic Index. Defaults to 1.0.
ellipse (float, optional) – Galaxy Ellipticity. Defaults to random.uniform(0.1, 0.9).
theta (float, optional) – The rotation of the galaxy in radians. Defaults to random.uniform(-1.5, 1.5). seed (Union[float, list[float]], optional): Seed to set the random state for noise in the object. Initialized at the init of the class. Default None.
seed (int | None)
Examples
>>> example_galaxy = GalaxyObject(image_dimensions=28)
- create_Sersic_profile(center_x, center_y)¶
Wrapper for https://docs.astropy.org/en/stable/api/astropy.modeling.functional_models.Sersic2D.html
- Parameters:
center_x (float) – x position of the center of the galaxy
center_y (float) – y position of the center of the galaxy
- Returns:
created galaxy profile
- Return type:
galaxy (numpy.array)
- create_object(center_x=5.0, center_y=5.0)¶
Create the galaxy object from a Sersic distribution and Poisson or PSF noise.
- Parameters:
center_x (float) – The x-axis placement of the galaxy object.
center_y (float) – The y-axis placement of the galaxy object.
- Returns:
Two dimensional Galaxy object, composed of Sersic Distribution and noise appendings.
- Return type:
ndarray
Examples
>>> example_prof = example_star.create_object(center_x = 1.0, center_y = 0.0)
- displayObject()¶
Display the object created in a 2d plot
- Raises:
NotImplementedError – Raised if not implimented in the child class
Spiral Galaxies¶
- class deepbench.astro_object.SpiralGalaxyObject(image_dimensions, amplitude=1, radius=25, arm_thickness=1.0, noise_level=0.2, winding_number=2, spiral_pitch=0.2, seed=None, **kwargs)¶
Create a spiral galaxy object
- Parameters:
image_dimensions (Union[Tuple(int,int), tuple(float,float)]) – The dimension(s) of the object to be produced.
amplitude (Union[int, float]) – The amplitude of the object to be produced, surface brightness at the sersic radius.
noise_level (Union[float, list[float]]) – The Poisson noise level to be applied to the object.
radius (int, optional) – Effective half-light radius of the galaxy. Defaults to 25.
arm_thickness (float, optional) – Width of each arm of the spiral. Defaults to 1.0.
winding_number (int, optional) – number of arms. Defaults to 2.
spiral_pitch (float, optional) – Severity of the spiral, the pitch angle. Defaults to 0.2. seed (Union[float, list[float]], optional): Seed to set the random state for noise in the object. Initialized at the init of the class. Default None.
seed (int | None)
Examples
>>> example_galaxy = SpiralGalaxyObject(image_dimensions=(28,28), winding_number=4)
- create_object(center_x, center_y)¶
ref paper: https://doi.org/10.1111/j.1365-2966.2009.14950.x Create a spiral galaxy image
- Parameters:
center_x (float) – x position of the center of the galaxy
center_y (float) – y position of the center of the galaxy
- Returns:
Profile representing the spiral galaxy
- Return type:
spiral profile (numpy array)
- create_spiral_profile(center_x, center_y)¶
ref paper: https://doi.org/10.1111/j.1365-2966.2009.14950.x Impliment a spiral galaxy profile
- Parameters:
center_x (float) – x position of the center of the galaxy
center_y (float) – y position of the center of the galaxy
- Returns:
Profile representing the spiral galaxy
- Return type:
spiral profile (numpy array)
- displayObject()¶
Display the object created in a 2d plot
- Raises:
NotImplementedError – Raised if not implimented in the child class
Stars¶
- class deepbench.astro_object.StarObject(image_dimensions, noise_level=0.0, radius=1.0, amplitude=1.0, seed=None)¶
Create Stars
Args:
- image_dimensions (Union[int, float, List[int], List[float]]): The dimension(s) of the object to be produced.
radius (Union[int, float]): The radius of the object to be produced. amplitude (Union[int, float]): The amplitude (brightness) of the object to be produced. noise_level (Union[float, list[float]]): The Poisson noise level (lambda, the expected seperation) to be applied to the object.
seed (Union[float, list[float]], optional): Seed to set the random state for noise in the object. Initialized at the init of the class. Default None.
Examples:
>>> example_star = StarObject(image_dimensions=28, noise=5.0, center=3, radius=0.7, amplitude=1.2) >>> example_star = StarObject(image_dimensions=(28,28), noise=5.0)
- Parameters:
image_dimensions (int | float | List[int] | List[float])
noise_level (float | List[float])
radius (int | float)
amplitude (int | float)
seed (int | None)
- create_Moffat_profile(center_x, center_y, alpha=1.0)¶
Create the Moffat distribution used to simulate star objects.
- Parameters:
center_x (float) – The x-axis placement of the star object.
center_y (float) – The y-axis placement of the star object.
alpha (float) – The luminosity of the Moffat distribution.
- Returns:
Two dimensional Moffat distribution.
- Return type:
ndarray
Examples
>>> example_prof = example_star.create_Moffat_profile(center_x = 1.0, center_y = 0.0, alpha=200.0) >>> example_prof = example_star.create_Moffat_profile(center_x = 1.0, center_y = 0.0)
- create_object(center_x, center_y, alpha=1.0)¶
Create the star object from a Moffat distribution and Poisson and PSF noise.
- Parameters:
center_x (float) – The x-axis placement of the star object.
center_y (float) – The y-axis placement of the star object.
alpha (float) – The luminosity of the Moffat distribution.
- Returns:
Two dimensional Star object, composed of Moffat Distribution and noise appendings.
- Return type:
ndarray
Examples
>>> example_prof = example_star.create_object(center_x = 1.0, center_y = 0.0, alpha=200.0) >>> example_prof = example_star.create_object(center_x = 1.0, center_y = 0.0)
- displayObject()¶
Display the object created in a 2d plot
- Raises:
NotImplementedError – Raised if not implimented in the child class