caracal-pipeline / caracal

Containerized Automated Radio Astronomy Calibration (CARACal) pipeline
GNU General Public License v2.0
28 stars 6 forks source link

1 pixel edge error in 3D clean mask regridding #1423

Open paoloserra opened 2 years ago

paoloserra commented 2 years ago

The 3D clean mask produced by the line worker by regridding a user mask to the WCS of the cube has a small issue at the edge of the cube. The screenshot below shows that the mask ends abruptly 1 pixel short of the bottom of the cube. The same happens at the left edge of the cube. However, it does not seem to happen a the right and top edges...

image image

PeterKamphuis commented 2 years ago

Is the whole mask shifted or just that edge missing? There is no emission in your image so it is difficult to tell.

It seems that the CRPIX in projected header (https://github.com/caracal-pipeline/caracal/blob/d0b9d985324f2f60205e3b2e05546c95d80987ff/caracal/workers/line_worker.py#L859) is integer based (If this is the correct location for reprojection) which would cause shifts if the axis is uneven.

paoloserra commented 2 years ago

No @PeterKamphuis , I've looked closely and it is not an offset. It's really the edge missing. (The reason you see no emission within the mask is that you're far into the primary beam of that pointing, while the mask to be regridded came from a mosaic of many more pointings. So in this particular case the bug is not making any real damage.)

PeterKamphuis commented 2 years ago

Ok, then it is probably also not a problem in the header.

Fil8 commented 7 months ago

if the mask is in the second row/column of x/y we can create a loop that manually properly masks the first row/column pixels.