Skip to content

Commit

Permalink
Fix the mock fits errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykubica committed Dec 17, 2024
1 parent f433ef4 commit 7f3dc49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ def test_is_empty_value(self):
self.assertFalse(np.any(nums_is_empty))

pairs_is_empty = table.is_empty_value("pairs")
print(pairs_is_empty)
self.assertTrue(np.array_equal(pairs_is_empty, expected))

def test_filter_by_index(self):
Expand Down
8 changes: 8 additions & 0 deletions tests/utils/mock_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ def get_fits(self, fits_idx, spoof_data=False):
warnings.filterwarnings("ignore", category=AstropyUserWarning)
for hdr_idx, HDUClass in enumerate(self.hdu_types):
hdr = HDUClass()

# Remove the cards that know we will reinsert them below and
# require a specific order. We rely on the file order.
for key in ["GCOUNT", "NAXIS", "NAXIS1", "NAXIS2", "PCOUNT"]:
if key in hdr.header:
del hdr.header[key]

# Insert all the cards from the file.
for k, v, f in hdu_group.groups[hdr_idx]["keyword", "value", "format"]:
hdr.header[k] = self.lexical_cast(v, f)
hdul.append(hdr)
Expand Down

0 comments on commit 7f3dc49

Please sign in to comment.