[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDFJava #LEC-363579]: Get data through lat lon coordinates
- Subject: [netCDFJava #LEC-363579]: Get data through lat lon coordinates
- Date: Thu, 21 Feb 2019 16:01:41 -0700
Greetings!
I think I was able to find the file you are using:
https://e4ftl01.cr.usgs.gov/MOLT/MOD16A2.006/2001.01.01/MOD16A2.A2001001.h18v05.006.2017068142633.hdf
and here is the code I have to read in the grid:
---
import java.io.IOException;
import ucar.nc2.dt.GridDatatype;
import ucar.nc2.dt.grid.GridDataset;
public class modis {
public static void main(String[] args) {
String location =
"C:/Users/lesserwhirls/Desktop/modis/MOD16A2.A2001001.h18v05.006.2017068142633.hdf";
try (GridDataset gds = GridDataset.open(location)) {
GridDatatype grid =
gds.findGridDatatype("MOD_Grid_MOD16A2/Data_Fields/LE_500m");
System.out.println(grid.getUnitsString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
---
What version of netCDF-Java are you using?
Cheers,
Sean
> Hi
> I use it but it returns null to GridDatatype variable
> Maybe my problem is in the first line.
> GridDataset gds =
> ucar.nc2.dt.grid.GridDataset.open("C:\\MOD16A2.A2001001.h18v05.006.2017068142633.hdf");
> GridDatatype grid =
> gds.findGridDatatype("MOD_Grid_MOD16A2/Data_Fields/LE_500m");
>
> Thanks a lot
Ticket Details
===================
Ticket ID: LEC-363579
Department: Support netCDF Java
Priority: Urgent
Status: Open
===================
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.