Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: faro
-
Labels:None
-
Story Points:1
-
Epic Link:
-
Team:DM Science
-
Urgent?:No
Description
The results from treecorr depend on the underlying OS. I get different answers when running on linux vs macOS. The following snippet shows the issu:
import numpy as np
|
import treecorr
|
import astropy.units as u
|
|
np.random.seed(8675309)
|
ra = (np.random.random(100)*0.001 + 2.)*u.radian # Move off 0/360. discontinuity
|
dec = (np.random.random(100)*0.001 - 0.1)*u.radian # Move off equator
|
e1_res = 2*np.random.random(100) - 1.
|
e2_res = 2*np.random.random(100) - 1.
|
|
pos_units = 'radian'
|
nbins = 10
|
min_sep = 0.25
|
max_sep = 5.
|
sep_units = 'arcmin'
|
|
catTree = treecorr.Catalog(ra=ra, dec=dec, g1=e1_res, g2=e2_res,
|
dec_units=pos_units, ra_units=pos_units)
|
gg = treecorr.GGCorrelation(nbins=nbins, min_sep=min_sep, max_sep=max_sep,
|
sep_units=sep_units)
|
gg.process(catTree)
|
print(gg.meanlogr)
|
On linux this gives:
[-1.2475868 -0.92888378 -0.62015337 -0.32374653 -0.02487182 0.27114931 0.56765978 0.87045272 1.14202255 1.3647294 ]
On macOS, it gives:
[-1.2475868 -0.92888378 -0.62015337 -0.32359399 -0.02516142 0.27028481 0.56836917 0.87014886 1.14075891 1.3647294 ]
Adding bin_slop to the call to GGCorrelation helps matching the bins, but it does not completely solve the architecture dependence as the xip values still differ between architectures. This is being dealt with by having reduced precision for that one test, but should be looked into.