Skip to content

Add calibration uncertainties - #2

Draft
GCArullo wants to merge 7 commits into
asasli:mainfrom
GCArullo:codex/calibration_uncertainties
Draft

GCArullo wants to merge 7 commits into
asasli:mainfrom
GCArullo:codex/calibration_uncertainties

Conversation

@GCArullo

Copy link
Copy Markdown
Collaborator

Add calibration uncertainties similarly to bilby. Before merging we should at least:

  • 1. Add an example in which calibration is applied;
  • 2. Test on GW150914 that when applying the LVK released calibration files we obtain compatible results.

[I initially tried to use bilby functions, so that if in the future they upgrade them we don't need to separately propagate these changes, but this was breaking hyperwave parallelisation. So what I do currently is to call bilby in tests and check there that outputs are equivalent.]

Warning: I have not yet tested it properly.

@GCArullo
GCArullo marked this pull request as draft June 24, 2026 20:21
@GCArullo GCArullo changed the title Draft: Add calibration uncertainties Add calibration uncertainties Jun 24, 2026
@asasli

asasli commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Yesterday I went through the calibration. I merged the changes and I have a pp run for this. But, your implementation might be better. Maybe have a call and compare?

minaskar added a commit to minaskar/HyperWave that referenced this pull request Jun 25, 2026
get_clean_chain sized samples_in from column 0's NaN mask and then filled each
column d with givenparam[~isnan(givenparam)] -- a per-column mask. When NaNs
were uneven across parameters the columns ended up with different lengths and
either raised ValueError on assignment or silently misaligned samples across
parameters.

Extract the shared chain-loading/cleaning into _ErynSamplesMixin (inherited by
LVKinference and DataInference), delegating the NaN cleaning to
clean_eryn_chain in a new numpy-only hyperwave.inference.chains module. The new
helper applies a single ~isnan(...).any(axis=1) valid-row mask to every
dimension, so columns are guaranteed equal length and NaN-free. Also drops the
stray print(np.sum(naninds)) debug line.

Adds tests/test_chains.py covering no-NaN passthrough, whole-walker NaN
dropping, the per-dimension NaN regression, temperature selection, and a
mixin-delegation check (skipped without the full GW stack).

Task asasli#2 of the correctness/latent-bug list.
GCArullo added 5 commits June 25, 2026 22:47
# Conflicts:
#	src/hyperwave/inference/__init__.py
#	src/hyperwave/inference/priors.py
#	src/hyperwave/likelihoods/gwparallel.py
…ertainties

# Conflicts:
#	docs/index.md
#	src/hyperwave/__init__.py
#	src/hyperwave/detectors/__init__.py
#	src/hyperwave/validation.py
@asasli

asasli commented Jul 20, 2026

Copy link
Copy Markdown
Owner

@GCArullo what is the status for this?

@GCArullo

Copy link
Copy Markdown
Collaborator Author

@GCArullo what is the status for this?

I haven't had a chance to test it yet, so tests listed above are still pending.

This branch has not been deployed

No deployments
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