-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tcolligan4/tommy
Tommy
- Loading branch information
Showing
34 changed files
with
3,868 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
from argparse import ArgumentParser | ||
from data_utils import clip_raster | ||
from glob import glob | ||
|
||
def _parse_path_row(f): | ||
bs = os.path.basename(f).split("_") | ||
return bs[0], bs[1] | ||
|
||
if __name__ == '__main__': | ||
|
||
ap = ArgumentParser() | ||
ap.add_argument('--raster', type=str, required=True) | ||
ap.add_argument('--out-dir', type=str, required=True) | ||
ap.add_argument('--outfile', type=str) | ||
args = ap.parse_args() | ||
if args.outfile is None: | ||
outfile = args.raster | ||
path, row = _parse_path_row(args.raster) | ||
clip_raster(args.raster, int(path), int(row), outfile=outfile) |
Oops, something went wrong.