Skip to content

More general wcs handling #32

@NiallMac

Description

@NiallMac

Something I encountered when running on an single-epoch image was that the wcs handling in InsertSimulatedGalaxies and model_class.GetConvolved use the line:

localscale = np.sqrt(local.dudx * local.dvdy)

This fails if dudx or dudy is negative (dudy is for the single-epoch image). In general it could be clearer what is in world coordinates and what is in pixel coordinates e.g. the applied shear won't be transformed as is currently implemented I think (although maybe you guys haven't been using shear yet....).

I think all of this can be dealt with at once using the galsim wcs tools e.g. galsim.wcs.BaseWCS.toImage (http://galsim-developers.github.io/GalSim/classgalsim_1_1wcs_1_1_base_w_c_s.html#a977fd095abd1df0ec6f32b0edb21da91) for converting a profile in world coordinates to pixel coordinates. The (sheared) galaxy profile can then be built in world coordinates and then converted to image coordinates before drawing. I think then you wouldn't need e.g. the 'localscale' parameter. I haven't used this function before but it sounds like the appropriate thing. Does this make sense?

It looks like the psf model is being returned in world coordinates so one would do the convolution before converting to image coordinates.

I've assigned this to myself, let me you know if I've overlooked something, otherwise I'll have a go at implementing this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions