diff --git a/deploy.py b/deploy.py index 2c08d06..7a743ea 100644 --- a/deploy.py +++ b/deploy.py @@ -1,13 +1,11 @@ from prefect import serve from punchpipe.controlsegment.launcher import launcher_flow -from punchpipe.deliver import create_noaa_delivery from punchpipe.flows.level1 import level1_process_flow, level1_scheduler_flow from punchpipe.flows.level2 import level2_process_flow, level2_scheduler_flow from punchpipe.flows.level3 import level3_PTM_process_flow, level3_PTM_scheduler_flow from punchpipe.flows.levelq import levelq_process_flow, levelq_scheduler_flow - if __name__ == "__main__": launcher_deployment = launcher_flow.to_deployment(name="launcher-deployment", description="Launch a pipeline segment.", @@ -49,4 +47,3 @@ level3_PTM_scheduler_deployment, level3_PTM_process_deployment, limit=1000 ) - diff --git a/punchpipe/cli.py b/punchpipe/cli.py index 0f70047..50dbbee 100644 --- a/punchpipe/cli.py +++ b/punchpipe/cli.py @@ -2,13 +2,7 @@ import multiprocessing as mp import click -from prefect import serve -from punchpipe.controlsegment.launcher import launcher_flow -from punchpipe.flows.level1 import level1_process_flow, level1_scheduler_flow -from punchpipe.flows.level2 import level2_process_flow, level2_scheduler_flow -from punchpipe.flows.level3 import level3_PTM_process_flow, level3_PTM_scheduler_flow -from punchpipe.flows.levelq import levelq_process_flow, levelq_scheduler_flow from .monitor.app import create_app diff --git a/punchpipe/controlsegment/db.py b/punchpipe/controlsegment/db.py index 5f175f2..c8d7d32 100644 --- a/punchpipe/controlsegment/db.py +++ b/punchpipe/controlsegment/db.py @@ -1,5 +1,4 @@ import os -import math from sqlalchemy import TEXT, Boolean, Column, DateTime, Float, Integer, String from sqlalchemy.orm import declarative_base diff --git a/punchpipe/level0/flow.py b/punchpipe/level0/flow.py index b46e458..2115a40 100644 --- a/punchpipe/level0/flow.py +++ b/punchpipe/level0/flow.py @@ -1,9 +1,10 @@ +import os import json import base64 -import os import warnings -from datetime import datetime, timedelta import importlib.metadata +from glob import glob +from datetime import datetime, timedelta import numpy as np import pylibjpeg @@ -12,21 +13,19 @@ from astropy.wcs import WCS from ndcube import NDCube from prefect import flow, task +from prefect.blocks.system import Secret from punchbowl.data import get_base_file_name +from punchbowl.data.io import write_ndcube_to_fits +from punchbowl.data.meta import NormalizedMetadata +from punchbowl.data.wcs import calculate_helio_wcs_from_celestial, calculate_pc_matrix from sqlalchemy import and_ -from glob import glob from sunpy.coordinates import sun -from prefect.blocks.system import Secret - -from punchbowl.data.meta import NormalizedMetadata -from punchbowl.data.io import write_ndcube_to_fits -from punchbowl.data.wcs import calculate_pc_matrix, calculate_helio_wcs_from_celestial -from punchpipe.controlsegment.db import EngXACTPacket, SciPacket, TLMFiles, File, get_closest_eng_packets, EngPWFPacket +from punchpipe.controlsegment.db import EngPWFPacket, EngXACTPacket, File, SciPacket, TLMFiles, get_closest_eng_packets from punchpipe.controlsegment.util import get_database_session, load_pipeline_configuration from punchpipe.error import CCSDSPacketConstructionWarning, CCSDSPacketDatabaseUpdateWarning from punchpipe.level0.ccsds import PACKET_APID2NAME, process_telemetry_file, unpack_compression_settings -from punchpipe.level0.meta import convert_pfw_position_to_polarizer, POSITIONS_TO_CODES, eci_quaternion_to_ra_dec +from punchpipe.level0.meta import POSITIONS_TO_CODES, convert_pfw_position_to_polarizer, eci_quaternion_to_ra_dec software_version = importlib.metadata.version("punchpipe") @@ -190,7 +189,7 @@ def form_packet_entry(apid, packet, packet_num, source_tlm_file_id): REDUNDANT_RESOLVER_POSITION_5=packet['REDUNDANT_RESOLVER_POSITION_5'], ) case _: - warnings.warn(f"Unable to add packet to database.", CCSDSPacketDatabaseUpdateWarning) + warnings.warn("Unable to add packet to database.", CCSDSPacketDatabaseUpdateWarning) @task def update_tlm_database(packets, telemetry_file_path: str, session=None): if session is None: