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

only add requested beams for required variables #471

Open JessicaS11 opened 8 months ago

JessicaS11 commented 8 months ago
Thanks for working on a fix @JessicaS11! ### 🎉 I tried this out and it runs smoothly for a single ATL08 file, multiple ATL08 files, and multiple ATL06 files. I'm getting an error trying to read ATL03 files, but I think that one may be a me problem because I get the same error using version 0.8.0. ### 😕 Looking at the output the ATL08 produces I am not seeing what I expected, but I also may just be misunderstanding. The output `ds` from the code in #469 (used `reader.vars.append(beam_list=['gt1l', 'gt3r'], var_list=['h_canopy', "latitude", "longitude"])`) was: Screenshot 2023-11-14 at 9 06 06 AM My confusions: 1. Shouldn't `h_canopy` be a Data Variable? 2. Shouldn't only `gt1l` and `gt3r` be listed in `gt`? If you want to brainstorm together @JessicaS11 just let me know.

Originally posted by @rwegener2 in https://github.com/icesat2py/icepyx/issues/470#issuecomment-1810311016

During preparations for a tutorial using ATL08 and consequent debugging of data read in of ATL08, it was noted that all beams are coordinates in the resulting DataArray, even if only select beams were requested. Looking at reader.vars.wanted after the reader.vars.append line noted above and it looks like the other beams are being added via the mandatory rgt variable... (so, for instance, gt2l/land_segments/rgt is being added even though gt2l/land_segments/h_canopy is not. Thus, all of the beams are ending up in the dimension/index/coordinate list.

This issue will require diving into how internal calls to vars.append to include required variables can also be limited to the requested beams.