add an option to exclude bad bands from spectral profile plots

Issue #903 closed
Andreas Janz created an issue

Requested by @Agustin Lobo .

Add a simple checkbox “Exclude bad bands“ somewhere to the vis. settings:

Comments (18)

  1. Andreas Janz reporter

    Hi @Benjamin Jakimow you can now use the PRISMA l2 import algo to create a raster layer with bad bands defined for testing. See #910 for details.

  2. Andreas Rabe

    Also, improve label and fix typo here:

    I guess “Band Bands” should be “Bad Bands”.

    I would suggest to use “Show Bad Bands” or “Hide Bad Bands”, depending on what “false/true” means.

  3. Andreas Rabe

    Use this code snipped to set first 100 bands of the enmap testdata as bad bands:

    from osgeo import gdal
    
    from enmapbox import EnMAPBox, initAll
    from enmapbox.exampledata import enmap
    from enmapbox.testing import start_app
    from enmapboxprocessing.rasterwriter import RasterWriter
    from qgis._core import QgsRasterLayer
    
    # create raster with a bad band
    filename = 'enmap.vrt'
    ds = gdal.Translate(filename, enmap)
    writer = RasterWriter(ds)
    for bandNo in range(1, 101):
        writer.setBadBandMultiplier(0, bandNo)
    del writer, ds
    layer = QgsRasterLayer(filename)
    
    qgsApp = start_app()
    initAll()
    enmapBox = EnMAPBox(None)
    enmapBox.onDataDropped([layer])
    qgsApp.exec_()
    

  4. Agustin Lobo

    Bad bands are not ignored by Version 3.10.3.20220824T155109.master using envi format with bbl in the hdr.

  5. Andreas Rabe

    Hi @Agustin Lobo , is this the same dataset you shared recently?

    If not, please also share this dataset.

  6. Agustin Lobo

    I think this current issue can be closed. The problem was that I was interpreting that I needed to

    set Bad bands as TRUE to get them out of the spectrum, while this option must be set to FALSE

    (I would interpret “Bad bands: false” as “not to consider Bad bands list”. Perhaps this option should be clarified, eg

    “Bad bands: included” and Bad Bands: excluded”, as we refer to the plot).

    I would have bad bands excluded by default.

  7. Andreas Rabe

    Thanks Agus, I agree, a better name for the option would be “exclude bad bands” = True/False

  8. Log in to comment