Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate (x,y) Ordering Between RSIM and ImVIZ #66

Open
PaulHuwe opened this issue Jul 13, 2023 · 3 comments
Open

Investigate (x,y) Ordering Between RSIM and ImVIZ #66

PaulHuwe opened this issue Jul 13, 2023 · 3 comments

Comments

@PaulHuwe
Copy link
Collaborator

RSIM and ImVIZ are transpositions of each other (x <-> y), resulting in images like this:
rsim_sca_rot

Which should have a shape more like:
image (1)

We need to investigate if RSIM is using the wrong convention, or if this needs to incorporated on the Imviz side.

@bmorris3
Copy link
Contributor

Thanks for the heads up. Generating some catalogs and testing on my end too.

@bmorris3
Copy link
Contributor

Still looking into this. I can get sensible SCA orientations if I do a particular set of transformations to each SCA's data, similar to an x orientation flip, y orientation flip, and a transpose. I can't figure out if these are sensible, but the cluster looks better:

Screen Shot 2023-07-14 at 11 56 39

@schlafly
Copy link
Collaborator

To try to make progress here... can we pick a particular star on these images and make sure that imviz is putting the star where it should be?

This file was generated from a catalog. We should be able to plot the positions of the stars in that catalog on top of this image and see if they match. e.g., something like:

im2 = asdf.open('l2-cluster-smaller-sca7.asdf')['roman']['data'].value
cat = Table.read('cat-270-66-cluster-smaller.fits')
wcs = asdf.open('l2-cluster-smaller-sca7.asdf')['roman']['meta']['wcs']
xx, yy = wcs.world_to_pixel(cat['ra'], cat['dec'])
m = (np.abs(yy - 2048) < 2048) & (np.abs(xx - 2048) < 2048) ; plot(xx[m], yy[m], 'r+')

That nicely produces points on the sources in the image. That tells me that the simulator WCS & images are consistent, so I think this has to be on the imviz side?

It's easy for me to imagine (x, y) <-> (y, x) issues; there's the usual one with (x, y) corresponding to image[y, x]. I claim that I'm following the accepted python / imshow / wcs API conventions there, but if you think otherwise, let me know. I don't have a picture for how we could make an error like im -> im[::-1, ::-1]; that's much harder.

If it's useful to have these files, I've dropped them on /grp/roman/eschlafly/romanisim/20230420.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants