gbrammer / grizli

Grizli: The "Grism redshift and line" analysis software
MIT License
64 stars 50 forks source link

wavelength solution for optimal extract #25

Closed amn3142 closed 5 years ago

amn3142 commented 6 years ago

The output wavelength from beam.beam.optimal_optimal extract seems to be relative to a fixed point in the cutout rather than the location of an object.

E.g. if I make a cutout with a point source and use optimal extract on that source, it has an apparent redshift offset to a cutout with a single point source at a different x position.

I assume this means that optimal extract is defining the coordinate system based on the center of the cutout rather than the pixel location of the light source.

Fortunately for me this does not seem to be the case for the part of the code that generates a 2d model grism image given a 1d input model spectrum.

It's not a major bug, or anything but I thought it was important to verify what was going on with this.

wave, opt_flux, opt_rms = beam.beam.optimal_extract(direct[k],ivar = tbeam.ivar)

gbrammer commented 5 years ago

@amn3142, sorry for the long silence! Yes, the wavelengths of the 1D spectra are defined relative to the central pixel in the beam cutout, so you'll see effective wavelength offsets for objects centered elsewhere in the cutout. But for the 2D models, the wavelengths are defined relative to each pixel in the direct image and of course a given pixel in the dispersed image can map to different sky positions at different wavelengths.

So you're right that the 2D modeling is OK for modeling multiple sources within the cutout. Note that you have to be a bit careful to not make the cutouts too large, however, since a given cutout assumes that all pixels in the cutout have the same dispersion solution and, in fact, the dispersion varies across the WFC3/IR FoV.

amn3142 commented 5 years ago

Ok! Thanks! Rough sense of the scale the dispersion varies significantly on?

On Mar 22, 2019, at 1:57 AM, Gabe Brammer notifications@github.com wrote:

@amn3142, sorry for the long silence! Yes, the wavelengths of the 1D spectra are defined relative to the central pixel in the beam cutout, so you'll see effective wavelength offsets for objects centered elsewhere in the cutout. But for the 2D models, the wavelengths are defined relative to each pixel in the direct image and of course a given pixel in the dispersed image can map to different sky positions at different wavelengths.

So you're right that the 2D modeling is OK for modeling multiple sources within the cutout. Note that you have to be a bit careful to not make the cutouts too large, however, since a given cutout assumes that all pixels in the cutout have the same dispersion solution and, in fact, the dispersion varies across the WFC3/IR FoV.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gbrammer commented 5 years ago

200 pixels?

On Fri, Mar 22, 2019 at 11:23 AM amn3142 notifications@github.com wrote:

Ok! Thanks! Rough sense of the scale the dispersion varies significantly on?

On Mar 22, 2019, at 1:57 AM, Gabe Brammer notifications@github.com wrote:

@amn3142, sorry for the long silence! Yes, the wavelengths of the 1D spectra are defined relative to the central pixel in the beam cutout, so you'll see effective wavelength offsets for objects centered elsewhere in the cutout. But for the 2D models, the wavelengths are defined relative to each pixel in the direct image and of course a given pixel in the dispersed image can map to different sky positions at different wavelengths.

So you're right that the 2D modeling is OK for modeling multiple sources within the cutout. Note that you have to be a bit careful to not make the cutouts too large, however, since a given cutout assumes that all pixels in the cutout have the same dispersion solution and, in fact, the dispersion varies across the WFC3/IR FoV.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gbrammer/grizli/issues/25#issuecomment-475567326, or mute the thread https://github.com/notifications/unsubscribe-auth/ABgRNg2XVQ8Z-cQodGMuD-hGsJT63_dyks5vZK8_gaJpZM4Up-sv .