Skip to content

Commit

Permalink
Update photutils
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Feb 3, 2025
1 parent 1ab7133 commit 0de214e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ install_requires =
python-dateutil
requests
ruamel.yaml
typer[all]
typer
# The usage of test_requires is discouraged, see `Dependency Management` docs
# tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
Expand Down
16 changes: 8 additions & 8 deletions src/panoptes/utils/images/bayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from astropy.io import fits
from astropy.stats import SigmaClip
from loguru import logger
from photutils import Background2D
from photutils import BkgZoomInterpolator
from photutils import MMMBackground
from photutils import MeanBackground
from photutils import MedianBackground
from photutils import SExtractorBackground
from photutils.background import Background2D
from photutils.background import BkgZoomInterpolator
from photutils.background import MMMBackground
from photutils.background import MeanBackground
from photutils.background import MedianBackground
from photutils.background import SExtractorBackground

from panoptes.utils.images import fits as fits_utils

Expand Down Expand Up @@ -387,7 +387,7 @@ def get_rgb_background(data,
of boxes. The size of the median filter box for the low resolution background
is on the order of the stamp size.
Most of the options are described in the `photutils.Background2D` page:
Most of the options are described in the `photutils.background.Background2D` page:
https://photutils.readthedocs.io/en/stable/background.html#d-background-and-noise-estimation
>>> from panoptes.utils.images.bayer import RGB
Expand Down Expand Up @@ -490,7 +490,7 @@ def save_rgb_bg_fits(rgb_bg_data, output_filename, header=None, fpack=True, over
"""Save a FITS file containing a combined background as well as separate channels.
Args:
rgb_bg_data (list[photutils.Background2D]): The RGB background data as
rgb_bg_data (list[photutils.background.Background2D]): The RGB background data as
returned by calling `panoptes.utils.images.bayer.get_rgb_background`
with `return_separate=True`.
output_filename (str): The output name for the FITS file.
Expand Down
4 changes: 4 additions & 0 deletions src/panoptes/utils/images/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,13 +629,16 @@ def extract_metadata(header: fits.Header) -> dict:
try:
# Add a units doc if it doesn't exist.
unit_info = dict(
unit_id=path_info.unit_id,
name=header.get('OBSERVER'),
latitude=header.get('LAT-OBS'),
longitude=header.get('LONG-OBS'),
elevation=float(header.get('ELEV-OBS')),
)

sequence_info = dict(
unit_id=path_info.unit_id,
sequence_id=path_info.sequence_id,
time=path_info.sequence_time.to_datetime(timezone=UTC),
exptime=float(header.get('EXPTIME')),
software_version=header.get('CREATOR', ''),
Expand All @@ -656,6 +659,7 @@ def extract_metadata(header: fits.Header) -> dict:
camera_date = parse_date(header.get('DATE-OBS', path_info.image_time)).replace(tzinfo=UTC)

image_info = dict(
uid=path_info.get_full_id(sep='_'),
airmass=header.get('AIRMASS'),
camera=dict(
dateobs=camera_date,
Expand Down

0 comments on commit 0de214e

Please sign in to comment.