SKA-ScienceDataProcessor/algorithm-reference-library

Single pixel coordinate offset

Closed this issue · 7 comments

Hi Tim,

On tests with LOFAR data, I am finding a single pixel offset for the coordinates of all sources.

Could this please be fixed by editing shift_vis_to_image() in arl/imaging/base.py, line 65?
The change is from:
image_phasecentre = pixel_to_skycoord(nx // 2, ny // 2, im.wcs, origin=1)
to:
image_phasecentre = pixel_to_skycoord(nx // 2, ny // 2, im.wcs, origin=0)

All the best,
Jamie

Interesting - do you mean that the known astronomical position of a source is wrong in ARL images by one pixel?

Absolutely that. I was comparing the r.a. and dec. for a known pulsar (J0218+4232). The coordinates in ARL images were offset by one pixel, whereas the coordinates in CASA images were correct. It seems the 0-based or 1-based origin setting is a unique quirk to the WCS.

It doesn't surprise me that it was wrong! I just need to get the convention consistent across all the functions. I think I've got it right but I'll need to do all the tests. Tell you when it's done.

Hi Jamie,

I'm still working on this. It's a big more complicated than just the one line you identified. I need to ensure that everything remains consistent and that the test continue to run.

I'll let you know.
Tim

Hi Jamie,

I believe that I have fixed this. I can confirm that the use of wcs pixel definition was inconsistent across the ARL.

Can you please test?

Thanks,
Tim

Hi Tim,

Thanks so much for looking into this. I will test and let you know if anything pops up.

All the best,
Jamie

Fix worked. Closing.