icesat2py / icepyx

Python tools for obtaining and working with ICESat-2 data
https://icepyx.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
203 stars 101 forks source link

ATL06 r_eff read error #430

Open JessicaS11 opened 1 year ago

JessicaS11 commented 1 year ago

Hello Jessica! My name is Kiara Burgos and I am working with ICESAT-2 data for a summer research project at NASA Goddard. I am trying to use surface reflectance data to distinguish lava tubes and I am having trouble with the reader function. It is having trouble merging latitude, longitude, and reflectance variables. Do you have any suggestions? I included a screenshot of the error I am getting and the line of code where it's failing

Screenshot 2023-07-12 at 11 23 47 AM Screenshot 2023-07-12 at 11 24 59 AM

Originally posted by @kburgos6 in https://github.com/icesat2py/icepyx/discussions/308#discussioncomment-6430031

JessicaS11 commented 1 year ago

Hello @kburgos6! Thanks for reaching out.

I've reproduced your issue - it has to do with how icepyx parses apart the paths to the variables themselves. The software tries to be as general (and smart) as possible, but we haven't tested it on every variable for every product. Thank you for sharing your use case so we can add proper handling for this.

In the meantime, the below code should allow you to move forward with your workflow. Essentially, instead of having icepyx merge the variables from each file behind the scenes, you do the merging yourself.

reader.vars.append(var_list=["r_eff"])
ds = reader.load()
ds = ds.drop("delta_time")

reader.vars.remove(all=True)
reader.vars.append(var_list=["latitude","longitude"])
ds2 = reader.load()

combined = ds.merge(ds2, join='outer')

If you have any interest in getting involved with our community or ultimately sharing your use case workflow as an example we'd be excited to work with you to do so. Finding lava tubes sounds neat!