Comments (6)
Hi Auberginn, as far as I understand, the bits of each float32 were written to the file as two 16-bit words. You will need to read the variable as Int16, an then to manually convert each pair of ints to a float, i'm afraid. Class BitConverter may help you with this.
from sdslite.
Hi vassilyl, I'm not sure I understand the pairing Int16 that you mention. The table data in the image corresponds to a partial printscreen cut of the grid cells values shown by the DataSet Viewer Table. When I use the GetData in C#, it returns the same values, which -19725 corresponds to the first cell of the grid located at index [0,0,0] of the Int16 array (where the structure is [latitude, longitude, value]). The value should be in Kelvin and around 245°C.
from sdslite.
I may have misunderstood you.
... but the data is actually a float32
-- what does it actually mean? Can you show actual metadata on the variable (sds meta <ncfile> <var>
)?
from sdslite.
My mistake, just float.
DataFlow Shell version 1.3.14517.0
DataSet Core version 1.3.14517.0
$dataset = Y2010M01.nc
Attached new DataSet at $dataset with id=1
show $dataset meta t2m
$dataset net.pipe://localhost/microsoft/research/science/data/StorageService/bebd021e-5c80-40cd-8f7f-d6c654d83492/
msds:nc?file=E:\era5land\Y2010M01.nc
[-6] t2m of type Int16 (time:744) (latitude:231) (longitude:441)
Name = t2m
_FillValue = -32767
units = K
long_name = 2 metre temperature
add_offset = 260.533688291066
scale_factor = 0.000845463766003984
missing_value = -32767
from sdslite.
I am having the same issue..@Auberginn can you please let me know if you were able to resolve this?
from sdslite.
SDSLite is transparent in regards to attribute conventions except for "missing_value".
In this particular case the library returns int16 values stored in the file, e.g. -19725
. The scale_factor
and add_offset
metadata on the variable indicates how to convert the stored values to "physical" ones: -19725 * 0.000845463766003984 + 260.533688291066 = 243.8569155066374
.
See Appendix A: Attribute Conventions at https://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html.
from sdslite.
Related Issues (20)
- Getting dimensions initial starting values in NetCDF HOT 1
- Licensing: MIT or MSR-LA? HOT 1
- unidata link not work HOT 2
- Requires "System.Security.Permissions" to avoid runtime error on netcoreapp3.1
- Adding the UCAR binaries - which are needed? HOT 2
- Current NuGet package doesn't work HOT 4
- Need some help implementing netcdf reader in VS HOT 2
- Convert to Standard Library? HOT 1
- Under windows, error "FileNotFoundException: netcdf.dll not found in current directory" HOT 2
- SDSLite cannot read NetCDF variables of type NC_CHAR
- Reading .nc4 dataset HOT 3
- Unit Test Empty_AddVariable_string() failed HOT 1
- Reading nc4
- CSV dataset cannot add a variable with "no MissingValue" error HOT 1
- CSV doesn't round-trip string `null` value.
- Unable to register format in AOT mode and unable to open file
- Setting _FillValue attribute HOT 2
- How to read netCDF file from directly path ?
- Failed to Create Dataset Instance 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 sdslite.