Pipeline¶
- class phrosty.pipeline.Pipeline(diaobj, imgcol, band, science_images=None, template_images=None, science_csv=None, template_csv=None, nprocs=1, nwrite=5, verbose=False)[source]¶
Bases:
object
Phrosty’s top-level pipeline
Create the a pipeline object.
- Parameters:
diaobj (DiaObject) – The object we’re building a lightcurve for
band (str) – One of R062, Z087, Y106, J129, H158, F184, K213
science_images (list of snappl.image.Image) – The science images.
template_images (list of snappl.image.Image) – The template images.
science_csv (Path or str) –
CSV file with the science images. The first line must be:
path pointing sca mjd band
subsequent lines must have that information for all the science images. path must be relative to ou24.images in config. Pipeline will extract the images from this file whose band matches the band of the pipeline (and ignore the rest)
template_csv (Path or str) – CSV file with template images. Same format as science_csv.
nprocs (int, default 1) – Number of cpus for the CPU multiprocessing segments of the pipeline. (GPU segments will run a single process.)
nwrite (int, default 5) – Number of asynchronous FITS writer processes.
Methods Summary
__call__
([through_step])Run the pipeline.
add_to_results_dict
(one_pair)align_and_pre_convolve
(templ_image, sci_image)Align and pre convolve a single template/science pair.
clear_contents
(directory)do_stamps
(sci_image, templ_image)get_psfs
()make_phot_info_dict
(sci_image, templ_image)"Do things.
phot_at_coords
(img, psf[, pxcoords, ap_r])Do photometry at forced set of pixel coordinates.
save_stamp_paths
(sci_image, templ_image, paths)write_fits_file
(data, header, savepath)Methods Documentation
- __call__(through_step=None)[source]¶
Run the pipeline.
- Parameters:
through_step (str, default None) –
Which step to run thorough? Runs them all if not given.
Steps in order are: * sky_subtract * get_psfs * align_and_preconvolve * subtract * find_decorrelation * apply_decorrelation * make_stamps * make_lightcurve
- Returns:
ltcvpath – The path to the output lightcurve file if make_lightcurve was run, otherwise None.
- Return type:
pathlib.Path or None
- align_and_pre_convolve(templ_image, sci_image)[source]¶
Align and pre convolve a single template/science pair.
- Parameters:
sci_image (phrosty.PipelineImage) – The science (new) image.
templ_image (phrosty.PipelineImage) – The template (ref) image that will be subtracted from sci_image.
- Returns:
sfftifier – Use this object for futher SFFT work. Be sure to dereference it to free the prodigious amount of memory it allcoates.
- Return type:
SpaceSFFT_CupyFlow
- make_phot_info_dict(sci_image, templ_image, ap_r=4)[source]¶
“Do things.
Parmaeters¶
- sci_image: PipelineImage
science image wrapper
- temp_image: PipelineImage
template image wrapper
- ap_r: float, default 4
Radius of aperture to use in something
- returns:
something – It has things in it
- rtype:
dict
- phot_at_coords(img, psf, pxcoords=(50, 50), ap_r=4)[source]¶
Do photometry at forced set of pixel coordinates.
- Parameters:
- Returns:
results – Keys and values are: * ‘aperture_sum’: flux in aperture of radius ap_r * ‘flux_fit’: flux from PSF photometry * ‘flux_fit_err’: uncertainty on flux_fit * ‘mag_fit’: instrumental magnitude (i.e. no zeropoint) from flux_fit * ‘mag_fit_err’: uncertainty on mag_fit
All values are floats.
- Return type: