Closed JoschaJ closed 5 years ago
Thanks @Josch6i -- I haven't played around with IGM mode so hadn't identified this. It's on my todo list but not sure when I'll get to it (hence the pull-request-welcome tag)
Hey @Josch6i -- I am now getting the data, but haven't tested that the output is as expected.
In fact, looks like it doesn't match:
dcprice@dainkoru:/data/install/ymw16$ ./ymw16 -d data/ IGM 204 -6.5 2000 1
IGM: gl= 204.000 gb= -6.500 DM= 2000.00 DM_Gal: 252.05 DM_MC: 0.00 DM_IGM: 1647.95 DM_Host: 100.00 z: 2.311 Dist: 5336.4 log(tau_sc): -2.218
versus:
In [8]: import pyymw16
...: dist, tau = pyymw16.dm_to_dist(204, -6.5, 2000, mode='igm')
...: print dist, np.log10(tau.value)
5521.25634766 Mpc -2.18471231199
maybe not subtracting DM of galaxy?
Hey Danny, I can do some testing on Monday and give you feedback.
Thanks @Josch6i -- I found the reason why the output differed: the ymw16 command line defaults to a Host DM of 100, whereas my wrapper was plugging in a 0. I'm going to stick with DM_Host=0 as default, as that is more sane behaviour IMO.
PS: Checkout https://github.com/abatten/fruitbat if you're doing redshift calculations!
Hey @telegraphic , I think everything should be good now. I saw fruitbat already but I thought its still nice to have this working consistently. Sorry that I couldn't help with the main issue since I don't have much experience with C++. Thanks!
Thanks @Josch6i, appreciate your help 👍
In the functions
dist_to_dm
anddm_to_dist
the argument mode='igm' gives a KeyError. Here is the in- and output from the ipython console:It seems that from the C++ function
dmdtau
only the first two returns are put in a dictionary while the rest is printed.