msimet / Stile

Stile: the Systematics Tests In Lensing pipeline
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

#33 Move to TreeCorr for correlation function tests #35

Closed msimet closed 9 years ago

msimet commented 10 years ago

This is a PR to merge code that uses the TreeCorr package rather than corr2. A lot of this is inside baseball for the workings of the CorrelationFunctionSysTest, but I will highlight in particular:

Unfortunately, due to both rewriting a lot of the file & changing its name, the GitHub interface thinks stile/treecorr_utils.py and stile/test_treecorr_utils.py are entirely new files. Hopefully it's not too terrible to read, though.

HironaoMiyatake commented 10 years ago

I got the following error and found that this is due to recent change on API in TreeCorr (G2Correlation -> GGCorrelation). I think you assume we use v3.0, but it might be better to adjust that to v3.1. http://rmjarvis.github.io/TreeCorr/html/changes.html#api-changes Actually this v3.1 was released after your PR, so my slow review should be blamed!

[miyatake@tiger3 Stile]$ python examples/example_run.py 
ERROR: RuntimeError: module compiled against API version 9 but this version of numpy is 6 [astropy.io.fits.hdu.compressed]
RuntimeError: module compiled against API version 9 but this version of numpy is 6
ERROR: AttributeError: 'module' object has no attribute 'G2Correlation' [unknown]
Traceback (most recent call last):
  File "examples/example_run.py", line 3, in <module>
    import stile
  File "/tigress/HSC/users/miyatake/Stile/stile/__init__.py", line 8, in <module>
    from .sys_tests import (GalaxyShearSysTest, BrightStarShearSysTest, StarXGalaxyShearSysTest,
  File "/tigress/HSC/users/miyatake/Stile/stile/sys_tests.py", line 98, in <module>
    treecorr_func_dict = {'g2': treecorr.G2Correlation,
AttributeError: 'module' object has no attribute 'G2Correlation'
msimet commented 10 years ago

Okay, I think this is back up and running now. The bug Hironao found has been fixed, and I realized that some different correlation function types weren't fully supported, so those have been added as well.

If you're interested in doing a code review on this branch...please do! Thanks!

msimet commented 9 years ago

OK, I think I've addressed everybody's comments so far...I'll give it a few more days to let people look over the changes, and merge perhaps Tuesday night unless further changes are needed.