|
4 | 4 | p = argparse.ArgumentParser(description="Basic gm testing code for vcs") |
5 | 5 | p.add_argument("--source", dest="src", help="source image file") |
6 | 6 | p.add_argument("--gm_type", dest="gm", help="gm to test") |
7 | | -p.add_argument("--mask", dest="mask", action="store_true",help="mask out part of data") |
8 | 7 | p.add_argument("--show", dest="show", action="store_true",help="show plots on screen (no bg)") |
9 | 8 | p.add_argument("--projection-type", dest="projtype", default="default", help="use a specific projection type") |
10 | 9 | p.add_argument("--lat1", dest="lat1", default=0, type=float, help="First latitude") |
|
16 | 15 | p.add_argument("--zero", dest="zero", action="store_true", help="Set the data to zero everywhere") |
17 | 16 | p.add_argument("--keep", dest="keep", action="store_true",help="Save image, even if baseline matches.") |
18 | 17 |
|
| 18 | +dataMods = p.add_mutually_exclusive_group() |
| 19 | +dataMods.add_argument("--mask", dest="mask", action="store_true",help="mask out part of data") |
| 20 | +dataMods.add_argument("--bigvalues", dest="bigvalues", action="store_true",help="replace some of the data with 1e40") |
| 21 | + |
19 | 22 | args = p.parse_args(sys.argv[1:]) |
20 | 23 |
|
21 | 24 | gm_type= args.gm |
|
87 | 90 | gm.mesh=True |
88 | 91 | if args.mask: |
89 | 92 | s=MV2.masked_less(s,1150.) |
| 93 | + elif args.bigvalues: |
| 94 | + s[s < 1150] = 1e40 |
90 | 95 | if args.zero: |
91 | 96 | s-=s |
92 | 97 | else: |
93 | 98 | s=f("clt",**xtra) |
94 | 99 | if args.mask: |
95 | 100 | s=MV2.masked_greater(s,78.) |
| 101 | + elif args.bigvalues: |
| 102 | + s[s > 78] = 1e40 |
96 | 103 | if gm_type in ["1d","yxvsx","xyvsy","xvsy","scatter"]: |
97 | 104 | s = s(latitude=(20,20,"cob"),longitude=(112,112,"cob"),squeeze=1) |
98 | 105 | s2=MV2.sin(s) |
99 | 106 | if args.zero: |
100 | 107 | s2-=s2 |
101 | 108 | if args.zero: |
102 | 109 | s-=s |
| 110 | + |
| 111 | +if args.bigvalues: |
| 112 | + gm.levels = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 1.e36] |
| 113 | + |
103 | 114 | if gm_type=="vector": |
104 | 115 | x.plot(u,v,gm,bg=bg) |
105 | 116 | elif gm_type in ["scatter","xvsy"]: |
|
109 | 120 | fnm = "test_vcs_basic_%s" % gm_type.lower() |
110 | 121 | if args.mask: |
111 | 122 | fnm+="_masked" |
| 123 | +elif args.bigvalues: |
| 124 | + fnm+="_bigvalues" |
112 | 125 | if args.projtype!="default": |
113 | 126 | fnm+="_%s_proj" % args.projtype |
114 | 127 | if args.zero: |
|
0 commit comments