-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulate correlated DM noise in wideband TOAs #1868
Changes from 11 commits
99862c4
90d6539
45ff99f
fdf0ba9
fb94676
7bfb6f8
0f37e15
29feb02
bffe712
f6cbcd5
403433b
ce48d47
eaacbb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -511,3 +511,57 @@ def test_simulate_uniform_multifreq(multifreq): | |
multi_freqs_in_epoch=multifreq, | ||
) | ||
assert len(t) == ntoas | ||
|
||
|
||
def test_simulate_wideband_dmgp(): | ||
par = """ | ||
PSRJ J0023+0923 | ||
RAJ 00:23:16.8790858 1 0.00002408141295805134 | ||
DECJ +09:23:23.86936 1 0.00082010713730773120 | ||
F0 327.84702062954047136 1 0.00000000000295205483 | ||
F1 -1.2278326306812866375e-15 1 3.8219244605614075223e-19 | ||
PEPOCH 56199.999797564144902 | ||
POSEPOCH 56199.999797564144902 | ||
DMEPOCH 56200 | ||
DM 14.327978186774068347 1 0.00006751663559857748 | ||
BINARY ELL1 | ||
PB 0.13879914244858396754 1 0.00000000003514075083 | ||
A1 0.034841158415224894973 1 0.00000012173038389247 | ||
TASC 56178.804891768506529 1 0.00000007765191894742 | ||
EPS1 1.6508830631753595232e-05 1 0.00000477568412215803 | ||
EPS2 3.9656838708709247373e-06 1 0.00000458951091435993 | ||
CLK TT(BIPM2015) | ||
MODE 1 | ||
UNITS TDB | ||
TIMEEPH FB90 | ||
DILATEFREQ N | ||
PLANET_SHAPIRO N | ||
CORRECT_TROPOSPHERE N | ||
EPHEM DE436 | ||
TNRedAmp -13.3087 | ||
TNRedGam 1.5 | ||
TNRedC 14 | ||
TNDMAMP -12.2 | ||
TNDMGAM 3.5 | ||
TNDMC 15 | ||
""" | ||
|
||
m = get_model(io.StringIO(par)) | ||
t = pint.simulation.make_fake_toas_uniform( | ||
startMJD=54000, | ||
endMJD=56000, | ||
ntoas=200, | ||
model=m, | ||
add_noise=True, | ||
wideband=True, | ||
add_correlated_noise=True, | ||
) | ||
|
||
assert t.is_wideband() | ||
|
||
# There is correlated noise in DMs | ||
assert ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is some sort of a chi^2 test? Is there no better way to check for correlated noise? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. A better test will be something like Ljung-Box test. Unfortunately, it is not available in scipy. We will need to add statsmodels as a dependency to use that test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like that test would not be very hard to implement, maybe include in PINT utils. Although it may not be needed just for this, it could be more broadly useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK... I have added the Ljung-Box test. For this I added statsmodels as a dependency for tests. It is not a dependency for the package itself since it is not used anywhere in the main code. #1776 may change that though. |
||
sum(((t.get_dms() - m.total_dm(t)) / m.scaled_dm_uncertainty(t)) ** 2).si.value | ||
/ len(t) | ||
> 10 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently there is no way to distinguish between achromatic noise models and noise models that represent DM noise (such as PLDMNoise) that affects the DM part of the wideband likelihood. I added this attribute to distinguish such noise components. The timing model components that introduce a DM correction can already be distinguished by checking if they are derived from the
Dispersion
class.