Comments (8)
Would it be possible to print out what xarray thinks of that variable from the two sources? Have two cells with ds2['TMP_2maboveground']
and ds['TMP_2maboveground']
.
from h5pyd.
@ajelenak-thg , yes, it looks like HSDS is dropping the variable attributes:
https://gist.github.com/rsignell-usgs/dbe88df42e1181827363a8348016f28b
BTW, you should be able to run this notebook (at least the HSDS and DAP access cells) -- you just need a username and password for this XSEDE endpoint from @jreadey in your ~/.hscfg
, right?
If you sign up for XSEDE I can add you to my project, in case that becomes useful later on.
from h5pyd.
Seems like some attributes of the time
coordinate got lost "in translation" to HSDS. According to the DAS response from the THREDDS server:
time {
String units "seconds since 1970-01-01 00:00:00.0 0:00";
String long_name "verification time generated by wgrib2 function verftime()";
Float64 reference_time 1.4832288E9;
Int32 reference_time_type 0;
String reference_date "2017.01.01 00:00:00 UTC";
String reference_time_description "kind of product unclear, reference date is variable, min found reference date is given";
String time_step_setting "auto";
Float64 time_step 3600.0;
Int32 _ChunkSizes 512;
}
_ChunkSizes
does not really exist as an attribute, I think, because netCDF tools typically display HDF5 dataset creation properties as system attributes (prefixed with _
).
The HSDS response about the attributes of the time
coordinate shows only these (HDF5 dimension scale-related attributes not included): _Netcdf4Dimid
, reference_time
, reference_time_type
, time_step
. No units
attribute so no conversion to datetime
.
from h5pyd.
@ajelenak-thg and @jreadey, yes, HSDS is losing nearly all variable attributes!
The variable in the original NC file has attributes:
float TMP_2maboveground(time, latitude, longitude) ;
TMP_2maboveground:_FillValue = 9.999e+20f ;
TMP_2maboveground:least_significant_digit = 2 ;
TMP_2maboveground:short_name = "TMP_2maboveground" ;
TMP_2maboveground:long_name = "Temperature" ;
TMP_2maboveground:level = "2 m above ground" ;
TMP_2maboveground:units = "K" ;
while in HSDS, the only remaining attribute is:
Attributes:
least_significant_digit: [2]
Does this mean perhaps that HSDS is only handing attributes with integer values or something?
from h5pyd.
@rsignell-usgs - do you see any errors during the import (with hsload)?
I've seen this issue: h5py/h5py#719 come up when loading NetCDF files.
from h5pyd.
Oh yes, I got tons of errors on hsload
.
Looks like the real problem is here: h5py/h5py#719 (comment) :
The issue here is that recent versions of netCDF-C save the NC_CHAR dtype as fixed length UTF8 strings, which h5py cannot read.
So maybe hsload
could translate NC_CHAR
dtypes
into something that h5pyd
can read?
from h5pyd.
I don't know if it is possible to get the bytes for such attributes somehow and avoid h5py until that issue is resolved.
from h5pyd.
I have just created a PR with a fix for this problem: h5py/h5py#988. It works for the netCDF file used here. Let's what happens.
from h5pyd.
Related Issues (20)
- `hsload` fails when an attribute has type `Reference` HOT 4
- hsload fails with datasets using scale offset filter HOT 1
- apply source compression filter in hsload HOT 1
- Show filters applied to any datasets in hsls HOT 1
- h5pyd not evaluating environment variables HOT 1
- An error related to hsrm HOT 12
- Error with 1D chunk sizes HOT 2
- `logging.info` call forces downstream package loggers to emit messages twice
- Recursive Domain Deletion Flag for `hsrm`
- git tags missing HOT 1
- hsload doesn't allow linkpath and fastlink options to be used together
- Update build process to use toml HOT 1
- CI Testing in Github HOT 1
- Support numpy-style broadcasting
- Support field selection from compound types HOT 1
- Support ordering links/attribute by creation index/name HOT 1
- Attributes in root group not displayed by hsls --showattrs HOT 1
- Support for H5Dread_multi/H5Dwrite_multi
- Missing v0.18.0 tag HOT 2
- PEP 632: Python 3.12 Incompatible with Distutils HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h5pyd.