opticam_new.utils.generate
Functions
|
Add a source to an image. |
|
Variable flux to be added to a source. |
|
Create a base image with Poisson noise. |
|
Add Poisson noise to an image. |
|
Create the ith image for each filter. |
|
Apply a circular aperture shadow to an image. |
|
Create the ith flat-field image for each filter. |
|
Create synthetic flat-field images. |
|
Create synthetic observation data for testing and following the tutorials. |
|
Create synthetic observation data for testing and following the tutorials. |
Module Contents
- opticam_new.utils.generate._add_two_dimensional_gaussian_to_image(image, x_centroid, y_centroid, peak_flux, sigma_x, sigma_y, theta)
Add a source to an image.
Parameters
- imageNDArray
The image.
- x_centroidfloat
The x-coordinate of the source.
- y_centroidfloat
The y-coordinate of the source.
- peak_fluxfloat
The peak flux of the source.
- sigma_xfloat
The standard deviation of the source in the x-direction.
- sigma_yfloat
The standard deviation of the source in the y-direction.
- thetafloat
The rotation angle of the source.
Returns
- NDArray
The image with the source added.
- Parameters:
image (numpy.typing.NDArray)
x_centroid (float)
y_centroid (float)
peak_flux (float)
sigma_x (float)
sigma_y (float)
theta (float)
- Return type:
numpy.typing.NDArray
- opticam_new.utils.generate._variable_function(i, fltr)
Variable flux to be added to a source.
Parameters
- ifloat
The image index (equivalent to time).
- fltrstr
The filter of the image, used to introduce a lag between filters.
Returns
- float
The flux.
- Parameters:
i (float)
fltr (str)
- Return type:
float
- opticam_new.utils.generate._create_image(binning_scale)
Create a base image with Poisson noise.
Parameters
- binning_scaleint
The binning scale of the image.
Returns
- NDArray
The noisy image.
- Parameters:
binning_scale (int)
- Return type:
numpy.typing.NDArray
- opticam_new.utils.generate._add_noise(image, i)
Add Poisson noise to an image.
Parameters
- imageNDArray
The image to add noise to.
- iint
The image index, used to seed the random number generator.
Returns
- NDArray
The noisy image.
- Parameters:
image (numpy.typing.NDArray)
i (int)
- Return type:
numpy.typing.NDArray
- opticam_new.utils.generate._create_images(out_dir, filters, N_sources, variable_source, source_positions, peak_fluxes, i, binning_scale, circular_aperture, overwrite)
Create the ith image for each filter.
Parameters
- filtersList[str]
The filters.
- N_sourcesint
The number of sources.
- variable_sourceint
The index of the variable source.
- source_positionsNDArray
The positions of the sources.
- peak_fluxesNDArray
The peak fluxes of the sources.
- iint
The image index (equivalent to time).
- binning_scaleint
The binning scale of the image.
- circular_aperturebool
Whether to apply a circular aperture shadow to the image.
- overwritebool
Whether to overwrite the image if it already exists.
- Parameters:
out_dir (str)
filters (List[str])
N_sources (int)
variable_source (int)
source_positions (numpy.typing.NDArray)
peak_fluxes (numpy.typing.NDArray)
i (int)
binning_scale (int)
circular_aperture (bool)
overwrite (bool)
- Return type:
None
- opticam_new.utils.generate._apply_flat_field(image)
Apply a circular aperture shadow to an image.
Parameters
- imageNDArray
The image.
Returns
- NDArray
The image with a circular aperture shadow.
- Parameters:
image (numpy.typing.NDArray)
- Return type:
numpy.typing.NDArray
- opticam_new.utils.generate._create_flats(out_dir, filters, i, binning_scale, overwrite)
Create the ith flat-field image for each filter.
Parameters
- out_dirstr
The directory to save the flat-field images.
- filterslist
The filters to create flat-field images for.
- iint
The index of the flat-field image (equivalent to time).
- binning_scaleint
The binning scale of the flat-field image.
- overwritebool
Whether to overwrite the flat-field image if it already exists.
- Parameters:
out_dir (str)
filters (list)
i (int)
binning_scale (int)
overwrite (bool)
- Return type:
None
- opticam_new.utils.generate.generate_flats(out_dir, n_flats=5, binning_scale=4, overwrite=False)
Create synthetic flat-field images.
Parameters
- out_dirstr
The directory to save the data.
- n_flatsint, optional
The number of flats per camera, by default 5.
- binning_scaleint, optional
The binning scale of the flat-field images, by default 4 (512x512).
- overwritebool, optional
Whether to overwrite data if they currently exist, by default False.
- Parameters:
out_dir (str)
n_flats (int)
binning_scale (int)
overwrite (bool)
- Return type:
None
- opticam_new.utils.generate.generate_observations(out_dir, n_images=100, circular_aperture=True, binning_scale=4, overwrite=False)
Create synthetic observation data for testing and following the tutorials.
Parameters
- out_dirstr
The directory to save the data.
- n_imagesint, optional
The number of images to create, by default 100.
- circular_aperturebool, optional
Whether to apply a circular aperture shadow to the images, by default True.
- binning_scaleint, optional
The binning scale of the images, by default 4 (512x512).
- overwritebool, optional
Whether to overwrite data if they currently exist, by default False.
- Parameters:
out_dir (str)
n_images (int)
circular_aperture (bool)
binning_scale (int)
overwrite (bool)
- Return type:
None
- opticam_new.utils.generate.generate_gappy_observations(out_dir, n_images=1000, circular_aperture=True, binning_scale=4, overwrite=False)
Create synthetic observation data for testing and following the tutorials.
Parameters
- out_dirstr
The directory to save the data.
- n_imagesint, optional
The number of images to create, by default 100.
- circular_aperturebool, optional
Whether to apply a circular aperture shadow to the images, by default True.
- binning_scaleint, optional
The binning scale of the images, by default 4 (512x512).
- overwritebool, optional
Whether to overwrite data if they currently exist, by default False.
- Parameters:
out_dir (str)
n_images (int)
circular_aperture (bool)
binning_scale (int)
overwrite (bool)
- Return type:
None