Conversation
… and performance in EXOCAT1 and tieredScheduler classes
| # fZ = ZL.fZ(Obs, TL, sInds, TK.currentTimeAbs.copy(), char_mode) | ||
| # Walker previous version. | ||
| JEZ = TL.JEZ0[char_mode["hex"]][sInds][self.known_earths] | ||
| JEZ = TL.JEZ0[char_mode["hex"]][sInds] |
There was a problem hiding this comment.
isn't this changing the logic? or was self.known_earths guaranteed to be a completely full array?
There was a problem hiding this comment.
sInds = SU.plan2star[self.known_earths] (4 lines above this change) already selects the host star for each known Earth. Therefore, TL.JEZ0[...][sInds] already contains the selected values. Applying global planet indices again is incorrect. For example, known planets [1, 4] produce two selected sInds values; indexing those with [1, 4] raises an out-of-bounds error.
| # PERFORM DETECTION and populate revisit list attribute. | ||
| # First store dMag, WA | ||
| if np.any(pInds): | ||
| if pInds.size: |
There was a problem hiding this comment.
what numpy behavior change is leading to all these changes of np.any to a test on .size?
There was a problem hiding this comment.
This fixes an existing logic bug, not a NumPy behavior change: np.any([0]) is false even though the index array contains one valid element. .size checks whether elements exist.
The EXOCAT1 .item() change is the separate NumPy compatibility fix (this preserves the intended behavior when there is exactly one matching HIP entry.).
|
|
||
| fZ = ZL.fZ(Obs, TL, sInd, startTime, mode) | ||
| JEZ = JEZs[tochar] | ||
| JEZ = JEZs |
There was a problem hiding this comment.
isn't this also a logical change from before? won't the resulting array be a different size?
There was a problem hiding this comment.
Couple of lines below, calc_intTime() call applies the filtering consistently to all the quantities of interest.
see OS.calc_intTime(TL, sInd, fZ, JEZ[tochar], dMag[tochar], WAp[tochar], mode).
Suppose a star has three planets, but only the first and third should be characterized:
tochar = [True, False, True]
Previously, JEZ was filtered immediately:
JEZ = JEZs[tochar] # 2 entries
But dMag and WAp still contained three entries. The call then mixed these sizes:
OS.calc_intTime(TL, sInd, fZ, JEZ, dMag, WAp, mode)
# JEZ -> 2 dMag -> 3 Was -> 3 entries
Calculations combining those arrays could fail because their elements no longer aligned.
The fix keeps all arrays at three entries while preparing the planet properties, then selects the same planets from every input:
OS.calc_intTime(
TL, sInd, fZ,
JEZ[tochar], dMag[tochar], WAp[tochar], mode
)
Previously, WAp and dMag were never filtered / shortened with tochar.
Describe your changes
Fix compatibility and indexing issues in
tieredSchedulerandEXOCAT1:np.any()where used as an emptiness check, preserving valid index0.t_det=Noneas zero days so no-target returns do not cause a multiplication error..item()for EXOCAT1 scalar index assignment to support newer NumPy versions.Type of change
Validation
Targeted checks passed for JEZ units, planet subsets, inflection caching, and a short simulation. EXOCAT1 scalar assignment was also checked with NumPy 2.5.
No new test files are included.
Checklist before requesting a review
e2eTests-> all 14 scripts passed.