gen_stacked_beams#
- niriss_tools.grism.gen_stacked_beams(mb, pixfrac=1.0, kernel='square', dfillval=0, fit_trace_shift=False, trace_shift_kwargs={}, cluster_beams=False, dbscan_kwargs={'eps': 5}, **multibeam_kwargs)[source]#
Stack individual beams with the same grism and blocking filter.
This returns a “master”
MultiBeamobject, with a single beam for each combination of grism orientation and blocking filter.- Parameters:
- mb
str|grizli.multifit.MultiBeam The original MultiBeam object, or the location of the
*beams.fits.file.- pixfrac
float, optional The fraction by which input pixels are “shrunk” before being drizzled onto the output image grid, given as a real number between 0 and 1. This specifies the size of the footprint, or “dropsize”, of a pixel in units of the input pixel size. By default
pixfrac=1.0.- kernel
str, optional The form of the kernel function used to distribute flux onto the separate output images, by default
"square". The current options are"square","point","turbo","gaussian", and"lanczos3".- dfillval
float, optional The value to be assigned to output pixels that have zero weight, or that do not receive flux from any input pixels during drizzling. By default this is 0.
- fit_trace_shiftbool, optional
Fit for a cross-dispersion offset before stacking the beams, using fit_trace_shift(). By default
False.- trace_shift_kwargs
dict, optional Additional keyword arguments to pass through to fit_trace_shift() if used.
- cluster_beamsbool, optional
Cluster the beams based on their detector position before stacking, using the DBSCAN algorithm. This can minimise residuals arising from the trace variation across the detector, at the cost of an increased number of stacked beams. By default
False.- dbscan_kwargs
dict, optional Any additional parameters to pass through to sklean.cluster.DBSCAN. By default
dbscan_kwargs={"eps":5}.- **multibeam_kwargs
dict, optional Any additional parameters to pass through to
MultiBeamwhen loading the original object.
- mb
- Returns:
MultiBeamThe stacked multibeam object.