|
Bruce Bowler <bbowler@bigelow.org> wrote in message <a638k3F4qoU1@mid.individual.net>...
> If I fire up hdftool and check the "import metadata" checkbox, it imports
> another variable, called {mumble}_info. How can I get that same data
> without calling hdftool (ie without presenting the user a UI?)
>
> The data is there, I can see it with ncdump -h from the command prompt (so
> I could spawn a sub process and parse the output but that's "not the right
> way").
>
> bcb@{some host}:/{some path}$ ncdump -h T2008303114000.L2_LAC
> netcdf T2008303114000 {
> dimensions:
> Number of Scan Lines = 2030 ;
> Number of Pixel Control Points = 1354 ;
> Pixels per Scan Line = 1354 ;
> total band number = 24 ;
> band number = 16 ;
>
> variables:
> {some stuff snipped}
> short pic(Number of Scan Lines, Pixels per Scan Line) ; <<< easy
> pic:long_name = "name1" ;
> pic:slope = 2.e-06f ; <<< how?
> pic:intercept = 0.064999998f ; <<< how?
> pic:units = "micro fortnights" ;
> pic:standard_name = longer name" ;
> pic:bad_value_scaled = -32767s ;
> pic:bad_value_unscaled = -0.00053400546f ;
> {'nother big snip}
>
> All of the ones labelled 'pic:' are in the metadata, but I can't figure
> out how to get the metadata...
>
> I'm after the 3 bits of data marked with <<<. I can get the 'easy' one,
> but can't figure out how to get the 'how?' ones.
>
> Any help most appreciated...
>
> Bruce
There's no direct way to do it, it's picked out of the contents of HDFINFO.
If you want a netCDF-ish style of info for an HDF4 variable, try SNCTOOLS.
|