Skip to content

WIP: feat time domain solar wind covariance#1966

Open
jeremy-baier wants to merge 20 commits intonanograv:masterfrom
jeremy-baier:feat/jgb-td-solar-wind-gp
Open

WIP: feat time domain solar wind covariance#1966
jeremy-baier wants to merge 20 commits intonanograv:masterfrom
jeremy-baier:feat/jgb-td-solar-wind-gp

Conversation

@jeremy-baier
Copy link
Copy Markdown
Contributor

@jeremy-baier jeremy-baier commented Feb 23, 2026

Needed for NG20.
Major changes

  • Making phi either 1d or 2d. Necessary for 2-dimensional kernels.
  • Addition of said 2d kernels for the solar wind only for now.
  • Time domain interpolation bases to go with the above. Both custom ( for Bayesian Blocking ) and uniform bins.
  • Since above, need to switch trivia phi inversion to use a cholesky decomposition with a np inversion fallback.

More work should really explore additional caching of various parts of the GLS fit when the noise model is being held constant. This might be sub blocks of the design matrix. Or a refactorization of the GLS implementation.

TODO

  • unit tests
  • should check that our basis and phi matrix match those of discovery. (might consider adding tests for this).
  • additional model validations ?
  • Try refactoring so there is one TimeDomainSolarWindNoise class with a kernel parameter

Disclosure that I used co-pilot for generating the unit tests as well as some docstrings and type hinting.

Copy link
Copy Markdown
Member

@scottransom scottransom left a comment

Choose a reason for hiding this comment

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

There's a lot in here and it is beyond me to go through carefully line-by-line! We definitely need to make sure that there are some test cases and/or examples available that provide results that you believe are correct.

ecorrs = self.get_ecorrs()
if nweights is None:
ts = (toas.table["tdbld"].quantity * u.day).to(u.s).value
ts = get_tdb_seconds(toas.table)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason that isn't just tbl as in the other calls?

self.TDSWLOGSIG.value
except AttributeError:
log.warning(
"TDSWLOGSIG is not set, using default value of -6.0 s for TimeDomainRidgeSWNoise"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The "-6.0 s" might be confusing in that description. Maybe say something like default value of -6.0 (i.e. 1 us)?

return project_basis_covariance(Fmat, phi)


class TimeDomainRidgeSWNoise(NoiseComponent):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Each of the TimeDomainXXXSWNoise classes seem very similar and therefore have a lot of code replication. Would it be difficult to make a TomeDomainSWNoise class where the kernel was a parameter that would eliminate much of that replication?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is a good suggestion. We really should modularize this if possible. I will have to look into this and see about a refactoring. This might take a minute but it would really clean up the code.

@jeremy-baier
Copy link
Copy Markdown
Contributor Author

thanks for the comments, Scott ! I will take a look and see about implementing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants