BEAST-Fitting / megabeast

Hierarchical Bayesian Model for Ensembles of Dust Extinguished Stellar Populations
http://megabeast.readthedocs.io/
2 stars 11 forks source link

Incorrect pixel coordinates in naive map script #33

Closed drvdputt closed 4 years ago

drvdputt commented 5 years ago

I've been using the make_naive_maps script for a while now, and I've always felt like there was something off about the coordinate system.

I believe I have now found the error. There's two mistakes when the RA and Dec of the sources are converted to pixel coordinates of the map WCS.

So 1.6 would belong belongs to pixel 2, not pixel 1. Therefore, the floating point pixel coordinates should be rounded, not truncated.

# this is wrong
x = pixcrd[:, 0].astype(int)
# this should be ok
x = np.rint(pixcrd[:, 0]).astype(int)

This is fixed in my own branch, but there are some other changes. I'll put in a clean pull request once I'm more sure that my own code is correct.

karllark commented 5 years ago

Great. Looking forward to the PR!

karllark commented 4 years ago

@drvdputt : is this still a bug or has it been fixed? Or am I still waiting for the PR? :-)

drvdputt commented 4 years ago

I did a quick search through the issues, and found that @lea-hagen already replaced this code in PR #39. So this can be closed.