Skip to content

Commit

Permalink
Update ncextract test
Browse files Browse the repository at this point in the history
  • Loading branch information
casadoj committed Feb 24, 2025
1 parent 329b953 commit 69bbcec
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
Binary file added tests/data/ncextract/datasets/dis24_2018.nc
Binary file not shown.
Binary file added tests/data/ncextract/datasets/dis24_2019.nc
Binary file not shown.
Binary file modified tests/data/ncextract/expected.nc
Binary file not shown.
16 changes: 8 additions & 8 deletions tests/data/ncextract/reservoirs.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ResID,lat,lon
14,44.475000000000001,-109.22499999999999
31,48.625,-109.97499999999999
48,44.825000000000003,-111.325
146,43.424999999999997,-108.175
169,48.325000000000003,-111.125
227,45.325000000000003,-107.97499999999999
ResID,latitude,longitude
14,44.475,-109.225
31,48.625,-109.975
48,44.825,-111.325
146,43.425,-108.175
169,48.325,-111.125
227,45.325,-107.975
364,46.625,-111.675
609,47.975000000000001,-106.375
609,47.975,-106.375
5 changes: 2 additions & 3 deletions tests/test_ncextract.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
# from lisfloodutilities.compare.nc import NetCDFComparator
from lisfloodutilities.ncextract import read_points, read_inputmaps, extract_timeseries
from lisfloodutilities.ncextract import read_points, read_inputmaps, read_ldd, extract_timeseries
import numpy as np
import xarray as xr
from datetime import datetime
Expand Down Expand Up @@ -38,7 +38,6 @@ def compare_datasets(
return True

def test_ncextract(self):


# config
inputcsv = './data/ncextract/reservoirs.csv'
Expand All @@ -58,7 +57,7 @@ def test_ncextract(self):
maps = read_inputmaps(data_dir, start=start, end=end)['dis24']

# read LDD
ldd = xr.open_dataset(ldd_file)['Band1']
ldd = read_ldd(ldd_file, maps)

# extract outflow timeseries
print('Extracting reservoir outflow...')
Expand Down

0 comments on commit 69bbcec

Please sign in to comment.