Skip to content

Commit

Permalink
debugging github tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bailey authored and Stephen Bailey committed Dec 4, 2024
1 parent 67e6031 commit 2d6fd7c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions py/desispec/test/test_fiberflat.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,22 @@ def test_gradient_correction(self):
ff.fibermap = fibermap
#- add +/- 5% tilt edge-to-edge
tilt = 1 + 0.05*fibermap['FIBERASSIGN_X']/400
# tilt = np.ones(self.nspec)
print(f'DEBUG: {petal=} {np.min(tilt)=} {np.max(tilt)=}')
print(f'DEBUG: {petal=} {np.min(ff.fiberflat)=} {np.max(ff.fiberflat)=}')
for i in range(ff.fiberflat.shape[0]):
ff.fiberflat[i] *= tilt[i]

tilted_fiberflats[camera] = ff

final_fiberflats = gradient_correction(tilted_fiberflats, ref_fiberflats)
try:
final_fiberflats = gradient_correction(tilted_fiberflats, ref_fiberflats)
except Exception as err:
for petal in range(10):
camera = f'r{petal}'
ffratio = tilted_fiberflats[camera].fiberflat / ref_fiberflats[camera].fiberflat
print(f'DEBUG: {camera=} {ffratio=}')

raise err

for cam in final_fiberflats:
self.assertTrue(np.allclose(final_fiberflats[cam].fiberflat, ref_fiberflats[cam].fiberflat))

0 comments on commit 2d6fd7c

Please sign in to comment.