Comrade.jl icon indicating copy to clipboard operation
Comrade.jl copied to clipboard

Complete refactor and rewrite of instrument modeling

Open ptiede opened this issue 1 year ago • 0 comments

This PR will serve as the staging ground for the Comrade instrument modeling refactor. The goal is to completely rewrite how instrument modeling is organized and tremendously simplify the user-facing interface. The new interface will look like it will be broken into three parts:

  1. Users define the Jones matrix parameterization.
  2. Users specify the Jones matrix priors abstractly.
  3. The array used for the observations is set, and everything is initialized.

We also are moving away from design matrices. Instead, the data layout will be managed by a set of arrays of indices that map from site-specific vectors to baseline-specific vectors. This allows me to handle everything much more efficiently and effectively construct the instrument model in a single loop, rather than multiple sparse matrix vector multiplications and broadcasting, which allocated more and did more computation. Additionally, in future releases, we can probably re-organize the data to be maximally cache-friendly due to some abstractions.

TO DO

  • [ ] Introduce SiteArray and add tests
  • [x] Make SiteArray ChainRules ProjectTo friendly
  • [x] Introduce SiteMap for efficient creation of SiteArrays
  • [x] Reorganize the data format to fully separate ArrayConfiguration from measurements
  • [ ] Rewrite testing infrastructure
  • [ ] Rewrite examples
  • [ ] Benchmark and write additional rules to make things work

ptiede avatar Apr 16 '24 12:04 ptiede