| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
import argparse |
| 16 |
import os |
| 17 |
import jiplib as jl |
| 18 |
|
| 19 |
parser=argparse.ArgumentParser() |
| 20 |
parser.add_argument("-input","--input",help="Path of the input file",dest="input",required=True,type=str) |
| 21 |
parser.add_argument("-output","--output",help="Path of the output file",dest="output",required=True,type=str) |
| 22 |
args = parser.parse_args() |
| 23 |
|
| 24 |
try: |
| 25 |
jim0=jl.createJim(args.input) |
| 26 |
jim0.write({'filename':args.output, 'oformat': 'GTiff', 'co':['COMPRESS=LZW','TILED=YES']}).close() |
| 27 |
if os.path.isfile(args.output): |
| 28 |
print("Success: write to file") |
| 29 |
else: |
| 30 |
throw() |
| 31 |
except: |
| 32 |
print("Failed: write()") |
| 33 |
|