Closed NicolasMonnier closed 2 months ago
Hi Nicolas-
Cube building doesn't use the resample_spec code, IFU cubes use the cube_build code (see https://jwst-pipeline.readthedocs.io/en/latest/jwst/cube_build/arguments.html). The relevant option that you're looking for there is the 'scalexy' argument, which allows you to directly set the size of the output cube spaxel. These output spaxels are required to be square.
By default, the output spaxel size is slightly smaller than either the slice width (across-slice sampling) or the pixel scale (along-slice sampling) in order to optimize data quality when combining dithered exposures. You can certainly use larger output spaxels when processing individual exposures, but since the PSF is significantly undersampled by the optics in individual exposures you will still see artifacts in such cubes. In general, I wouldn't recommend working with cubes based on single exposures.
Best, David
Hi David,
Thanks for your quick answer! I will try the scalexy
option as it seems close to what I'd like to do.
In general, I wouldn't recommend working with cubes based on single exposures.
I'm working on spatial/spectral deconvolution of the MRS observations using a model of the MRS. Thus, I need data that is close to the "optimal" raw data. So either 1D slices with distortion correction or 1D slices extracted from the cube (which is why i need spatial resolution as close as possible to the MRS specs).
Best, Nicolas
Hi Nicolas-
If you're interested in working on a deconvolution, I'd suggest working in the 2d detector space so that you don't need to deal with any resampling effects. You can interact with the WCS of the *cal.fits data products to determine the coordinate mapping; see, e.g., MRS example at https://jwst-docs.stsci.edu/jwst-science-calibration-pipeline/tips-and-tricks-for-working-with-the-jwst-pipeline#TipsandTricksforWorkingwiththeJWSTPipeline-QuerytheWCSusingthejwstdatamodels
Generally I've found that forward-modeling detector data using coordinate mappings such as the above gives the best results when having to deal with undersampling effects.
Best, David
Can the pixel resolution be modified to fit the MRS channel/band specs?
As I can see, the cube_build step naturally oversampled the data to build a cube. For instance, if I run the pipeline using one file for one observation (1 dithering) for a specific band (let's say Channel 1A), the final cube will be something like 27x25 pixels for the spatial dimensions. However, regarding this channel's specs, I'm waiting for a 21x19 pixels cube.
I haven't found any pipeline options to solve this problem, as many options seem to do nothing (unbranched options?). The only option that does something to the cube is _resample_spec.pixel_scaleratio. However, it scales both spatial dimensions with the exact resolution, but we expect rectangular pixels, not square.
Does anyone know a way to solve this problem ?
Nicolas M