Line_fit (and thus col_fit) truncate the centroid float co-ordinates to ints (the ints are used to access the array position). For example, I have a star with centroid xout=581.24, yout=1906.72. It was being truncated to xx=581 correctly, but yy=1906 incorrectly - the peak pixel at y=1907 is excluded. I believe yy should be rounded to 1907 instead, to ensure the line_fit/col_fit includes the peak pixel.
In-built conversion from float to int is a flooring function, so changing xx=int(xout) to xx=int(xout+0.5) (and same for y) ensures values of decimal >= .5 will get rounded correctly upwards, rather than truncated downwards.
This doesn't work for negative x or y, but this is an unlikely situation? If not, it is easily implemented: if x or y <0, subtract 0.5 instead.
Coverage increased (+0.3%) to 38.483% when pulling 1a2efbbd161ccfa6bdad3e736b50a28bbdecab13 on Ross-Dobson:linefit-centroid into d6f21d13d0e46a07de21512c0a25d5a97084a138 on spacetelescope:master.
Line_fit (and thus col_fit) truncate the centroid float co-ordinates to ints (the ints are used to access the array position). For example, I have a star with centroid
xout=581.24
,yout=1906.72
. It was being truncated toxx=581
correctly, butyy=1906
incorrectly - the peak pixel at y=1907 is excluded. I believeyy
should be rounded to 1907 instead, to ensure the line_fit/col_fit includes the peak pixel.In-built conversion from float to int is a flooring function, so changing
xx=int(xout)
toxx=int(xout+0.5)
(and same for y) ensures values of decimal >= .5 will get rounded correctly upwards, rather than truncated downwards.This doesn't work for negative x or y, but this is an unlikely situation? If not, it is easily implemented: if x or y <0, subtract 0.5 instead.