Skip to content
Snippets Groups Projects
Commit 45582cd6 authored by Alex Rojas's avatar Alex Rojas
Browse files

included cval as returned item from gedi_bioindex function and added to output biomass df.

parent 42a4d6fc
No related branches found
No related tags found
No related merge requests found
...@@ -76,13 +76,11 @@ def gedi_bioindex(index,l1b_ds,l2a_ds, beam, beam_filt, allom_df): ...@@ -76,13 +76,11 @@ def gedi_bioindex(index,l1b_ds,l2a_ds, beam, beam_filt, allom_df):
# get pgap # get pgap
pgap = GapDS(waveform_smooth, ht_arr, np.array([rh100]), calc_refl_vg = False, pgap = GapDS(waveform_smooth, ht_arr, np.array([rh100]), calc_refl_vg = False,
utm_x=None,utm_y=None,cval=cval) utm_x=None,utm_y=None,cval=cval)
# print cval to make sure all is good
print(cval)
except: except:
# bad data (fix for future) # bad data (fix for future)
return (np.nan,np.nan,np.nan,np.nan,np.nan) return (np.nan,np.nan,np.nan,np.nan,np.nan)
# return a tuple of biwf and bfp # return a tuple of biwf and bfp
return (pgap.biWF[0], pgap.biFP[0], np.nanmin(pgap.gap), np.nanmax(pgap.lai), rh100) return (pgap.biWF[0], pgap.biFP[0], np.nanmin(pgap.gap), np.nanmax(pgap.lai), rh100, cval)
...@@ -171,6 +169,7 @@ if __name__ == '__main__': ...@@ -171,6 +169,7 @@ if __name__ == '__main__':
gap_list = [] gap_list = []
lai_list = [] lai_list = []
rh_list = [] rh_list = []
cval_list = []
print("Running pgap iteratively...") print("Running pgap iteratively...")
for i in idx: for i in idx:
results = gedi_bioindex(i,l1b_ds,l2a_ds,beam,beam_filt, allom_df) results = gedi_bioindex(i,l1b_ds,l2a_ds,beam,beam_filt, allom_df)
...@@ -180,6 +179,7 @@ if __name__ == '__main__': ...@@ -180,6 +179,7 @@ if __name__ == '__main__':
gap_list.append(results[2]) gap_list.append(results[2])
lai_list.append(results[3]) lai_list.append(results[3])
rh_list.append(results[4]) rh_list.append(results[4])
cval_list.append(results[5])
print("Done!") print("Done!")
...@@ -192,6 +192,8 @@ if __name__ == '__main__': ...@@ -192,6 +192,8 @@ if __name__ == '__main__':
new_df['gap'] = np.round(gap_list,3) new_df['gap'] = np.round(gap_list,3)
new_df['lai'] = np.round(lai_list,3) new_df['lai'] = np.round(lai_list,3)
new_df['rh'] = np.round(rh_list,3) new_df['rh'] = np.round(rh_list,3)
new_df['cval'] = np.round(rh_list,3)
# append to df_list # append to df_list
df_list.append(new_df) df_list.append(new_df)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment