Skip to content

Commit

Permalink
Init default locations for daily output files
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Oct 18, 2023
1 parent 889f5f8 commit 645833d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions seaice_ecdr/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
# NSIDC infrastructure-specific paths:
NSIDC_NFS_SHARE_DIR = Path("/share/apps/amsr2-cdr")

# Outputs from the `seaice_ecdr` go to these locations.
BASE_OUTPUT_DIR = NSIDC_NFS_SHARE_DIR / "ecdr_outputs"
# Daily initial output from 'final' input data (e.g., AU_SI12)
INITIAL_DAILY_OUTPUT_DIR = BASE_OUTPUT_DIR / "final" / "initial_daily"
# Daily initial output from NRT LANCE AMSR2 data (AU_SI12_NRT_R04)
NRT_INITIAL_DAILY_OUTPUT_DIR = BASE_OUTPUT_DIR / "nrt" / "initial_daily"

# Location of LANCE AMSR2 NRT data files:
# TODO: nest the subdir under an `ecdr_inputs` or similar?
LANCE_NRT_DATA_DIR = NSIDC_NFS_SHARE_DIR / "lance_amsr2_nrt_data"

CDR_DATA_DIR = NSIDC_NFS_SHARE_DIR / "cdr_data"
4 changes: 3 additions & 1 deletion seaice_ecdr/initial_daily_ecdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from seaice_ecdr.land_spillover import load_or_create_land90_conc, read_adj123_file
from seaice_ecdr.masks import psn_125_near_pole_hole_mask
from seaice_ecdr.cli.util import datetime_to_date
from seaice_ecdr.constants import INITIAL_DAILY_OUTPUT_DIR


EXPECTED_TB_NAMES = ("h18", "v18", "v23", "h36", "v36")
Expand Down Expand Up @@ -957,7 +958,6 @@ def create_idecdr_for_date_range(
required=True,
type=click.Choice(get_args(Hemisphere)),
)
# TODO: default output-dir for initial daily files.
@click.option(
"-o",
"--output-dir",
Expand All @@ -970,6 +970,8 @@ def create_idecdr_for_date_range(
resolve_path=True,
path_type=Path,
),
default=INITIAL_DAILY_OUTPUT_DIR,
show_default=True,
)
@click.option(
"-r",
Expand Down
5 changes: 3 additions & 2 deletions seaice_ecdr/nrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pm_tb_data._types import Hemisphere
from pm_tb_data.fetch.au_si import AU_SI_RESOLUTIONS

from seaice_ecdr.constants import LANCE_NRT_DATA_DIR
from seaice_ecdr.constants import LANCE_NRT_DATA_DIR, NRT_INITIAL_DAILY_OUTPUT_DIR
from seaice_ecdr.initial_daily_ecdr import make_cdr_netcdf
from seaice_ecdr.cli.util import datetime_to_date

Expand Down Expand Up @@ -65,7 +65,6 @@ def download_latest_nrt_data(*, output_dir: Path, overwrite: bool) -> None:
required=True,
type=click.Choice(get_args(Hemisphere)),
)
# TODO: default output-dir for initial daily nrt files.
@click.option(
"-o",
"--output-dir",
Expand All @@ -78,6 +77,8 @@ def download_latest_nrt_data(*, output_dir: Path, overwrite: bool) -> None:
resolve_path=True,
path_type=Path,
),
show_default=True,
default=NRT_INITIAL_DAILY_OUTPUT_DIR,
)
@click.option(
"-r",
Expand Down

0 comments on commit 645833d

Please sign in to comment.