diff --git a/README.md b/README.md index 8e3d786e..c7212f27 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,6 @@ The available inputs, test cases, and versioned FIM outputs can be found by runn aws s3 ls s3://noaa-nws-owp-fim/hand_fim/ --profile esip ``` -Download a directory of sample outputs for a single HUC8: -``` -aws s3 sync s3://noaa-nws-owp-fim/hand_fim/outputs/hand_4_5_2_11/12090301 \ - /your_local_folder_name/12090301 --profile esip -``` By adjusting pathing, you can also download entire directories such as the `hand_4_5_2_11` folder. An entire output HAND set is approximately 1.7 TB. **Note**: There may be newer editions than `hand_4_5_11_1`, and it is recommended to adjust the command above for the latest version. @@ -138,6 +133,25 @@ docker run --rm -it --name Robs_container \ fim_4:dev_20230620 ``` +### Subsetting input data +A subset of the data required to run and evaluate FIM can be obtained with the use of ESIP AWS keys. In order to generate these data: +1. Start a Docker container as in the previous step +2. Run `/foss_fim/data/get_sample_data.py` replacing `` and `` with your AWS access keys. To generate data for HUC 03100204, for example: +``` +python /foss_fim/data/get_sample_data.py -u 03100204 -i s3://noaa-nws-owp-fim/hand_fim/ -o /outputs/sample-data -r hand_fim -s3 -ak -sk +``` +3. Exit the Docker container by typing `exit`. Alternatively, you can leave this container running and run the next command in a new terminal tab or window. +4. Start a new Docker container with the `/data` volume mount pointing at the local output location (`-o`) used in `get_sample_data.py` (step 2). For example: +```bash +docker run --rm -it --name Robs_data_container \ + -v /home/projects/fim/code/inundation-mapping/:/foss_fim \ + -v /home/projects/fim/data/outputs/:/outputs \ + -v /home/projects/fim/data/outputs_temp/:/fim_temp \ + -v /home/projects/fim/data/outputs/sample-data:/data \ + fim_4:dev_20230620 +``` +5. Now you can run the following commands with the sample data. + ### Produce HAND Hydrofabric ``` fim_pipeline.sh -u -n -o @@ -161,15 +175,6 @@ The three sections are: Running the `fim_pipeline.sh` is a quicker process than running all three steps independently, but you can run some sections more than once if you like. -### Testing in Other HUCs -To test in HUCs other than the provided HUCs, the following processes can be followed to acquire and preprocess additional NHDPlus rasters and vectors. After these steps are run, the "Produce HAND Hydrofabric" step can be run for the new HUCs. - -``` -/foss_fim/src/acquire_and_preprocess_inputs.py -u -``` - Sorry, this tool is deprecated, replacement scripts are coming soon. - - ### Evaluating Inundation Map Performance After `fim_pipeline.sh` completes, or combinations of the three major steps described above, you can evaluate the model's skill. The evaluation benchmark datasets are available through ESIP in the `test_cases` directory. diff --git a/data/get_sample_data.py b/data/get_sample_data.py new file mode 100644 index 00000000..92713734 --- /dev/null +++ b/data/get_sample_data.py @@ -0,0 +1,349 @@ +#!/usr/bin/env python3 + +import argparse +import os +import re +import shutil +import subprocess + +import boto3 +from dotenv import load_dotenv + + +def get_sample_data( + hucs, + data_path: str, + output_root_folder: str, + input_root: str = '/data', + use_s3: bool = False, + aws_access_key_id: str = None, + aws_secret_access_key: str = None, +): + """ + Create input data for the flood inundation model + + Parameters + ---------- + hucs : str + HUC(s) to process + data_path : str + Path to the input data + output_root_folder : str + Path to save the output data + use_s3 : bool + Download data from S3 (default is False) + """ + + def __get_validation_hucs(root_dir: str, org: str): + """ + Get the list of HUCs for validation + + Parameters + ---------- + root_dir : str + Root directory + org : str + Organization name + """ + + if use_s3: + return list( + set( + [ + d.key.split('/')[4] + for d in s3_resource.Bucket(bucket).objects.filter( + Prefix=f'{root_dir}/test_cases/{org}_test_cases/validation_data_{org}' + ) + if re.match(r'^\d{8}$', d.key.split('/')[4]) + ] + ) + ) + else: + return [ + d + for d in os.listdir(f'/data/test_cases/{org}_test_cases/validation_data_{org}') + if re.match(r'^\d{8}$', d) + ] + + def __copy_validation_data(org: str, huc: str, data_path: str, output_data_path: str): + """ + Make the path to the validation data + + Parameters + ---------- + org : str + Organization name + huc : str + HUC + input_path : str + Path to the input data + output_data_path : str + Path to save the output data + """ + + validation_path = f'test_cases/{org}_test_cases/validation_data_{org}/{huc}' + + output_validation_path = os.path.join(output_data_path, validation_path) + os.makedirs(output_validation_path, exist_ok=True) + + __copy_folder(os.path.join(data_path, validation_path), output_data_path, data_path) + + def __copy_file(input_file: str, output_path: str, input_root: str): + """ + Copies a file if it doesn't already exist + + Parameters + ---------- + input_file : str + Path to the input data + output_path : str + Path to save the output data + input_root : str + input_file root directory (default is '/data') + """ + + input_path, basename = os.path.split(input_file) + + output_file = input_file.replace(input_root, output_path) + output_path = os.path.split(output_file)[0] + + if not os.path.exists(os.path.join(output_path, basename)): + print(f"Copying {os.path.join(input_path, basename)} to {output_path}") + os.makedirs(output_path, exist_ok=True) + if use_s3: + s3.download_file( + bucket, os.path.join(input_path, basename), os.path.join(output_path, basename) + ) + else: + shutil.copy2(os.path.join(input_path, basename), output_path) + + return os.path.join(output_path, basename) + + else: + print(f"{os.path.join(output_path, basename)} already exists.") + + def __copy_folder(input_path: str, output_path: str, input_root: str = None): + """ + Copies a folder if it doesn't already exist + + Parameters + ---------- + input_path : str + Path to the input data + output_path : str + Path to save the output data + input_root : str + input_file root directory (default is '/data') + """ + + if input_root: + output_path = input_path.replace(input_root, output_path) + + if use_s3: + print(f"Downloading {input_path} to {output_path}") + download_s3_folder(bucket, input_path, output_path) + else: + print(f"Copying {input_path} to {output_path}") + shutil.copytree(input_path, output_path, dirs_exist_ok=True) + + def download_s3_folder(bucket_name: str, s3_folder: str, local_dir: str = None): + """ + Download the contents of a folder directory + + Parameters + ---------- + bucket_name: + the name of the s3 bucket + s3_folder: + the folder path in the s3 bucket + local_dir: + a relative or absolute directory path in the local file system + """ + + Bucket = s3_resource.Bucket(bucket_name) + for obj in Bucket.objects.filter(Prefix=s3_folder): + target = ( + obj.key if local_dir is None else os.path.join(local_dir, os.path.relpath(obj.key, s3_folder)) + ) + if not os.path.exists(os.path.dirname(target)): + os.makedirs(os.path.dirname(target)) + if obj.key[-1] == '/': + continue + Bucket.download_file(obj.key, target) + + if use_s3: + if not aws_access_key_id or not aws_secret_access_key: + raise ValueError('AWS access key ID and secret access key are required when using S3') + + s3 = boto3.client( + 's3', aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key + ) + s3_resource = boto3.resource( + 's3', aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key + ) + + if data_path.startswith('s3://'): + data_path = data_path[5:] + + bucket, bucket_path = data_path.split('/', 1) + input_path = os.path.join(bucket_path, 'inputs') + + else: + input_path = os.path.join(data_path, 'inputs') + + if not os.path.exists(input_path): + raise FileNotFoundError(f'{input_path} does not exist') + + # Set inputsDir for the bash scripts + os.environ['inputsDir'] = input_path + + load_dotenv('/foss_fim/src/bash_variables.env') + + PRE_CLIP_HUC_DIR = os.environ["pre_clip_huc_dir"] + INPUT_DEM_DOMAIN = os.environ["input_DEM_domain"] + INPUT_DEM_DOMAIN_ALASKA = os.environ["input_DEM_domain_Alaska"] + INPUT_DEM = os.environ['input_DEM'] + INPUT_DEM_ALASKA = os.environ['input_DEM_Alaska'] + INPUT_LANDSEA = os.environ['input_landsea'] + INPUT_LANDSEA_ALASKA = os.environ['input_landsea_Alaska'] + INPUT_NLD_LEVEE_PROTECTED_AREAS = os.environ["input_nld_levee_protected_areas"] + INPUT_NLD_LEVEE_PROTECTED_AREAS_ALASKA = os.environ["input_nld_levee_protected_areas_Alaska"] + INPUT_NWM_LAKES = os.environ['input_nwm_lakes'] + INPUT_NWM_LAKES_ALASKA = os.environ['input_nwm_lakes_Alaska'] + INPUT_GL_BOUNDARIES = os.environ["input_GL_boundaries"] + INPUT_WBD_GDB_ALASKA = os.environ["input_WBD_gdb_Alaska"] + NWM_RECUR_FILE = os.environ["nwm_recur_file"] + + root_dir = os.path.split(input_path)[0] + + ## test_cases + validation_hucs = {} + orgs = ['ble', 'nws', 'usgs', 'ras2fim'] + for org in orgs: + validation_hucs[org] = __get_validation_hucs(root_dir, org) + + os.makedirs(os.path.join(output_root_folder, 'test_cases', f'{org}_test_cases'), exist_ok=True) + + # Copy WBD (needed for post-processing) + __copy_file(os.environ["input_WBD_gdb"], output_root_folder, input_root) + ## ahps_sites + __copy_file(os.environ["nws_lid"], output_root_folder, input_root) + + ## bathymetry_adjustment + __copy_file(os.environ["bathymetry_file"], output_root_folder, input_root) + ## huc_lists + __copy_folder(os.path.join(input_path, 'huc_lists'), output_root_folder, input_root) + + ## nld + __copy_file(os.environ["input_NLD"], output_root_folder, input_root) + + ## levees_preprocessed + __copy_file(os.environ["input_levees_preprocessed"], output_root_folder, input_root) + + ## rating_curve + __copy_file(os.environ["bankfull_flows_file"], output_root_folder, input_root) + + ## recurr_flows + __copy_file(NWM_RECUR_FILE, output_root_folder, input_root) + + recurr_intervals = ['2', '5', '10', '25', '50'] + for recurr_interval in recurr_intervals: + __copy_file( + os.path.join(os.path.split(NWM_RECUR_FILE)[0], f'nwm3_17C_recurr_{recurr_interval}_0_cms.csv'), + output_root_folder, + input_root, + ) + + __copy_file(os.environ["vmann_input_file"], output_root_folder, input_root) + + __copy_folder(os.environ["input_calib_points_dir"], output_root_folder, input_root) + + ## usgs_gages + __copy_file(os.path.join(input_path, 'usgs_gages', 'usgs_gages.gpkg'), output_root_folder, input_root) + + __copy_file(os.environ["usgs_rating_curve_csv"], output_root_folder, input_root) + + ## osm bridges + __copy_file(os.environ["osm_bridges"], output_root_folder, input_root) + + ## ras2fim + __copy_folder(os.environ["ras2fim_input_dir"], output_root_folder, input_root) + + for huc in hucs: + huc2Identifier = huc[:2] + + # Check whether the HUC is in Alaska or not and assign the CRS and filenames accordingly + if huc2Identifier == '19': + input_LANDSEA = INPUT_LANDSEA_ALASKA + input_DEM = INPUT_DEM_ALASKA + input_DEM_domain = INPUT_DEM_DOMAIN_ALASKA + input_DEM_file = os.path.join(os.path.split(input_DEM_domain)[0], f'HUC8_{huc}_dem.tif') + input_NWM_lakes = INPUT_NWM_LAKES_ALASKA + input_NLD_levee_protected_areas = INPUT_NLD_LEVEE_PROTECTED_AREAS_ALASKA + + __copy_file(INPUT_WBD_GDB_ALASKA, output_root_folder, input_root) + + else: + input_DEM = INPUT_DEM + input_DEM_domain = INPUT_DEM_DOMAIN + input_DEM_file = os.path.join(os.path.split(input_DEM_domain)[0], f'HUC6_{huc[:6]}_dem.tif') + input_NWM_lakes = INPUT_NWM_LAKES + input_NLD_levee_protected_areas = INPUT_NLD_LEVEE_PROTECTED_AREAS + + # Define the landsea water body mask using either Great Lakes or Ocean polygon input # + if huc2Identifier == "04": + input_LANDSEA = INPUT_GL_BOUNDARIES + else: + input_LANDSEA = INPUT_LANDSEA + + ## landsea mask + __copy_file(input_LANDSEA, output_root_folder, input_root) + + # dem + __copy_file(input_DEM_domain, output_root_folder, input_root) + __copy_file(input_DEM_file, output_root_folder, input_root) + + # lakes + ## nwm_hydrofabric + __copy_file(input_NWM_lakes, output_root_folder, input_root) + + ## nld_vectors + __copy_file(input_NLD_levee_protected_areas, output_root_folder, input_root) + + # create VRT + print('Creating VRT') + if use_s3: + output_VRT_file = input_DEM.replace(input_root, output_root_folder) + else: + output_VRT_file = input_DEM.replace(data_path, output_root_folder) + + command = ['gdalbuildvrt', output_VRT_file] + dem_dirname = os.path.dirname(output_VRT_file) + dem_list = [os.path.join(dem_dirname, x) for x in os.listdir(dem_dirname) if x.endswith(".tif")] + command.extend(dem_list) + subprocess.call(command) + + ## pre_clip_huc8 + __copy_folder(os.path.join(PRE_CLIP_HUC_DIR, huc), output_root_folder, input_root) + + ## validation data + for org in orgs: + if huc in validation_hucs[org]: + __copy_validation_data(org, huc, bucket_path, output_root_folder) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Create input data for the flood inundation model') + parser.add_argument('-u', '--hucs', nargs='+', help='HUC to process') + parser.add_argument('-i', '--data-path', help='Path to the input data') + parser.add_argument('-o', '--output-root-folder', help='Path to save the output data') + parser.add_argument('-r', '--input-root', help='Root directory of the input data', default='/data') + parser.add_argument('-s3', '--use-s3', action='store_true', help='Download data from S3') + parser.add_argument('-ak', '--aws-access-key-id', help='AWS access key ID', required=False) + parser.add_argument('-sk', '--aws-secret-access-key', help='AWS secret access key', required=False) + + args = parser.parse_args() + + get_sample_data(**vars(args)) + + # python /foss_fim/data/get_sample_data.py -u 03100204 -i /data -o /outputs/sample-data diff --git a/data/wbd/generate_pre_clip_fim_huc8.py b/data/wbd/generate_pre_clip_fim_huc8.py index 564addfb..769cb0f1 100755 --- a/data/wbd/generate_pre_clip_fim_huc8.py +++ b/data/wbd/generate_pre_clip_fim_huc8.py @@ -66,6 +66,9 @@ input_DEM_domain = os.getenv('input_DEM_domain') input_DEM_domain_Alaska = os.getenv('input_DEM_domain_Alaska') # alaska +input_landsea = os.getenv('input_landsea') +input_landsea_Alaska = os.getenv('input_landsea_Alaska') # alaska + input_nwm_lakes = os.getenv('input_nwm_lakes') input_nwm_catchments = os.getenv('input_nwm_catchments') input_nwm_catchments_Alaska = os.getenv('input_nwm_catchments_Alaska') @@ -325,28 +328,25 @@ def huc_level_clip_vectors_to_wbd(huc, outputs_dir): # SET VARIABLES AND FILE INPUTS # hucUnitLength = len(huc) huc2Identifier = huc[:2] + input_NHD_WBHD_layer = f"WBDHU{hucUnitLength}" # Check whether the HUC is in Alaska or not and assign the CRS and filenames accordingly if huc2Identifier == '19': huc_CRS = ALASKA_CRS - input_NHD_WBHD_layer = 'WBD_National_South_Alaska' input_WBD_filename = input_WBD_gdb_Alaska - wbd_gpkg_path = f'{inputsDir}/wbd/WBD_National_South_Alaska.gpkg' else: huc_CRS = DEFAULT_FIM_PROJECTION_CRS - input_NHD_WBHD_layer = f"WBDHU{hucUnitLength}" input_WBD_filename = input_WBD_gdb - wbd_gpkg_path = f'{inputsDir}/wbd/WBD_National.gpkg' # Define the landsea water body mask using either Great Lakes or Ocean polygon input # if huc2Identifier == "04": input_LANDSEA = f"{input_GL_boundaries}" # print(f'Using {input_LANDSEA} for water body mask (Great Lakes)') elif huc2Identifier == "19": - input_LANDSEA = f"{inputsDir}/landsea/water_polygons_alaska.gpkg" + input_LANDSEA = input_landsea_Alaska # print(f'Using {input_LANDSEA} for water body mask (Alaska)') else: - input_LANDSEA = f"{inputsDir}/landsea/water_polygons_us.gpkg" + input_LANDSEA = input_landsea logging.info(f"-- {huc} : Get WBD") @@ -467,7 +467,7 @@ def huc_level_clip_vectors_to_wbd(huc, outputs_dir): '-clipsrc', f'{huc_directory}/wbd_buffered.gpkg', f'{huc_directory}/wbd8_clp.gpkg', - wbd_gpkg_path, + input_WBD_filename, input_NHD_WBHD_layer, ], stdout=subprocess.PIPE, diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a07eac6a..aced0ef4 100755 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,29 @@ All notable changes to this project will be documented in this file. We follow the [Semantic Versioning 2.0.0](http://semver.org/) format. +## v4.5.x.x - 2024-05-22 - [PR#1178](https://github.com/NOAA-OWP/inundation-mapping/pull/1178) + +### Summary +Contains files to generate data to run and evaluate FIM (`fim_pipeline.sh` and `synthesize_test_cases.py`) for specified HUC(s) as well as related patches to replace absolute file paths with relative file paths, a fix for evaluating when IFC data are not available, and update code to generate pre-clip data so that WBD for Alaska contains only one layer. NOTE: this PR requires `wbd.gpkg` to be created by the updated `generate_pre_clip_fim_huc8.py` to be copied to the pre-clip HUC folders to remove a warning in `synthesize_test_case.py`. + +### Usage +``` +python /foss_fim/data/sandbox/get_sample_data.py -u 03100204 -i /data -o /foss_fim/data/sample-data + +### Additions + +- `data/` + - `sandbox/` [archived] + - `Dockerfile`: A copy of the root Dockerfile that also pulls code and data into the build image [archived] + - `fim-in-a-box.ipynb`: Jupyter notebook to run and evaluate an example HUC [archived] + - 'README.md' [archived] + - `get_sample_data.py`: Copies relevant data for `inputs` and `test_cases` from the FIM data folder for specified HUC(s) and saves it to a separate location + - `wbd/generate_pre_clip_fim_huc8.py`: Fix file paths and layers +- `src/bash_variables.env`: Add paths for landsea and nws_lid +- `tools/run_test_case.py`: Skip evaluation for missing validation data and fix hardcoded paths for masks + +

+ ## v4.5.12.0 - 2024-11-01 - [PR#1327](https://github.com/NOAA-OWP/inundation-mapping/pull/1327) The purpose of this PR is to cut down the runtime for four Alaska HUCs (19020104, 19020503, 19020402 , and 19020602). It significantly optimizes runtime by replacing a nested for loop, used for updating rating curve for small segments, with a vectorized process. This changes were applied only to the Alaska HUCs. @@ -560,7 +583,6 @@ A number of python packages were updated in this PR. You will need to build a ne

- ## v4.5.2.0 - 2024-05-20 - [PR#1166](https://github.com/NOAA-OWP/inundation-mapping/pull/1166) The main goal of this PR is to create bridge point data that be used as a service in HydroVIS. Since every branch processes bridges separately, it's possible to inundate a bridge from more than just the feature_id it crosses. To reflect this, the `osm_bridge_centroids.gpkg` now found in HUC directories will have coincident points - one that is inundated from the reach it crosses and the other a backwater-influenced point indicated by the `is_backwater` field. @@ -577,7 +599,6 @@ The main goal of this PR is to create bridge point data that be used as a servic

- ## v4.5.1.3 - 2024-05-17 - [PR#1170](https://github.com/NOAA-OWP/inundation-mapping/pull/1170) This hotfix addresses the issue #1162 by explicitly using 'fiona' engine for reading gpkg files with Boolean dtype. This is applicable only for `usgs_gages.gpkg` and `usgs_subset_gages.gpkg` files. diff --git a/src/bash_variables.env b/src/bash_variables.env index fff5d785..26bbec7c 100644 --- a/src/bash_variables.env +++ b/src/bash_variables.env @@ -13,6 +13,8 @@ export input_DEM=${inputsDir}/dems/3dep_dems/10m_50 export input_DEM_Alaska=${inputsDir}/dems/3dep_dems/10m_South_Alaska/20240912/FIM_3dep_dem_South_Alaska_10m.vrt export input_DEM_domain=${inputsDir}/dems/3dep_dems/10m_5070/20240916/DEM_Domain.gpkg export input_DEM_domain_Alaska=${inputsDir}/dems/3dep_dems/10m_South_Alaska/20240912/DEM_Domain.gpkg +export input_landsea=${inputsDir}/landsea/water_polygons_us.gpkg +export input_landsea_Alaska=${inputsDir}/landsea/water_polygons_alaska.gpkg export input_GL_boundaries=${inputsDir}/landsea/gl_water_polygons.gpkg export input_NLD=${inputsDir}/nld_vectors/System_Routes_NLDFS_5070_230314.gpkg export input_NLD_Alaska=${inputsDir}/nld_vectors/System_Routes_NLDFS_3338_230314.gpkg @@ -27,13 +29,15 @@ export input_nwm_flows_Alaska=${inputsDir}/nwm_hydrofabric/nwm_f export input_nwm_headwaters=${inputsDir}/nwm_hydrofabric/nwm_headwaters.gpkg export input_nwm_headwaters_Alaska=${inputsDir}/nwm_hydrofabric/nwm_headwaters_alaska.gpkg export input_nwm_lakes=${inputsDir}/nwm_hydrofabric/nwm_lakes.gpkg -export input_nwm_lakes_Alaska=${inputsDir}/nwm_hydrofabric/nwm_waterbodies_alaska.gpkg +export input_nwm_lakes_Alaska=${inputsDir}/nwm_hydrofabric/nwm_waterbodies_alaska.gpkg export input_WBD_gdb=${inputsDir}/wbd/WBD_National_EPSG_5070_WBDHU8_clip_dem_domain.gpkg export input_WBD_gdb_Alaska=${inputsDir}/wbd/WBD_National_South_Alaska.gpkg export input_calib_points_dir=${inputsDir}/rating_curve/water_edge_database/calibration_points/ export bathymetry_file=${inputsDir}/bathymetry/bathymetric_adjustment_data.gpkg export osm_bridges=${inputsDir}/osm/bridges/241002/osm_all_bridges.gpkg +export nws_lid=${inputsDir}/ahps_sites/nws_lid.gpkg + # input file location with nwm feature_id and recurrence flow values export bankfull_flows_file=${inputsDir}/rating_curve/bankfull_flows/nwm3_high_water_threshold_cms.csv diff --git a/tools/run_test_case.py b/tools/run_test_case.py index a7cb7701..2529ae5f 100755 --- a/tools/run_test_case.py +++ b/tools/run_test_case.py @@ -54,10 +54,11 @@ def magnitudes(self): def huc_data(self): '''Returns a dict of HUC8, magnitudes, and sites.''' huc_mags = {} - for huc in os.listdir(self.validation_data): - if not re.match(r'\d{8}', huc): - continue - huc_mags[huc] = self.data(huc) + if os.path.exists(self.validation_data): + for huc in os.listdir(self.validation_data): + if not re.match(r'\d{8}', huc): + continue + huc_mags[huc] = self.data(huc) return huc_mags def data(self, huc): @@ -127,18 +128,30 @@ def __init__(self, test_id, version, archive=True): self.benchmark_dir = os.path.join(self.validation_data, self.huc) # Create list of shapefile paths to use as exclusion areas. - self.mask_dict = { - 'levees': { - 'path': '/data/inputs/nld_vectors/Levee_protected_areas.gpkg', - 'buffer': None, - 'operation': 'exclude', - }, - 'waterbodies': { - 'path': '/data/inputs/nwm_hydrofabric/nwm_lakes.gpkg', - 'buffer': None, - 'operation': 'exclude', - }, - } + if self.huc[:2] == '19': + self.mask_dict = { + 'levees': { + 'path': os.getenv('input_nld_levee_protected_areas_Alaska'), + 'buffer': None, + 'operation': 'exclude', + }, + 'waterbodies': { + # 'path': '/data/inputs/nwm_hydrofabric/nwm_lakes.gpkg', + 'path': os.getenv('input_nwm_lakes_Alaska'), + 'buffer': None, + 'operation': 'exclude', + }, + } + + else: + self.mask_dict = { + 'levees': { + 'path': os.getenv('input_nld_levee_protected_areas'), + 'buffer': None, + 'operation': 'exclude', + }, + 'waterbodies': {'path': os.getenv('input_nwm_lakes'), 'buffer': None, 'operation': 'exclude'}, + } @classmethod def list_all_test_cases(cls, version, archive, benchmark_categories=[]):