Spectrum view and custom files

Hi everyone,

How should I format custom netcdf of HDF4 files so that they can load in SNAP with spectrum view ?

Thanks !
François

Unfortunately, we don’t read the wavelength from the NetCDF file at all. Only if they are written as NetCDF-BEAM.
But with gpt you could easily add this information to your data, if you don’t have too many bands.

The attached graph file is an example. Change the name and the expression according to your data and also the spectral properties. You should increase the spectral index for each band.
Repeat the targetBand section for each input band.
Let the graph run from the command line. This way you can do it also on a bunch of files.

Updated: band_math.xml (806 Bytes)

Thanks for your answer, Marco.

Do you think it would then be easy to write directly in a NetCDF-BEAM compliant format ?

Also, is it possible to add spectral information to several parameters in the same file ?

Writing NetCDF-BEAM format is only easy when you use SNAP. And the problem is that other software can’t interpret this special information. NetCDF-BEAM is only an option if you stay in the SNAP domain.

Unfortunately, it is not possible to update an existing file. But you can repeat the targetBand block for the different parameters.