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” MultiBeam object, with a single beam for each combination of grism orientation and blocking filter.

Parameters:
mbstr | grizli.multifit.MultiBeam

The original MultiBeam object, or the location of the *beams.fits. file.

pixfracfloat, 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.

kernelstr, 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".

dfillvalfloat, 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_kwargsdict, 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_kwargsdict, optional

Any additional parameters to pass through to sklean.cluster.DBSCAN. By default dbscan_kwargs={"eps":5}.

**multibeam_kwargsdict, optional

Any additional parameters to pass through to MultiBeam when loading the original object.

Returns:
MultiBeam

The stacked multibeam object.