@@ -148,8 +148,8 @@ def plotresults(act, exp, ph, region):
148
148
ax3 = plt .subplot (133 )
149
149
ax3 .set_title ("Photon Cloud" )
150
150
ph_gt1r = ph [ph ["pair" ] == icesat2 .RIGHT_PAIR ]
151
- colormap = np .array (['c' ,'b' ,'g' ,'g' ,'y' ])
152
- ax3 .scatter (ph_gt1r ["time" ], ph_gt1r ["height" ].values , c = colormap [ph_gt1r ["info" ]], s = 0.2 )
151
+ colormap = np .array (['c' ,'b' ,'g' ,'g' ,'y' ]) # noise, ground, canopy, top of canopy, unclassified
152
+ ax3 .scatter (ph_gt1r ["time" ], ph_gt1r ["height" ].values , c = colormap [ph_gt1r ["info" ]], s = 1.5 )
153
153
act_gt1r = act_gt1r [(act_gt1r .geometry .y > min (box_lat )) & (act_gt1r .geometry .y < max (box_lat ))]
154
154
act_gt1r = act_gt1r [(act_gt1r .geometry .x > min (box_lon )) & (act_gt1r .geometry .x < max (box_lon ))]
155
155
ax3 .scatter (act_gt1r ["time" ], act_gt1r ["h_mean" ].values , color = 'r' , s = 0.5 )
@@ -165,8 +165,7 @@ def plotresults(act, exp, ph, region):
165
165
if __name__ == '__main__' :
166
166
167
167
url = ["127.0.0.1" ]
168
- atl03_asset = "atlas-local"
169
- atl06_asset = "atlas-local"
168
+ asset = "atlas-local"
170
169
resource = "20181019065445_03150111_004_01"
171
170
photon_cloud_region = [
172
171
{ "lat" : - 80.75 , "lon" : - 70.00 },
@@ -176,44 +175,38 @@ def plotresults(act, exp, ph, region):
176
175
{ "lat" : - 80.75 , "lon" : - 70.00 }
177
176
]
178
177
179
-
180
178
# configure logging
181
179
logging .basicConfig (level = logging .INFO )
182
180
183
181
# Set URL #
184
182
if len (sys .argv ) > 1 :
185
183
url = sys .argv [1 ]
186
- atl03_asset = "atlas-s3"
187
- atl06_asset = "atlas-s3"
184
+ asset = "atlas-s3"
188
185
189
- # Set ATL03 Asset #
186
+ # Set Asset #
190
187
if len (sys .argv ) > 2 :
191
- atl03_asset = sys .argv [2 ]
192
-
193
- # Set ATL06 Asset #
194
- if len (sys .argv ) > 3 :
195
- atl06_asset = sys .argv [3 ]
188
+ asset = sys .argv [2 ]
196
189
197
190
# Bypass service discovery if url supplied
198
- if len (sys .argv ) > 4 :
199
- if sys .argv [4 ] == "bypass" :
191
+ if len (sys .argv ) > 3 :
192
+ if sys .argv [3 ] == "bypass" :
200
193
url = [url ]
201
194
202
195
# Set Resource #
203
- if len (sys .argv ) > 5 :
204
- resource = sys .argv [5 ]
196
+ if len (sys .argv ) > 4 :
197
+ resource = sys .argv [4 ]
205
198
206
199
# Initialize Icesat2 Package #
207
200
icesat2 .init (url , True )
208
201
209
202
# Execute SlideRule Algorithm
210
- act = algoexec ("ATL03_" + resource + ".h5" , atl03_asset )
203
+ act = algoexec ("ATL03_" + resource + ".h5" , asset )
211
204
212
205
# Read ATL06 Expected Results
213
- exp = expread ("ATL06_" + resource + ".h5" , atl06_asset )
206
+ exp = expread ("ATL06_" + resource + ".h5" , asset )
214
207
215
208
# Read ATL03 Photon Cloud
216
- ph = phread ("ATL03_" + resource + ".h5" , atl03_asset , photon_cloud_region )
209
+ ph = phread ("ATL03_" + resource + ".h5" , asset , photon_cloud_region )
217
210
218
211
# Plot Actual vs. Expected
219
212
plotresults (act , exp , ph , photon_cloud_region )
0 commit comments