Skip to content
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 wideband TOAs using zima #1429

Merged
merged 38 commits into from
Jan 24, 2023
Merged

Simulate wideband TOAs using zima #1429

merged 38 commits into from
Jan 24, 2023

Conversation

abhisrkckl
Copy link
Contributor

@abhisrkckl abhisrkckl commented Oct 31, 2022

I have added wideband TOA simulation capability to zima. The underlying functionality is of course implemented in pint.simulation.

This is invoked using two new command line options --wideband and --dmerror).
Here is an example command:
$ zima --startMJD=56600 --addnoise --wideband --dmerror=1e-4 J0100+8023.par J0100+8023.sim

This feature computes the expected DM time series using the model (from the input par file), adds white noise based on the --dmerror option, and sets appropriate -pp_dm and -pp_dme flags.

The injected error takes care of the DMEFACs and DMEQUADs as follows: -pp_dme are set equal to the --dmerror, and the injected noise is computed with the help of model.scaled_dm_uncertainty(toas).

@abhisrkckl
Copy link
Contributor Author

My use case for this is that I need to simulate WB TOAs to test PR #1426.

@abhisrkckl abhisrkckl added the awaiting review This PR needs someone to review it so it can be merged label Oct 31, 2022
@abhisrkckl abhisrkckl removed the awaiting review This PR needs someone to review it so it can be merged label Nov 1, 2022
@abhisrkckl abhisrkckl changed the title Simulate wideband TOAs using zima [WIP] Simulate wideband TOAs using zima Nov 1, 2022
@dlakaplan
Copy link
Contributor

I haven't used zima extensively. Have you checked this using the straight python interface in pint.simulation? When I tested those for NB data they did respect EFAC/EQUAD in the model, but I don't know if I did WB data.

@abhisrkckl
Copy link
Contributor Author

abhisrkckl commented Nov 1, 2022

The earlier behaviour in pint.simulation was to put arbitrary dm values in the toa files instead of computing them based on the model. I have changed that.

The wierd thing is that the parameters are estimated correctly for narrowband data. The under/overestimate happens only for wideband. I had checked this before doing the previous PR and re-checked now.

I am planning to do more simulations of the same par file and see if this is systematic or happens randomly.

@abhisrkckl abhisrkckl marked this pull request as draft November 15, 2022 18:02
@codecov
Copy link

codecov bot commented Nov 17, 2022

Codecov Report

Base: 66.16% // Head: 66.19% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (ee61945) compared to base (7c840a7).
Patch coverage: 86.11% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1429      +/-   ##
==========================================
+ Coverage   66.16%   66.19%   +0.02%     
==========================================
  Files          91       91              
  Lines       21353    21367      +14     
  Branches     3701     3702       +1     
==========================================
+ Hits        14128    14143      +15     
+ Misses       6371     6370       -1     
  Partials      854      854              
Impacted Files Coverage Δ
src/pint/residuals.py 73.49% <ø> (ø)
src/pint/simulation.py 83.44% <76.19%> (+1.75%) ⬆️
src/pint/scripts/zima.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@abhisrkckl abhisrkckl changed the title [WIP] Simulate wideband TOAs using zima WIP: Simulate wideband TOAs using zima Dec 1, 2022
@abhisrkckl abhisrkckl marked this pull request as ready for review January 13, 2023 21:40
@abhisrkckl abhisrkckl added the awaiting review This PR needs someone to review it so it can be merged label Jan 13, 2023
@abhisrkckl abhisrkckl changed the title WIP: Simulate wideband TOAs using zima Simulate wideband TOAs using zima Jan 13, 2023
@dlakaplan
Copy link
Contributor

dlakaplan commented Jan 20, 2023

Can you add a test in test_fake_toas to do the wb toas without zima?

@abhisrkckl
Copy link
Contributor Author

I have added the test in test_fake_toas.

@dlakaplan
Copy link
Contributor

This looks good. Do you want me to merge or wait until the meeting to discuss?

@abhisrkckl
Copy link
Contributor Author

We had discussed this a few times in the past meetings. I think this is OK to merge.

@dlakaplan
Copy link
Contributor

OK, I think you might just need a CHANGELOG entry

@dlakaplan dlakaplan merged commit e710521 into nanograv:master Jan 24, 2023
@abhisrkckl abhisrkckl deleted the wbsim branch January 24, 2023 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review This PR needs someone to review it so it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants