Commit 52034e1b authored by Eva Börgens's avatar Eva Börgens
Browse files

Add functionality of time series only output

parent 2269a284
......@@ -26,7 +26,7 @@ arguments:
-t, --timeseries Return mean TWS time series. For this option the region grid points have to be on the TWS
grid given in filename
NOTE: Either -m or -u flag has to be set!
NOTE: Either -m or -u or -t flag has to be set!
Please see requirements file for the required Python packaged. This package has been tested with the version numbers
listed in the requirement file.
......
......@@ -14,13 +14,17 @@ region_coords = read_ascii(region_filename)
grid, grid_std, lon, lat, time = read_netcdf(filename)
results = compute_covariance(region_coords,grid_std, flag_uncertainty, flag_matrix )
timeseries = None
if flag_timeseries:
timeseries, flag_timeseries = get_timeseries(grid, lon, lat, region_coords)
results = None
if flag_uncertainty or flag_matrix:
results = compute_covariance(region_coords, grid_std, flag_uncertainty, flag_matrix)
save_results(out_filename, filename, results,region_coords, timeseries, flag_uncertainty, flag_matrix, flag_timeseries )
save_results(out_filename, filename, results, region_coords, timeseries, flag_uncertainty, flag_matrix, flag_timeseries )
......
......@@ -51,8 +51,8 @@ def arg_parser():
)
args = parser.parse_args()
if not args.matrix and not args.uncertainty:
raise RuntimeError("Either covariance matrix (-m) or uncertainties (-u) have to be set for the output")
if not args.matrix and not args.uncertainty and not args.timeseries:
raise RuntimeError("Either covariance matrix (-m) or uncertainties (-u) or timeseries (-t) have to be set for the output!")
test_coordiantes(args.region.name)
return args
\ No newline at end of file
#!/bin/bash
python3 -m tws_covariances "$@"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment