| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
import argparse |
| 15 |
import jiplib as jl |
| 16 |
|
| 17 |
parser=argparse.ArgumentParser() |
| 18 |
parser.add_argument("-nrow","--nrow",help="Number of rows",dest="nrow",required=False,type=int,default=1024) |
| 19 |
parser.add_argument("-ncol","--ncol",help="Number of cols",dest="ncol",required=False,type=int,default=1024) |
| 20 |
parser.add_argument("-min","--min",help="min value for pixel values",dest="min",required=False,type=float,default=1000) |
| 21 |
parser.add_argument("-max","--max",help="max value for pixel values",dest="max",required=False,type=float,default=2000) |
| 22 |
args = parser.parse_args() |
| 23 |
|
| 24 |
ULX=600000.0 |
| 25 |
ULY=4000020.0 |
| 26 |
LRX=709800.0 |
| 27 |
LRY=3890220.0 |
| 28 |
projection='epsg:32612' |
| 29 |
dict={'ulx':ULX,'uly':ULY,'lrx':LRX,'lry':LRY,'a_srs':projection} |
| 30 |
dict.update({'nrow':args.nrow,'ncol':args.ncol}) |
| 31 |
dict.update({'uniform':[args.min,args.max+1]}) |
| 32 |
dict.update({'otype':'GDT_UInt16'}) |
| 33 |
dict.update({'seed':10915}) |
| 34 |
jim0=jl.createJim(**dict) |
| 35 |
theStats=jim0.getStats({'function':['min','max']}) |
| 36 |
if theStats['min']!=args.min: |
| 37 |
print("Failed: min") |
| 38 |
if theStats['max']!=args.max: |
| 39 |
print("Failed: max") |
| 40 |
else: |
| 41 |
print("Success: create georeferenced image with random pixel values using uniform distribution") |
| 42 |
jim0.close() |