You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When given a path to a specific variable, listGroup returns a dictionary with an extra level of nesting.
Code
fromh5coroimporth5coro, s3driverimportearthaccessauth=earthaccess.login()
s3_creds=auth.get_s3_credentials(daac='NSIDC')
my_bucket='nsidc-cumulus-prod-protected'path_to_hdf5_file='ATLAS/ATL03/006/2019/11/30/ATL03_20191130112041_09860505_006_01.h5'# path_to_hdf5_file = 'ATLAS/ATL03/006/2018/10/17/ATL03_20181017222812_02950102_006_02.h5'h5obj=h5coro.H5Coro(f'{my_bucket}/{path_to_hdf5_file}', s3driver.S3Driver,
credentials=s3_creds)
info=h5obj.listGroup('gt1l/heights/h_ph', w_attr=True, w_inspect=True)
# We expect the following print statement to return just a string of the long name# returns a dictionary insteadinfo['long_name']
Result
Excepted output: 'Photon WGS84 Height'
Actual output:
{'__metadata__': {"type": <class'numpy.float32'>, "dims": [2926335]},
'description': 'Height of each received photon, relative to the WGS-84 ellipsoid including the geophysical corrections noted in Section 6. Please note that neither the geoid, ocean tide nor the dynamic atmosphere (DAC) corrections are applied to the ellipsoidal heights.',
'contentType': 'physicalMeasurement',
'source': 'ATL03g ATBD, Section 3.4',
'long_name': 'Photon WGS84 Height',
'standard_name': 'height',
'units': 'meters',
'coordinates': 'delta_time lat_ph lon_ph',
'DIMENSION_LIST': None}
The text was updated successfully, but these errors were encountered:
The listGroup function, when inspecting each of the variables in the specified group, was treating the attributes in the group like they were variables. The result was that the code was reading expecting it to have its own attributes (which it of course doesn't). The commit shown above fixed the issue by breaking out attributes of a group from the variables of a group. For the attributes, instead of calling the inspectVariable function, the readAttribute function is correctly called.
Description
When given a path to a specific variable,
listGroup
returns a dictionary with an extra level of nesting.Code
Result
Excepted output:
'Photon WGS84 Height'
Actual output:
The text was updated successfully, but these errors were encountered: