diff --git a/pypeit/coadd3d.py b/pypeit/coadd3d.py index 3a7aefe88b..c9a58d9d75 100644 --- a/pypeit/coadd3d.py +++ b/pypeit/coadd3d.py @@ -1109,7 +1109,8 @@ def load(self): crval_wv = self.cubepar['wave_min'] if self.cubepar['wave_min'] is not None else wave0 cd_wv = self.cubepar['wave_delta'] if self.cubepar['wave_delta'] is not None else dwv self.all_wcs.append(self.spec.get_wcs(spec2DObj.head0, slits, detector.platescale, crval_wv, cd_wv)) - ra_img, dec_img, minmax = slits.get_radec_image(self.all_wcs[ff], alignSplines, spec2DObj.tilts, flexure=spat_flexure) + ra_img, dec_img, minmax = slits.get_radec_image(self.all_wcs[ff], alignSplines, spec2DObj.tilts, + spat_flexure=spat_flexure) # Extract wavelength and delta wavelength arrays from the images wave_ext = waveimg[onslit_gpm] diff --git a/pypeit/core/flexure.py b/pypeit/core/flexure.py index 0ad726b8db..5af0f38fb1 100644 --- a/pypeit/core/flexure.py +++ b/pypeit/core/flexure.py @@ -189,8 +189,8 @@ def spat_flexure_qa(img, slits, shift, gpm=None, vrange=None, outfile=None): vrange = None # TODO: should we use initial or tweaked slits in this plot? - left_slits, right_slits, mask_slits = slits.select_edges(initial=True, flexure=None) - left_flex, right_flex, mask = slits.select_edges(initial=True, flexure=shift) + left_slits, right_slits, mask_slits = slits.select_edges(initial=True, spat_flexure=None) + left_flex, right_flex, mask = slits.select_edges(initial=True, spat_flexure=shift) if debug: # where to start and end the plot in the spatial&spectral direction diff --git a/pypeit/core/gui/skysub_regions.py b/pypeit/core/gui/skysub_regions.py index b678784e2b..16d2b45fca 100644 --- a/pypeit/core/gui/skysub_regions.py +++ b/pypeit/core/gui/skysub_regions.py @@ -41,7 +41,7 @@ class SkySubGUI: """ def __init__(self, canvas, image, frame, outname, det, slits, axes, pypeline, spectrograph, printout=False, - runtime=False, resolution=None, initial=False, flexure=None, overwrite=False): + runtime=False, resolution=None, initial=False, spat_flexure=None, overwrite=False): """Controls for the interactive sky regions definition tasks in PypeIt. The main goal of this routine is to interactively select sky background @@ -73,8 +73,8 @@ def __init__(self, canvas, image, frame, outname, det, slits, axes, pypeline, sp initial : bool, optional To use the initial edges regardless of the presence of the tweaked edges, set this to True. - flexure : float, optional - If provided, offset each slit by this amount + spat_flexure : float, optional + If provided, offset each slit in the spatial direction by this amount runtime : bool Is the GUI being launched during data reduction? resolution : int @@ -137,7 +137,7 @@ def __init__(self, canvas, image, frame, outname, det, slits, axes, pypeline, sp self._fitr = [] # Matplotlib shaded fit region self._fita = None - self.slits_left, self.slits_right, _ = slits.select_edges(initial=initial, spat_flexure=flexure) + self.slits_left, self.slits_right, _ = slits.select_edges(initial=initial, spat_flexure=spat_flexure) self.initialize_menu() self.reset_regions() @@ -149,7 +149,7 @@ def __init__(self, canvas, image, frame, outname, det, slits, axes, pypeline, sp @classmethod def initialize(cls, det, frame, slits, pypeline, spectrograph, outname="skyregions.fits", overwrite=False, initial=False, - flexure=None, runtime=False, printout=False): + spat_flexure=None, runtime=False, printout=False): """ Initialize the 'ObjFindGUI' window for interactive object tracing @@ -167,6 +167,8 @@ def initialize(cls, det, frame, slits, pypeline, spectrograph, outname="skyregio Name of the spectrograph printout : bool Should the results be printed to screen + spat_flexure : float, optional + If provided, offset each slit in the spatial direction by this amount runtime : bool Is this GUI being launched during a data reduction? @@ -178,7 +180,7 @@ def initialize(cls, det, frame, slits, pypeline, spectrograph, outname="skyregio # NOTE: SlitTraceSet objects always store the left and right # traces as 2D arrays, even if there's only one slit. nslit = slits.nslits - lordloc, rordloc, _ = slits.select_edges(initial=initial, spat_flexure=flexure) + lordloc, rordloc, _ = slits.select_edges(initial=initial, spat_flexure=spat_flexure) # Determine the scale of the image med = np.median(frame) @@ -210,7 +212,7 @@ def initialize(cls, det, frame, slits, pypeline, spectrograph, outname="skyregio # Initialise the object finding window and display to screen fig.canvas.manager.set_window_title('PypeIt - Sky regions') srgui = SkySubGUI(fig.canvas, image, frame, outname, det, slits, axes, pypeline, spectrograph, - printout=printout, runtime=runtime, initial=initial, flexure=flexure, overwrite=overwrite) + printout=printout, runtime=runtime, initial=initial, spat_flexure=spat_flexure, overwrite=overwrite) plt.show() return srgui diff --git a/pypeit/scripts/skysub_regions.py b/pypeit/scripts/skysub_regions.py index 516d24a691..bb175af31d 100644 --- a/pypeit/scripts/skysub_regions.py +++ b/pypeit/scripts/skysub_regions.py @@ -96,7 +96,7 @@ def main(args): # Finally, initialise the GUI skyreg = SkySubGUI.initialize(det, frame, slits, pypeline, specname, outname=regfile, overwrite=args.overwrite, runtime=False, printout=True, - initial=args.initial, flexure=spat_flexure) + initial=args.initial, spat_flexure=spat_flexure) # Get the results msskyreg = skyreg.get_result() diff --git a/pypeit/slittrace.py b/pypeit/slittrace.py index bbbdc55221..a585c8c6f9 100644 --- a/pypeit/slittrace.py +++ b/pypeit/slittrace.py @@ -479,7 +479,7 @@ def get_slitlengths(self, initial=False, median=False): slitlen = right - left return np.median(slitlen, axis=1) if median else slitlen - def get_radec_image(self, wcs, alignSplines, tilts, slit_compute=None, slice_offset=None, initial=False, flexure=None): + def get_radec_image(self, wcs, alignSplines, tilts, slit_compute=None, slice_offset=None, initial=False, spat_flexure=None): """Generate an RA and DEC image for every pixel in the frame NOTE: This function is currently only used for SlicerIFU reductions. @@ -504,8 +504,8 @@ def get_radec_image(self, wcs, alignSplines, tilts, slit_compute=None, slice_off is set to 0.0. initial : bool Select the initial slit edges? - flexure : float, optional - If provided, offset each slit by this amount. + spat_flexure : float, optional + If provided, offset each slit in the spatial direction by this amount. Returns ------- @@ -542,7 +542,7 @@ def get_radec_image(self, wcs, alignSplines, tilts, slit_compute=None, slice_off decimg = np.zeros((self.nspec, self.nspat)) minmax = np.zeros((self.nslits, 2)) # Get the slit information - slitid_img_init = self.slit_img(pad=0, initial=initial, spat_flexure=flexure) + slitid_img_init = self.slit_img(pad=0, initial=initial, spat_flexure=spat_flexure) for slit_idx, spatid in enumerate(self.spat_id): if slit_idx not in slit_compute: continue