I.hyper: toolset for hyperspectral data processing in GRASS

Did you enjoy

nprocs=integer Number of threads for parallel computing

yet? See r3.mapcalc - GRASS 8.5.0dev Documentation

2 Likes

As this is crucial, I am adding more people, so maybe we move this to the right direction :slight_smile:
@neteler @wenzeslaus @martinl @annakrat

what would you suggest to aim for a metadata structure, that will be after used by tools? beside wavelength and other band wise metadata we must add additional ones to make processing possible. For now all the metadata stored by i.hyper has a dummy scheme, as it is simply written in comments and then parsed. We should update this somehow in a better way, then refactor all the i.hyper tools to follow it, then build other tools based on that. That metadata scheme should also be extendable. Any hints?

Thanks, will try, so far exporting the whole rast3d and running r.mapcalc on each band takes few minutes, then I r.to.rast3d with all of the metadata in description

One suggestion is to use write the metadata into a JSON and save them with the 3D raster (e.g. grid3/<mapname>/hyper.json). I am sending Alen a separate email with AI-generated code that could be a good start.

2 Likes

Only 2d mapcalc is parallel for now. I am not sure whether the 3D can be similarly parallelized.

Alen told me he reads all his needs (by chunk) in a numpy array, then computes everything and writes back, though I understand the attraction for that as a prototype, it puts r3.mapcalc into a drawer. But then, I also preferred the r.mapcalc at this point too for speed reasons. We have to think a bit about all that eventually.

For atmospheric correction, I will need to read several things from the images header. Non exhaustive list:

  • Wavelengths
  • Fwhms
  • Date of acquisition
  • Solar zenith angle
  • Solar azimuth angle
  • Satellite zenith angle
  • Satellite azimuth angle
1 Like

Integration of libradtran input generation into SMAC, getting there. Need to get timestamp in, it is using today’s date as satellite acquisition date…

1 Like

As discussed, i Will dig in @annakrat suggestions, then suggest a metadata structure (what you wrote + other) and when agreed, try to implement it and refactor all the other modules to account it.

Hi, try GitHub - YannChemin/i.hyper.smac: GRASS GIS AddOn to apply atmospheric correction using SMAC on raster3D imagery imported by i.hyper.import

also, can you add in i.hyper.explore the option of min/max manual threshold values? I need to see the curves output from i.hyper.SMAC, but there are few negative values, and one huge positive value ruining the quality of the reflectance curves. Thank you