Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to no longer use SEP and use astropy Photutils instead. #374

Merged
merged 15 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Docker Image

concurrency: ${{ github.workflow }}-${{ github.ref }}

on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- master

jobs:
build-push:

runs-on: ubuntu-latest

permissions:
contents: write
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and also push Dockerimage
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.13.0 (2023-10-05)
-------------------
- Migrated photometry extraction to be done by astropy's photutils instead of SEP.

1.12.0 (2023-08-10)
-------------------
- Added the process_by_group keyword to stages to fix a bug that wouldn't allow grouping only by instrument
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
FROM continuumio/miniconda3:4.10.3
FROM continuumio/miniconda3:23.5.2-0

RUN conda install -y numpy pip scipy astropy pytest mock requests ipython coverage pyyaml\
&& conda install -y -c conda-forge kombu=4.4.0 elasticsearch\<6.0.0,\>=5.0.0 pytest-astropy mysql-connector-python\
&& conda clean -y --all

RUN pip install --no-cache-dir cython logutils lcogt_logging python-dateutil sqlalchemy\>=1.3.0b1 psycopg2-binary celery[redis]==4.3.0 \
apscheduler ocs-ingester tenacity amqp==2.6.0 cosmic-conn
# In principle I could remove the gcc to shrink the image, but pytorch is already so large it doesn't make much difference
RUN apt-get -y update && apt-get -y install gcc && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*

RUN mkdir /home/archive && /usr/sbin/groupadd -g 10000 "domainusers" \
&& /usr/sbin/useradd -g 10000 -d /home/archive -M -N -u 10087 archive \
&& chown -R archive:domainusers /home/archive

COPY --chown=10087:10000 . /lco/banzai

RUN apt-get -y update && apt-get -y install gcc && \
pip install --no-cache-dir git+https://github.com/cmccully/sep.git@deblending /lco/banzai/ && \
apt-get -y remove gcc && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*

USER archive

ENV HOME /home/archive

WORKDIR /home/archive

COPY environment.yaml .

RUN . /opt/conda/etc/profile.d/conda.sh && conda env create -p /home/archive/envs/banzai -f environment.yaml --solver=libmamba

COPY --chown=10087:10000 . /lco/banzai

ENV PATH /home/archive/envs/banzai/bin:$PATH

RUN /home/archive/envs/banzai/bin/pip install --no-cache-dir /lco/banzai/
2 changes: 1 addition & 1 deletion banzai/bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def calibration_type(self):
class SaturatedPixelFlagger(Stage):
def do_stage(self, image):
for image_extension in image.ccd_hdus:
image_extension.mask[image_extension.data > image_extension.saturate] |= 2
image_extension.mask[image_extension.data >= image_extension.saturate] |= 2

return image
Loading
Loading