Skip to content

Feature/ncextract enhancement #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lisfloodutilities/catchstats/catchstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def catchment_statistics(maps: Union[xr.DataArray, xr.Dataset],

if output is not None:
fileout = output / f'{ID:04}.nc'
if fileout.exists() and ~overwrite:
if fileout.exists() and not overwrite:
print(f'Output file {fileout} already exists. Moving forward to the next catchment')
continue

Expand Down Expand Up @@ -252,7 +252,7 @@ def main(argv=sys.argv):
parser.add_argument("-s", "--statistic", nargs='+', required=True, help='List of statistics to be computed. Possible values: mean, sum, std, var, min, max, median, count')
parser.add_argument("-o", "--output", required=True, help="Directory where the output NetCDF files will be saved")
parser.add_argument("-a", "--area", required=False, default=None, help="NetCDF file of pixel area used to weigh the statistics")
parser.add_argument("-W", "--overwrite", action="store_true", help="Overwrite existing output files")
parser.add_argument("-w", "--overwrite", action="store_true", default=False, help="Overwrite existing output files")

args = parser.parse_args()

Expand Down
Loading
Loading