implement an EnMAP Level 1B reader

Issue #396 resolved
Andreas Janz created an issue

Official response

Comments (14)

  1. Andreas Janz reporter
    • read wavelength and data offset/gain information from …METADATA.XML files
    • stack VNIR and SWIR raster as VRT and try to also unscale to 0-1 range on-the-fly (use gdal.Translate with unscale argument)

       <bandCharacterisation>
          <bandID number="1">
            <wavelengthCenterOfBand>423.03</wavelengthCenterOfBand>
            <FWHMOfBand>6.93</FWHMOfBand>
            <GainOfBand>5.1626268296e-06</GainOfBand>
            <OffsetOfBand>0.0459044730958</OffsetOfBand>
          </bandID>
    

  2. Andreas Janz reporter

    @Benjamin Jakimow like discussed, I will implement a function that takes the …METADATA.XML files from the VNIR and SWIR raster as input and creates a VRT for each with attached wavelength information and unscaling into 0-1 range. Finally, I also create a VRT that includes all the bands.

  3. Andreas Janz reporter

    First L1B product imported into the EnMAP-Box 🤓

    see hubdsm/test/algorithm/test_importEnmapL1B.py for usage

  4. Andreas Janz reporter

    I will create a ProcessingAlgorithm for this, should be ready tonight, so should be in v3.6.

    @Benjamin Jakimow if you want, you could also provide functionality for opening a L1B product via the Add Data Source button, where the user selects the METADATA.XML file. Does that make sense for you?

  5. Benjamin Jakimow

    Of course. just send me the name of the processing algorithm and I can connect the algo with a button.

  6. Andreas Janz reporter

    Better use this function instead:

    from hubdsm.algorithm.importenmapl1b import importEnmapL1B
    
    dsVnir, dsSwir = importEnmapL1B(filenameMetadataXml=r'C:\Users\janzandr\Downloads\ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows100-199\ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z-METADATA.XML')
    

  7. Andreas Janz reporter

    @Benjamin Jakimow not sure why you want to use the ProcessingAlgo. When the user drag&drops the METADATA.XML onto the EnMAP-Box, you better not start the GUI of the ProcessingAlgo, but rather directly open the product in the DataSourcesPanel, right?

  8. Benjamin Jakimow

    @Andreas Janz can you provide a super-fast (!) function that quickly inspects an xml file and returns True in case it is a valid EnMAP Data format?

    @Sebastian van der Linden I would be even better if gdal is able to recognize EnMAP Products, like it does with Sentinel 1/2 XML files.

  9. Andreas Janz reporter

    Here is a function that quickly evaluats the given METADATA.XML filename, without opening it.

    from hubdsm.algorithm.importenmapl1b import isEnmapL1BProduct
    
    
    filenameMetadataXml = r'C:\Users\janzandr\Downloads\ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows100-199\ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z-METADATA.XML'
    valid = isEnmapL1BProduct(filenameMetadataXml=filenameMetadataXml)
    

  10. Log in to comment