carlos-alberto-silva / rGEDI

rGEDI: An R Package for NASA's Global Ecosystem Dynamics Investigation (GEDI) Data Visualization and Processing.
157 stars 67 forks source link

Problem retrieving waveform from clipped data #8

Closed npuletti closed 4 years ago

npuletti commented 4 years ago

Dear all, I'm using rGEDI package in my study area in Italy.

When I try to extract Full-waveform (GEDI Level1B) in one of my shortNumber

_MyShotNumber = "25941123000204735"

Extracting GEDI full-waveform for a giving shotnumber

wf <- getLevel1BWF(gedilevel1b, shotnumber=MyShotNumber)

I receive the following error:

Error in [[.H5File(level1b, paste0(i, "/rx_sample_start_index")) : An object with name BEAM1011/rx_sample_start_index does not exist in this group

Any solutions? Thanks in advance for your help.

caiohamamura commented 4 years ago

Probably you are working with a clipped dataset.

What version of rGEDI are you using? Previously the clipping algorithm had a bug which didn't export the rx_sample_start_index properly.

You can check the version by calling:

citation("rGEDI")

This should give you an object which will print something like: note = {R package version 0.1.2},.

npuletti commented 4 years ago

Thanks for your reply.

Yes, I clipped the original h5 file. My rGEDI version is 0.1.2

femeunier commented 4 years ago

I experience the same issue with rGEDI version 0.1.3. After clipping, I got the error when trying to apply getLevel1BWF Error in[[.H5File(level1b, paste0(i, "/rx_sample_start_index")) : An object with name BEAM0000/rx_sample_start_index does not exist in this group

npuletti commented 4 years ago

I obtained the same error after installing the git hub version 0.1.3. The data I'm using are

GEDI01_B_2019148212155_O02594_T04606_02_003_02.h5

clipped using a squared extent (side 0.1 degrees) centred in

Lat = 39.0786141083 Lon = 16.5735212244

carlos-alberto-silva commented 4 years ago

Can you share the clipped data?

Obter o Outlook para Androidhttps://aka.ms/ghei36


From: Nicola Puletti notifications@github.com Sent: Friday, April 3, 2020 6:12:02 PM To: carlos-alberto-silva/rGEDI rGEDI@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [carlos-alberto-silva/rGEDI] rGEDI (#8)

I obtained the same error after installing the git hub version 0.1.3. The data I'm using are

GEDI01_B_2019148212155_O02594_T04606_02_003_02.h5

clipped using a squared extent (side 0.1 degrees) centred in

Lat = 39.0786141083 Lon = 16.5735212244

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcarlos-alberto-silva%2FrGEDI%2Fissues%2F8%23issuecomment-608668302&data=02%7C01%7C%7Cd4e102d2b60c48bdbc9808d7d813a835%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637215451239031307&sdata=b28xXnu4AT2nB8xlvaVce2pEirWwha2KmK9yqNSgrC4%3D&reserved=0, or unsubscribehttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABQO6ENXCSVH5QFTEBFJTPLRKZGKFANCNFSM4L3UUT2A&data=02%7C01%7C%7Cd4e102d2b60c48bdbc9808d7d813a835%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637215451239041315&sdata=urFM5AICwEaA70F%2BsY4jcuFFwRU7khHKrzJVuq%2FI2k0%3D&reserved=0.

femeunier commented 4 years ago

I'm pretty sure I'm experiencing the same issue, so here is an example of clipped file that does not contain the rx_sample_start_index variable GEDI01_B_2019137084435_O02415_T02713_02_003_01_sub.zip

carlos-alberto-silva commented 4 years ago

Please provide complete data and information! What is shot_number used in GEDI01_B_2019137084435_O02415_T02713_02_003_01_sub.ziphttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcarlos-alberto-silva%2FrGEDI%2Ffiles%2F4429946%2FGEDI01_B_2019137084435_O02415_T02713_02_003_01_sub.zip&data=02%7C01%7C%7C3de6c4ed2735413d8b9b08d7d814806a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637215454864705119&sdata=6n5e4AqCWD%2BJUJBvWQEvVZ54l5y%2BeB6ayTjre4viaqE%3D&reserved=0?

Also, for question and issues, please subscribe to the rGEDI yahoo group: rgedi-subscribe@yahoogroups.com

Best Regards,

Carlos A. Silva, Ph.D. University of Maryland Phone: +55 (31) 99663-0407 carlos_engflorestal@outlook.com CV: http://lattes.cnpq.br/4116817121389727 Web-LiDAR: https://www.facebook.com/groups/1504561379790934/?ref=bookmarks Guest Editor: https://www.mdpi.com/journal/remotesensing/special_issues/carbon_storage_measurement https://www.mdpi.com/journal/remotesensing/special_issues/LiDAR_RS_Forest_Resources_Wildland_Fireshttps://www.mdpi.com/journal/remotesensing/special_issues/DFMED https://www.mdpi.com/journal/forests/special_issues/RS_disturb https://www.mdpi.com/journal/remotesensing/special_issues/Drones_Ecology_and_Conservation https://www.mdpi.com/journal/remotesensing/special_issues/LiDAR_RS_Forest_Resources_Wildland_Fires


From: femeunier notifications@github.com Sent: Friday, April 3, 2020 3:18 PM To: carlos-alberto-silva/rGEDI rGEDI@noreply.github.com Cc: Carlos Alberto Silva carlos_engflorestal@outlook.com; Comment comment@noreply.github.com Subject: Re: [carlos-alberto-silva/rGEDI] rGEDI (#8)

I'm pretty sure I'm experiencing the same issue, so here is an example of clipped file that does not contain the rx_sample_start_index variable GEDI01_B_2019137084435_O02415_T02713_02_003_01_sub.ziphttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcarlos-alberto-silva%2FrGEDI%2Ffiles%2F4429946%2FGEDI01_B_2019137084435_O02415_T02713_02_003_01_sub.zip&data=02%7C01%7C%7C3de6c4ed2735413d8b9b08d7d814806a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637215454864705119&sdata=6n5e4AqCWD%2BJUJBvWQEvVZ54l5y%2BeB6ayTjre4viaqE%3D&reserved=0

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcarlos-alberto-silva%2FrGEDI%2Fissues%2F8%23issuecomment-608670619&data=02%7C01%7C%7C3de6c4ed2735413d8b9b08d7d814806a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637215454864705119&sdata=q6Ln%2B7TaYn%2Fv%2BV4R1OEDy8tcupQ1bi2NOppPIlB7Kg8%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABQO6EOY5X5GGA4FGVQL4WDRKZHA3ANCNFSM4L3UUT2A&data=02%7C01%7C%7C3de6c4ed2735413d8b9b08d7d814806a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637215454864715114&sdata=B7T%2Fuw8YJWnWgKfSZ6u3FP6ZF7zkqsTascYYyM9pOas%3D&reserved=0.

femeunier commented 4 years ago

Sorry for the missing information.

Here is a short code to reproduce the error:

rm(list = ls())

library(rGEDI)

gedilevel1b <- readLevel1B(level1Bpath = file.path(getwd(),"/GEDI01_B_2019137084435_O02415_T02713_02_003_01_sub.h5"))
level1bGeo <- getLevel1BGeo(level1b=gedilevel1b,select=c("elevation_bin0"))

shot.number <- "24150021700304060"
wf <- getLevel1BWF(level1b = gedilevel1b, shot_number=shot.number)

And this is how I generated the clipped data:

rm(list = ls())

# loading rGEDI package
library(rGEDI)

site.name <- "Paracou"
ul_lat<- 5.2
lr_lat<- 5.4
ul_lon<- -52.8
lr_lon<- -53

# Get path to GEDI data
gLevel1B <- gedifinder(product="GEDI01_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001")

# Set output dir for downloading the files
outdir <- file.path("/data/gent/vo/000/gvo00074/felicien/dataGEDI/",site.name)
if(!exists(outdir)) dir.create(outdir)

# Downloading GEDI data
gediDownload(filepath=gLevel1B,outdir=outdir)

xmin = -52.9
xmax = -52.85
ymin = 5.25
ymax = 5.35

# Reading and clipping GEDI data
for (ifile in seq(1,length(gLevel1B))){
  gedilevel1b<-readLevel1B(level1Bpath = file.path(outdir,basename(gLevel1B[ifile])))

  level1b_clip_bb <- tryCatch(clipLevel1B(gedilevel1b, xmin, xmax, ymin, ymax,output= file.path(outdir,paste0(sub('\\.h5$','',basename(gLevel1B[ifile])),"_sub.h5"))),
                              error = function(err){NA})
  close(gedilevel1b)
  if (!is.na(level1b_clip_bb)) close(level1b_clip_bb)
}

ps: I just subscribed to the group and my approval is pending. Do you actually prefer posting issues over there?

carlos-alberto-silva commented 4 years ago

Thanks - try to install again rGEDI. I believe Caio just fixed this issue. Yep, we prefer to post issues in the group..

caiohamamura commented 4 years ago

I've just fixed that with commit 4f6d035d6c25a6002f65c3efaec99b94878af676. Thanks for poiting out the bug.

The released v0.1.4 version will be submitted to CRAN. Meanwhile you can install from github using devtools.