Issue/635/Modify coordinate system implementation
Recreating PR #636 with correct branch name.
I've noticed I still have to update other notebooks that had coordinate system examples. Working on it right now.
coverage: 100.0%. remained the same when pulling 8fcea5add59b1472bedd44eaf27cf54b1551e5c0 on issue/635/coordinate_implementation into 1525a26f0c3d664a2fff145303f1bb1d883bb53f on main.
@caioolivv is this PR ready for review? If so, could you convert from 'draft' to 'ready to review' ?
@caioolivv is this PR ready for review? If so, could you convert from 'draft' to 'ready to review' ?
Hi, its done now! Sorry for the delay
@caioolivv There seems to be a problem with the cross shear.
@caioolivv There seems to be a problem with the cross shear.
I believe the that's double precision floating point error? g_x should be 0 for all since there's no shapenoice, and we're getting a random signal in the order of 10^-17. I can try to see if the same happens if we add shapenoise.
Okay, they're definitely flipping the signal for g_x even with shapenoise. I'll try and find where's the bug.
Thanks! I was just testing the same thing.
In the notebook, I suggest adding shapenoise=0.05"` in the source kwargs. Also for the histogram of values, could you change to (for visibility) :
f, ax = plt.subplots(1, 2, figsize=(10, 4))
ax[0].hist(cl_euclidean.galcat["et"], bins=50, color="tab:blue", alpha=0.5, label='euclidean')
ax[0].hist(cl_celestial.galcat["et"], bins=50, color="tab:red", histtype='step', label='celestial')
ax[0].hist(cl_wrong.galcat["et"], bins=50, color="tab:orange", alpha=0.5, histtype='stepfilled', label='incorrect coordinate system')
ax[0].set_xlabel("$\\epsilon_t$", fontsize="xx-large")
ax[1].hist(cl_euclidean.galcat["ex"], bins=50, color="tab:blue", alpha=0.5, label='euclidean')
ax[1].hist(cl_celestial.galcat["ex"], bins=50, color="tab:red", histtype='step', label='celestial')
ax[1].hist(cl_wrong.galcat["ex"], bins=50, color="tab:orange", alpha=0.5, histtype='stepfilled', label='incorrect coordinate system')
ax[1].set_xlabel("$\\epsilon_x$", fontsize="xx-large")
ax[1].set_yscale("log")
plt.legend()
plt.show()
What worries me is that this bug seemed to have pass the tests...
Wait, isn't that right though? Mirroring the x-axis consists of doing phi -> pi - phi, which is supposed to change the sign of e_x too.
Hi @caioolivv, @m-aguena, @marina-ricci - I'm starting the review this PR. Here are a first few things I noticed:
- [x] there's currently a minor conflict to be solved with
main. - [x] the
demo_coordinate_systemnotebook is missing two imports for the "HSC Y3" section to work properly. Namely
from astropy.io import fits
from scipy import spatial
- [x] maybe consider adding a warning to the
update_coordinate_systemfunction to warn the user that no conversion is undertaken ifcoordinate_system == in_coordinate_system?
@caioolivv can you save a copy of the data generated by the demo_coordinate_system_datasets.ipynb notebook at cc-in2p3 in
/sps/lsst/groups/clusters/CLMM/HSC_data_example/
and comment it on the notebook?
Thanks
Thanks @m-aguena! Though merging is still blocked. I don't have permission to push to main. Can you approve the PR?
