Module: fake_data_creator#
A class for creating fake data sets.
The FakeDataSet class allows the user to create fake data sets for testing, including generating images with random noise and adding artificial objects. The fake data can be saved to files or used directly.
- class kbmod.fake_data.fake_data_creator.FakeDataSet(width, height, times, noise_level=2.0, psf_val=0.5, use_seed=False)[source]#
This class creates fake data sets for testing and demo notebooks.
Methods
get_work_unit
([config])Create a WorkUnit from the fake data.
insert_object
(trj)Insert a fake object given the trajectory.
insert_random_object
(flux)Create a fake object and insert it into the image.
Make a stack of fake layered images.
save_fake_data_to_work_unit
(filename[, config])Create the fake data in a WorkUnit file.
set_wcs
(new_wcs)Set a new fake WCS to be used for this data.
- get_work_unit(config=None)[source]#
Create a WorkUnit from the fake data.
- Parameters:
- filenamestr
The name of the resulting WorkUnit file.
- configSearchConfiguration, optional
The configuration parameters to use. If None then uses default values.
- insert_object(trj)[source]#
Insert a fake object given the trajectory.
- Parameters:
- trjTrajectory
The trajectory of the fake object to insert.
- insert_random_object(flux)[source]#
Create a fake object and insert it into the image.
- Parameters:
- fluxfloat
The flux of the object.
- Returns:
- tTrajectory
The trajectory of the inserted object.
- kbmod.fake_data.fake_data_creator.add_fake_object(img, x, y, flux, psf=None)[source]#
Add a fake object to a LayeredImage or RawImage
- Parameters:
- imgRawImage or LayeredImage
The image to modify.
- xint or float
The x pixel location of the fake object.
- yint or float
The y pixel location of the fake object.
- fluxfloat
The flux value.
- psfnumpy.ndarray
The PSF’s kernel for the image.
- kbmod.fake_data.fake_data_creator.create_fake_times(num_times, t0=0.0, obs_per_day=1, intra_night_gap=0.01, inter_night_gap=1)[source]#
Create a list of times based on a cluster of
obs_per_day
observations each night spaced outintra_night_gap
within a night andinter_night_gap
data between observing nights.- Parameters:
- num_timesint
The number of time steps (number of images).
- t0float
The time stamp of the first observation [default=0.0]
- obs_per_dayint
The number of observations on the same night [default=1]
- intra_night_gapfloat
The time (in days) between observations in the same night [default=0.01]
- inter_night_gapint
The number of days between observing runs [default=1]
- Returns:
- result_timeslist
A list of
num_times
floats indicating the different time stamps.
- kbmod.fake_data.fake_data_creator.make_fake_layered_image(width, height, noise_stdev, pixel_variance, obstime, psf, seed=None)[source]#
Create a fake LayeredImage with a noisy background.
- Parameters:
- widthint
Width of the images (in pixels).
- height`int
Height of the images (in pixels).
- noise_stdev: `float`
Standard deviation of the image.
- pixel_variance: `float`
Variance of the pixels, assumed uniform.
- obstimefloat
Observation time.
- psfnumpy.ndarray
The PSF’s kernel for the image.
- seedint, optional
The seed for the pseudorandom number generator.
- Returns:
- imgLayeredImage
The fake image.
- Raises:
- Raises
ValueError
if any of the parameters are invalid.
- Raises