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

Addition of WaveX model #1609

Merged
merged 70 commits into from
Aug 31, 2023
Merged

Addition of WaveX model #1609

merged 70 commits into from
Aug 31, 2023

Conversation

LuluAgazie
Copy link
Contributor

@LuluAgazie LuluAgazie commented Jul 26, 2023

  1. Implementing the Wave model (models/wavex.py) as a timing model DelayComponent with parameters:
  • WXEPOCH (MJDParameter): reference epoch either set by user or copied from PEPOCH - frozen
  • WXFREQ_000X (prefixParameter) [days^-1]: Wave frequencies set by user with integer label X - frozen
  • WXSIN_000X (prefixParameter) [s]: Sine amplitude corresponding to frequency X - free parameter
  • WXCOS_000X (prefixParameter) [s]: Cosine amplitude corresponding to frequency X - free parameter
  1. WaveX model can be read from par file or user can add it as a timing model component
  2. Added test script tests/test_wavex.py

Examples:

  1. Making fake noiseless TOAs with a model containing no WaveX component and looking at prefit residuals with models containing 1-3 WaveX components show expected sinusoidal behavior
image

One component: WXFREQ_0001 = 0.01 days^-1
Two component: WXFREQ_0001 = 0.01 days^-1 ; WXFREQ_0002 = 0.1 days^-1
Three component: WXFREQ_0001 = 0.01 days^-1 ; WXFREQ_0002 = 0.2 days^-1 ; WXFREQ_0003 = 0.5 days^-1

  1. Making fake noiseless TOAs with a model containing one WaveX component and fitting for sine and cosine amplitude:

fit_single_comp

Prefit model WaveX component :
WaveX(
MJDParameter( WXEPOCH 55321.0000000000000000 (d) frozen=True),
floatParameter( WXFREQ_0001 0.1 (1 / d) frozen=True),
floatParameter( WXSIN_0001 0.001 (s) +/- 0.0 s frozen=False),
floatParameter( WXCOS_0001 0.0 (s) +/- 0.0 s frozen=False))

Postfit model results for WaveX component:
WaveX(
MJDParameter( WXEPOCH 55321.0000000000000000 (d) frozen=True),
floatParameter( WXFREQ_0001 0.1 (1 / d) frozen=True),
floatParameter( WXSIN_0001 0.001000038898416328 (s) +/- 4.481880899175662e-08 s frozen=False),
floatParameter( WXCOS_0001 -3.283614132428176e-08 (s) +/- 4.4763897206286186e-08 s frozen=False))

TO DO: conversion from Wave to WaveX

@LuluAgazie LuluAgazie changed the title WIP: Addition of Wavex model WIP: Addition of WaveX model Jul 26, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 67.86% and no project coverage change.

Comparison is base (3a2910f) 68.25% compared to head (325940e) 68.26%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1609    +/-   ##
========================================
  Coverage   68.25%   68.26%            
========================================
  Files          99      100     +1     
  Lines       22806    23108   +302     
  Branches     3920     4009    +89     
========================================
+ Hits        15567    15774   +207     
- Misses       6276     6343    +67     
- Partials      963      991    +28     
Files Changed Coverage Δ
src/pint/models/timing_model.py 83.62% <ø> (ø)
src/pint/utils.py 57.81% <44.53%> (-2.30%) ⬇️
src/pint/models/wave.py 80.30% <58.82%> (-2.39%) ⬇️
src/pint/models/wavex.py 87.42% <87.42%> (ø)
src/pint/models/__init__.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LuluAgazie LuluAgazie changed the title WIP: Addition of WaveX model Addition of WaveX model Aug 25, 2023
@dlakaplan dlakaplan added the awaiting review This PR needs someone to review it so it can be merged label Aug 25, 2023
@abhisrkckl
Copy link
Contributor

I have merged David's RTD fix PR. Can you merge the master here?

CHANGELOG-unreleased.md Outdated Show resolved Hide resolved
src/pint/models/wave.py Outdated Show resolved Hide resolved
src/pint/models/wave.py Show resolved Hide resolved
src/pint/models/wave.py Show resolved Hide resolved
src/pint/models/wavex.py Outdated Show resolved Hide resolved
src/pint/models/wavex.py Show resolved Hide resolved
src/pint/utils.py Outdated Show resolved Hide resolved
src/pint/utils.py Outdated Show resolved Hide resolved
from io import StringIO
import pytest
import numpy as np
import logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using logging, it's better to use loguru since that's what the rest of pint uses.

tests/test_wavex.py Outdated Show resolved Hide resolved
@abhisrkckl
Copy link
Contributor

Hi.. I see that the patch coverage is only 63%. Can you make sure that it's at least 70%?

@abhisrkckl abhisrkckl merged commit 5f77ec1 into nanograv:master Aug 31, 2023
8 checks passed
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.

3 participants