Skip to content

Commit 8da0529

Browse files
committed
fixed algorithm test to use index instead of time for returned dataframes
1 parent 50b5e71 commit 8da0529

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/algorithm.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ def plotresults(act, exp, ph, region):
120120
box_lon = [coord["lon"] for coord in region]
121121
box_lat = [coord["lat"] for coord in region]
122122

123-
# Sort Results by Time
124-
act = act.sort_values(by=['delta_time'])
125-
126123
# Create Plot
127124
fig = plt.figure(num=None, figsize=(16, 10))
128125

@@ -141,18 +138,18 @@ def plotresults(act, exp, ph, region):
141138
ax2 = plt.subplot(132)
142139
ax2.set_title("Along Track Elevations")
143140
act_gt1r = act[act["gt"] == icesat2.GT1R]
144-
ax2.scatter(act_gt1r["time"].values, act_gt1r["h_mean"].values, s=0.5, color='b', zorder=3)
141+
ax2.scatter(act_gt1r.index.values, act_gt1r["h_mean"].values, s=0.5, color='b', zorder=3)
145142
ax2.scatter(exp["time"].values, exp["h_mean"].values, s=1.5, color='g', zorder=2)
146143

147144
# Plot Photon Cloud
148145
ax3 = plt.subplot(133)
149146
ax3.set_title("Photon Cloud")
150147
ph_gt1r = ph[ph["pair"] == icesat2.RIGHT_PAIR]
151148
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)
149+
ax3.scatter(ph_gt1r.index.values, ph_gt1r["height"].values, c=colormap[ph_gt1r["info"]], s=1.5)
153150
act_gt1r = act_gt1r[(act_gt1r.geometry.y > min(box_lat)) & (act_gt1r.geometry.y < max(box_lat))]
154151
act_gt1r = act_gt1r[(act_gt1r.geometry.x > min(box_lon)) & (act_gt1r.geometry.x < max(box_lon))]
155-
ax3.scatter(act_gt1r["time"], act_gt1r["h_mean"].values, color='r', s=0.5)
152+
ax3.scatter(act_gt1r.index.values, act_gt1r["h_mean"].values, color='r', s=0.5)
156153

157154
# Show Plot
158155
fig.tight_layout()

0 commit comments

Comments
 (0)