lalsimutils: phi12, chi_p_vec, vectorized in-plane spin coordinates (O4d port of #203) - #377
Conversation
…nates rift_O4d port of oshaughn#203. extract_param gains phi12 (listed in valid_params but not implemented) and chi_p_vec, the vector-sum analogue of chi_p (same A1, A2 weights). The spherical branch of convert_waveform_coordinates builds chi1_perp, chi2_perp, phi12, SOverM2_perp, DeltaOverM2_perp and chi_p_vec vectorized, when spin_convention is "L"; otherwise they fall through to extract_param as before. test_ring_coordinates.py joins the core-units gate; its floors are re-measured at 600/587. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| for p in ring_names: | ||
| if p in coord_names_reduced: | ||
| x_out[:,coord_names.index(p)] = ring_vals[p] | ||
| coord_names_reduced.remove(p) |
There was a problem hiding this comment.
[P2] Preserve enforce_kerr when moving ring coordinates out of the fallback
At head 0f933e7a7a2a1f772eb4feba21e03303d29a80e1, removing these outputs from coord_names_reduced lets the existing early return bypass the only enforce_kerr check, which runs in the per-row fallback. This changes the behavior of existing SOverM2_perp/DeltaOverM2_perp outputs and can admit super-Kerr rows through CIP's --downselect-enforce-kerr coordinate transformation. Reproduced with L convention, low_level_coord_names=['mc','delta_mc','chi1','cos_theta1','phi1','chi2','cos_theta2','phi2'], x_in=np.array([[20.,.3,1.2,.2,1.,.5,.4,2.]]), coord_names=['SOverM2_perp'], and enforce_kerr=True: parent f0d90b21 returns [[-inf]], whereas PR head returns [[0.52919969]]. Adding chi_p to the requested head outputs returns [[-inf,-inf]] because it forces fallback, so row validity now depends on the output feature list. Apply the Kerr rejection mask before the vectorized early return (or retain fallback when enforcement is requested), and cover both super-Kerr and valid rows in a regression test.
|
[P2] Use one Adversarial review of head Concrete reproduction (NumPy backend): LOW = ['mc','delta_mc','chi1','cos_theta1','phi1','chi2','cos_theta2','phi2']
x = np.array([[20., .3, 0., .2, 1., .5, .4, 2.]])
convert_waveform_coordinates(x, coord_names=['phi12'], low_level_coord_names=LOW)
# [[1.]]
# Build the equivalent Cartesian ChooseWaveformParams:
# spin 1 = (0,0,0), spin 2 azimuth = 2 radians
P.extract_param('phi12')
# 2.0The same mismatch occurs with nonzero Please apply a common canonical policy in both paths and add zero-spin/aligned-pole cases to the agreement test. The two submitted tests pass, as do 1,000 additional random nondegenerate draws and individual-coordinate subsets; their continuous random draws never exercise these boundaries. |
…arams From review of the O4d port (#377), which applies here too: - The vectorized in-plane block can end convert_waveform_coordinates before the per-row fallthrough, whose enforce_kerr rule then never ran. The block now applies the same rule (row set to -inf if chi1 or chi2 > 1). Sets that do not use the in-plane names are bit-identical to the base, with and without enforce_kerr. - chi_p_vec is removed from valid_params: grid readers call assign_param on every listed column, and chi_p_vec is derived only. CIP does not need it there. - phi12 cannot return exactly 2 pi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rr, phi12) From adversarial review of this PR and of the O4c version (#203 upstream): - CIP's default sampler passes an object array of python floats; the ring block's ufuncs raised TypeError, so CIP exited 1 with these fit coordinates. The block now casts to float. - The ring block can end convert_waveform_coordinates before the per-row fallthrough, whose enforce_kerr rule then never ran. The block applies it. - phi12 is 0 in both paths when an in-plane spin vanishes (they disagreed), cannot return exactly 2 pi, and joins periodic_params. - chi_p_vec leaves valid_params: grid readers assign_param every listed column. - Tests: phi12 at pi/3 in both paths, object arrays, zero in-plane spin, Kerr, valid_params. Core-units floors re-measured: 605/592. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing-coordinate port Conflict only in .travis/test-core-units.sh: both sides added a test file and raised the floors. Kept both files; floors re-measured on the merged tree (ldas-grid, numpy backend): junit 616 collected / 603 passed / 13 skipped / 0 failed, 3 subtests, so 613/600. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rift_O4d port of oshaughn#203.
extract_paramgainsphi12(listed invalid_params, never implemented) andchi_p_vec, the vector sum of the in-plane terms inchi_p. The spherical-spin branch ofconvert_waveform_coordinatesbuildschi1_perp,chi2_perp,phi12,SOverM2_perp,DeltaOverM2_perpandchi_p_vecvectorized, in the L frame only.Review fixes, also applied to #203: the block accepts CIP's object arrays (the default sampler crashed), keeps the
enforce_kerrrule, and returnsphi12= 0 at zero in-plane spin.chi_p_vecis not invalid_params, since grid readers assign every listed column.No defaults change. The CIP width results (RIFT_roboto_paper
analyses/transverse_convergence/RESULTS_ring_coordinate_2026-09-30.md) were measured on rc3, not O4d.Tests (ldas-grid, IGWN python 3.11, numpy):
test_ring_coordinates.py: 7 passedtest-core-units.sh: PASS, 608 collected, 595 passed, 0 failed; floors 605/592🤖 Generated with Claude Code