Skip to content

Commit

Permalink
use limited sample for f corona
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbhughes committed Nov 19, 2024
1 parent 83d1c60 commit 261cba2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions punchpipe/flows/fcorona.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import typing as t
import os
from datetime import datetime, timedelta
from random import random

from prefect import flow, get_run_logger, task
from punchbowl.level3.f_corona_model import construct_full_f_corona_model
Expand All @@ -15,7 +16,7 @@


@task
def f_corona_background_query_ready_files(session, pipeline_config: dict):
def f_corona_background_query_ready_files(session, pipeline_config: dict, use_n: int = 250):
logger = get_run_logger()
all_ready_files = (session.query(File)
.filter(File.state == "created")
Expand All @@ -24,7 +25,8 @@ def f_corona_background_query_ready_files(session, pipeline_config: dict):
.filter(File.observatory == "M").all())
logger.info(f"{len(all_ready_files)} Level 2 PTM files will be used for F corona background modeling.")
if len(all_ready_files) > 30: # need at least 30 images
return [[f.file_id for f in all_ready_files]]
random.shuffle(all_ready_files)
return [[f.file_id for f in all_ready_files[:250]]]
else:
return []

Expand Down

0 comments on commit 261cba2

Please sign in to comment.