Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ds = reader.load() #391

Closed
1kaiser opened this issue Dec 12, 2022 · 3 comments
Closed

ds = reader.load() #391

1kaiser opened this issue Dec 12, 2022 · 3 comments
Assignees
Labels
example_workflow Contains a user example workflow

Comments

@1kaiser
Copy link

1kaiser commented Dec 12, 2022

https://github.com/icesat2py/icepyx/blob/atmos/doc/source/example_notebooks/IS2_ATL09_workflow.ipynb

AttributeError                            Traceback (most recent call last)
[<ipython-input-36-2335148bbe01>](https://localhost:8080/#) in <module>
      3 warnings.filterwarnings('ignore')
      4 
----> 5 ds = reader.load()

2 frames
[/usr/local/lib/python3.8/dist-packages/icepyx/core/read.py](https://localhost:8080/#) in _add_vars_to_ds(is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict)
    409             import re
    410 
--> 411             gt_str = re.match(r"gt[1-3]['r','l']", grp_path).group()
    412             spot = is2ref.gt2spot(gt_str, is2ds.sc_orient.values[0])
    413             # add a test for the new function (called here)!

AttributeError: 'NoneType' object has no attribute 'group'
@JessicaS11 JessicaS11 assigned JessicaS11 and unassigned JessicaS11 Jun 28, 2023
@JessicaS11
Copy link
Member

@rwegener2 I can't assign you yet since I just sent your org invite. I believe this issue is resolved, but confirming that would give you a good chance to go through the linked workflow notebook and get a sense for using icepyx to read in data.

@1kaiser
Copy link
Author

1kaiser commented Jun 29, 2023

mam
now i use
from colab
with the data from earth data cloud

filename_1 = "/content/processed_ATL03_20200531180255_10110706_005_01.h5" #@param {type:"string"}
filename_2 = "/content/processed_ATL03_20200211111433_07140602_005_01.h5" #@param {type:"string"}
tr_1 = "gt1l" #@param ["gt1l", "gt1r", "gt2l", "gt2r", "gt3l", "gt3r"]
tr_2 = "gt1r" #@param ["gt1l", "gt1r", "gt2l", "gt2r", "gt3l", "gt3r"]
################################################################################
def get_height_lat_lon(filename, track_name):
  # Open the HDF5 file and extract data
  f = h5py.File(filename, 'r')
  h_ph_data = f['/'+str(track_name)+'/heights/h_ph']
  lat_ph_data = f['/'+str(track_name)+'/heights/lat_ph']
  lon_ph_data = f['/'+str(track_name)+'/heights/lon_ph']
  return h_ph_data, lat_ph_data, lon_ph_data
################################################################################
h_ph_data1, lat1, lon1 = get_height_lat_lon(filename_1, tr_1)
h_ph_data2, lat2, lon2 = get_height_lat_lon(filename_2, tr_2)

but thank yu for replying 🙏😁🥳✅

@rwegener2 rwegener2 self-assigned this Jun 29, 2023
@rwegener2
Copy link
Contributor

I have re-run the linked notebook with icepyx version 0.7.0 and for me it runs fine through the line ds = reader.load(). The only changes I needed to make to the notebook for it to run through that point are:

  • update to my own Earthdata Login credentials
  • change the root_path variable to a filepath on my own machine
  • I used the second pattern string (commented by default) to match all three of the downloaded files

Moving to the next line to extract a single profile it seems the variable names have changed. I changed the line profile = ds.sel(spot=1).isel(gran_idx=0) to profile = ds.sel(profile='profile_1').isel(gran_idx=0) and the plot then gets rendered nicely.

I suggest we update this line of the docs, but otherwise it appears that this example notebook is running smoothly.

@JessicaS11 JessicaS11 added the example_workflow Contains a user example workflow label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example_workflow Contains a user example workflow
Projects
None yet
Development

No branches or pull requests

3 participants