Skip to content

Commit

Permalink
Work around a metadata merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcraig committed Dec 11, 2023
1 parent 9d16414 commit e42be8e
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions stellarphot/photometry/tests/test_photometry.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import tempfile
from pathlib import Path
import warnings

import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import EarthLocation
from astropy.io import ascii
from astropy.utils.data import get_pkg_data_filename
from astropy.utils.metadata.exceptions import MergeConflictWarning

from fake_image import FakeCCDImage, shift_FakeCCDImage

from stellarphot.core import Camera, SourceListData
Expand Down Expand Up @@ -402,6 +405,7 @@ def test_photometry_on_directory():
f"tempfile_{i:02d}.fit" for i in range(1, num_files + 1)]
# Write the CCDData objects to files
for i, image in enumerate(fake_images):
from time import sleep; sleep(1)
image.write(temp_file_names[i])

object_name = fake_images[0].header['OBJECT']
Expand All @@ -418,18 +422,22 @@ def test_photometry_on_directory():
fwhm=fake_images[0].sources['x_stddev'].mean(),
threshold=10)

phot_data = multi_image_photometry(temp_dir,
object_name,
found_sources,
fake_camera,
fake_obs,
aperture_settings,
shift_tolerance, max_adu, fwhm_estimate,
include_dig_noise=True,
reject_too_close=True,
reject_background_outliers=True,
passband_map=None,
fwhm_by_fit=True)
with warnings.catch_warnings():
warnings.filterwarnings("ignore",
message="Cannot merge meta key",
category=MergeConflictWarning)
phot_data = multi_image_photometry(temp_dir,
object_name,
found_sources,
fake_camera,
fake_obs,
aperture_settings,
shift_tolerance, max_adu, fwhm_estimate,
include_dig_noise=True,
reject_too_close=True,
reject_background_outliers=True,
passband_map=None,
fwhm_by_fit=True)

# For following assertion to be true, rad must be small enough that
# no source lies within outer_annulus of the edge of an image.
Expand Down

0 comments on commit e42be8e

Please sign in to comment.