[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #QHW-398999]: How to read hdf5 files



Hi Alessio,

That dataset has 'Conventions = "ODIM_H5/V2_0"'. Currently, we do not have a 
CoordSysBuilder for that convention, meaning that NetCDF-Java won't be able to 
figure out the coordinate system for you. You'll have to do it yourself, by 
examining the dataset's Variables, Groups, Attributes, etc. The NetcdfFile 
class provides an API to do that. The "ODIM_H5/V2_0" conventions are described 
here: 
https://www.eol.ucar.edu/system/files/OPERA_2008_03_WP2.1b_ODIM_H5_v2.1.pdf

Cheers,
Christian


> First of all thanks for your answer.
> 
> The structure of my file is as follows.
> 
> 
> *{*
> 
> * group: dataset1 {*
> 
> * group: data1 {*
> * variables*
> * :byte data(1400, 1200);*
> * :_Unsigned = "true";*
> * :_ChunkSizes = 100, 100; // int*
> 
> 
> * group: quality1 {*
> * variables*
> * :byte data(1400, 1200);*
> * :_Unsigned = "true";*
> * :_ChunkSizes = 100, 100; // int*
> 
> 
> * group: what {*
> * // group attributes:*
> * :quantity = "QIND";*
> * :gain = 0.393701; // double*
> * :offset = 0.0; // double*
> * :undetect = 1.0; // double*
> * :nodata = 0.0; // double*
> * }*
> * }*
> * }*
> 
> * group: what {*
> * // group attributes:*
> * :product = "COMP";*
> * :quantity = "DBZH";*
> * :gain = 0.5; // double*
> * :offset = -31.0; // double*
> * :undetect = 1.0; // double*
> * :nodata = 0.0; // double*
> * }*
> * }*
> 
> * group: what {*
> * // group attributes:*
> * :object = "COMP";*
> * :version = "H5rad 2.0";*
> * :date = "20180329";*
> * :time = "0820";*
> * }*
> 
> * group: where {*
> * // group attributes:*
> * :projdef = "+proj=Mercator +lat_ts=42.0000 +lon_0=12.5000 +k=1.0
> +R=6378137.0";*
> * :LL_lon = 5.95503; // double*
> * :LL_lat = 35.0722; // double*
> * :UL_lon = 4.53744; // double*
> * :UL_lat = 47.5784; // double*
> * :UR_lon = 20.4626; // double*
> * :UR_lat = 47.5784; // double*
> * :LR_lon = 19.045; // double*
> * :LR_lat = 35.0722; // double*
> * :xscale = 1000.0; // double*
> * :yscale = 1000.0; // double*
> * :xsize = 1200; // int*
> * :ysize = 1400; // int*
> * }*
> 
> * // global attributes:*
> * :Conventions = "ODIM_H5/V2_0";*
> *}*
> 
> I have another question:  how can I read the coordinates of every single
> point on the grid, with NetCDF library ?
> I was able to read the values through these instructions:
> 
> *Variable var               =
> netcdfFile.findVariable(netcdfFile.getRootGroup().getGroups().get(0).getGroups().get(0),
> "data");*
> *ArrayByte.D2 array   = (ArrayByte.D2) var.read().reduce();*
> 
> 
> But I do not know how to get the coordinates of each point on the grid.
> 
> can you help me?
> 
> Thanks in advance
> 
> Best regards
> 
> Alessio Frabotta

Ticket Details
===================
Ticket ID: QHW-398999
Department: Support netCDF Java
Priority: High
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.