Visualization of PRISMA he5
Dear, I have problems with the visualization of PRISMA he5.. When I open a PRISMA SWIR_cube, for example, the software give me a size of 1268x173x1235. The indicated number of bands is 1235. I would have expected that the right number is 173. It can be the reason of the visualization problem? Thank you so much
Comments (91)
-
-
- changed status to resolved
-
After updating the version to 3.7 of EnMap following error is shown during the opening of L2D datasets:
Traceback (most recent call last):
File "C:/Users/Prateek/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubdsm\processing\enmapalgorithm.py", line 63, in processAlgorithm
raise Exception('unexpected error')
Exception: unexpected error
Please help.
-
- changed status to duplicate
Duplicate of
#611. -
- changed status to resolved
→ <<cset 479f6ac83db4>>
-
→ <<cset 479f6ac83db4>>
-
Sapete per caso come convertire un file di tipo .h5 in .tiff su enmapbox ?
-
English please
-
Do you know how to convert a file of type .he5 to . tiff on enmapbox ?
-
We currntly support L1 and L2D:
-
The GTiff also has proper wavelength information attached:
-
Gives me this mistake…
-
We expect original file basenames, e.g.: PRS_L1_STD_OFFL_20201107101404_20201107101408_0001.he5
This isn’t a valid name:
-
Here is the actual check:
So, renaming your file to: PRS_L1_019.he5 should work.
-
BTW - are you sure that you have a L1 product?
-
How do I see what kind of product I have ?
-
Open the he5 file in QGIS. In the following pop-up dialog you should see it:
-
I think in my case it is an L2D product
-
Alright, then here you go:
-
Don’t forget to rename your file to e.g. PRS_L2D_019.he5
-
Yes, I did it. But it gives me this mistake…
-
Confirmed, under QGS 3.22 I get the same error. I’ll check this.
-
Okay, let me know if you can solve it. Thanks.
-
Ok, I could fix the problem by running the OSGeo4W Setup installing the latest available version of h5py:
-
- changed status to open
-
So I have to install this package on Qgis ?
-
h5py is part of QGIS, but it requires an update. You can start the setup dialog via the OSGeo4W shell:
-
I installed the package you told me but it always gives me the same error, ie :
ImportError: DLL load failed while importing defs: Unable to find specified procedure.
-
Ok, I guess there is still a wrong h5py version inside your user folder:
Try to manually delete the h5py folder. Now the correct version should be used.
-
follow-up issue covering the DLL import error:
#868 -
When I convert the he5 file into a geotiff one, I lose all the information about the Wavelength. Is it possible that I’m doing the conversion wrong?
-
Importing a PRISMA product into the EnMAP-Box already creates a GeoTiff with correct wavelength information:
If you want to save that GeoTiff to a new location use the “Save raster layer as” algorithm together with the “Copy metadata” option:
-
Note that if you use the standard QGIS “Save Raster Layer as…” or GDAL “Translate (convert format)”, you will loose your metadata.
-
Unfortunately it is still not working. It keeps me getting no wavelength information.
-
So, after you imported the PRISMA product into the EnMAP-Box, you have wavelength information available, correct?
What exactly are you doing afterwards? Which algorithm do you use, that delets the wavelength?
-
Yes, I do have the information when I import the file in EnMap-box, But when I try to export in Geotiff format, they disappear.
-
How do you export? Which algorithm? Please show a screenshot.
-
That is the step-by-step process that I’m adopting In order to convert tu .he5 in .tif
As you can see in the third imagine, I’m selecting the interested band that I want.
After I execute the process (image 5), the geotiff image is opens in qgis but without the wavelength information.
-
Ok, you are using the correct algorithms, that is good
Now, please check the Layer Properties of your result tif. Can’t you see the wavelength under GDAL Metadata?
-
Also note that QGIS is not aware of wavelength information. Do not use the QGIS Identify Tool to plot a spectral profile. It will always be plottet against the band indices:
-
Instead use the EnMAP-Box:
-
practically, once carried out the crop with qgis of the bands interested, opening the file with matlab, tells us that the wavelengths are not prensenti inside the file
-
once carried out the crop with qgis of the bands interested
Not sure what this means. Please show a screenshot what algorithm / tool you used.
-
Do you know how to use matlab software?
-
Not really, twenty years ago, a used Matlab the last time
-
As you can see from the image, when I bring the . tif file to Matlab it loses information about the wavelengths it had in qgis.
-
I guess the hypercube function expects the wavelength to be in a specific format/location.
EnMAP-Box stores wavelength information in the GDAL PAM file:
Your Matlab function is not aware of that.
You need to prepare your tif file (i.e. the wavelength information) with respect to the Matlab function.
Unfortunately, I can’t help you with that.
-
Maybe spamming but relevant to the title.
The panchromatic band is not accessible throught EnMAP yet.
Are plans for that dataset to be accessed ?
-
Sure, sounds good.
Is this the pan band?
-
Confirmed, that is the PAN band. Here is the follow-up issue:
#878 -
Hi, do you know how to extract reflectance values from an L2D prism product on enmap-box ?
-
Hi, do you know how to extract reflectance values from an L2D prism product on enmap-box ?
-
What do you mean by “extract reflectance values”? Given a point vector layer: extract spectral profiles for all points? Or something else?
-
I’d like to know how to extract spectral profiles for all the points.
-
You can extract the spectral profile for any pixel in ENMAP using the tool in the toolbar at the top.
-
Yes, for interactive profile extraction, use the spectral view.
To extract profiles for all points in a layer, use this algorithm:
Sampled values are stored in an attribute table with columns “Sample_1”, … “Sample_N” for each Band from 1 to N.
-
- changed status to resolved
-
When I open the L2D product on Enmap-Box these are the metadata that appear to me. I would like to know, if possible, which of these may be reflectance values ?
-
Your screenshot shows metadata, e.g. Band 175 is located at a center wavelength of 2061 nanometers and has a full width at half maximum (fwhm) of ~11 nanometers.
To see actual reflectance data use the spectral view for plotting pixel profiles like suggested by @Prateek Tripathi .
Or maybe I don’t get your question? Please explain a bit more in detail, what exactly you want to do.
-
Vorrei sapere come ricavare i valori della riflettanza per ogni singola banda.
-
English please
-
I’d like to know how to get the reflectance values for each band.
-
Alright, but this is not really a PRISMA-related question
To get all data of Band 42, do this:
-
No, to find the data of a band I right click and then I go to "Layer Properties" and then I go to "GDAL Metadata". But I can’t see the reflectance data.
-
I still don’t get what you want to achieve.
Under Layer Properties > GDAL Metadata you only find metadata.
To get the actual reflectance data of a PRISMA band, you need to do something like that:
This gives you the reflectance value of each pixel as an array.
Isn’t that what you want?
-
How do you generate this matrix for each band ?
-
With the code snippet I presented:
from enmapboxprocessing.rasterreader import RasterReader layer = QgsRasterLayer('<path to my raster layer>') reader = RasterReader(layer) array = reader.array(bandList=[42])
-
All right, I’ll try it in the morning and let you know how it goes, thank you very much.
-
When I put the following script in the Python console:
from enmapboxprocessing.rasterreader import RasterReader
layer = QgsRasterLayer('C:\Users\conte\Desktop\PRS_L2D_019_SR.tif')
reader = RasterReader(layer)
array = reader.array(bandList=[169])It gives me the following error:
Traceback (most recent call last):
File "C:\PROGRA~1/QGIS32~1.1/apps/qgis/./python/plugins\processing\script\ScriptEditorDialog.py", line 228, in runAlgorithm
exec(self.editor.text(), _locals)
File "<string>", line 2
layer = QgsRasterLayer('C:\Users\conte\Desktop\PRS_L2D_019_SR.tif')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape -
You need to put an r (raw) in front of the string because of the backslashes:
r'C:\Users\conte\Desktop\PRS_L2D_019_SR.tif'
-
When I put the following script in the Python console:
from enmapboxprocessing.rasterreader import RasterReader
layer = QgsRasterLayer(r'C:\Users\conte\Desktop\PRS_L2D_019_SR.tif')
reader = RasterReader(layer)
array = reader.array(bandList=[169])It gives me the following error:
Traceback (most recent call last):
File "C:\PROGRA~1/QGIS32~1.1/apps/qgis/./python/plugins\processing\script\ScriptEditorDialog.py", line 228, in runAlgorithm
exec(self.editor.text(), _locals)
File "<string>", line 2, in <module>
NameError: name 'QgsRasterLayer' is not defined -
Can you help me solve this last problem, which is to extract the reflectance matrix from this TIF file?
-
I am trying to visualize 750-800nm of my PRISMA VNIR satellite images.
I also want to look at Ocean Colour analysis with ONNS algorithm applied for my PRISMA images.
I tried to open the He5 in Acolite to generate Ocean Color algorithms satellite image plots but failed.
I found a R code (https://ranghetti.github.io/prismaread/) that converts the PRISMA he5 L2C to L2D. I am not sure if I converted correctly but at least I outputted the L2C files to geotiffs.
I cant tell if the code converted my files to L2D or not.
Below I was able to open the .he5 or geotiff in enmap-box but the RGB values are between 0-0.327547, I would have expected these VNIR images to have values from 400-1100nm.
I really am having a difficult time figuring out the correct processing steps to best utilize enmap-box for my data analysis interests. I am a graduate student and will truly be grateful for any guidance anyone may have with PRISMA data and enmap-box to reach my goals! ntrenholm@umces.edu
-
@Giuseppe Colacicco outside of QGIS you need to import the QgsRasterLayer class on your own first:
>>>from qgis.core import QgsRasterLayer
-
@Nicole Trenholm thanks for your questions.
I am trying to visualize 750-800nm of my PRISMA VNIR satellite images.
I also want to look at Ocean Colour analysis with ONNS algorithm applied for my PRISMA images.
ONNS is a third-party application. Please contact the developer directly:
Martin Hieronymi (martin.hieronymi@hzg.de)I tried to open the He5 in Acolite to generate Ocean Color algorithms satellite image plots but failed.
I found a R code (https://ranghetti.github.io/prismaread/) that converts the PRISMA he5 L2C to L2D. I am not sure if I converted correctly but at least I outputted the L2C files to geotiffs.
I cant tell if the code converted my files to L2D or not.
Sorry, I’m not familiar with the Acolite and prismaread tools.
Below I was able to open the .he5 or geotiff in enmap-box but the RGB values are between 0-0.327547, I would have expected these VNIR images to have values from 400-1100nm.
The values are reflectance values between 0 (0% reflectance) and 1 (100% reflectance).
The values between 400-1100nm would be the center wavelength of the individual bands. Those are reported here:
I really am having a difficult time figuring out the correct processing steps to best utilize enmap-box for my data analysis interests. I am a graduate student and will truly be grateful for any guidance anyone may have with PRISMA data and enmap-box to reach my goals! ntrenholm@umces.edu
Note that after importing the PRISMA data into the EnMAP-Box it is handled like any other (spectral) raster layer. You may use all the QGIS or EnMAP-Box algorithms available:
You may also ReadTheDoc:
https://enmap-box.readthedocs.io/en/latest/usr_section/usr_gettingstarted.html
https://enmap-box.readthedocs.io/en/latest/usr_section/usr_cookbook/usr_cookbook.html
https://enmap-box.readthedocs.io/en/latest/usr_section/application_tutorials/index.html
-
@Andreas Janz How can I import the Qgsrasterlayer class outside of QGIS? Where should I insert this script outside of QGIS?
-
Your question indicates, that you are not familiar with PyQGIS scripting. I would suggest that you take some days/weeks to learn it.
I would recommend to start here:
https://anitagraser.com/pyqgis-101-introduction-to-qgis-python-programming-for-non-programmers/Or here:
https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/index.html -
@Andreas Janz When I try to execute the script you gave me, it gives me this error message which says: "It seems like there is no valid script in the file".
Have you got any idea on how to solve this? I'm new to qgis and I'm using it for a university project so I don't use it so often. Thank you.
-
You are in the wrong place. You need to open the Python Console:
-
Is it possible to have the spectral library not in pixel by pixel but of the whole image? I mean, is it possible to have this graph of the whole image?
-
Do you really want to plot more than a million pixel profiles at the same time?
Or do you rather want to read the whole spectral image cube into an array of size [nrows, ncols, nbands] and do something else with the data?
-
For a university project, I have to calculate the CIBR (Continuum Interpolated Band Ratio) which is calculated with this formula:
Lc/[(A_Ll) + (B_Lr)]
Where Lc, Ll, and Lr are the radiance at a given channel (for example Lc is the radiance at band n.169, Ll at band 167 and Lr at band 173) and A and B are weight coefficients. I know the values of the weight coefficients A and B.
Since I have a L2D product, I am not able to get the radiance. So, just for studying purposes, I want to use the reflectance instead.
I was wondering if there is a way to get the reflectance values to use them in the formula I wrote before.
I'm attaching the image of the formula.
-
Ah now it makes more sense
For calculating formulars you should simply use one of the available Raster Calculators:
-
I reworked the PRISMA L2D import. Would be very helpful if you could test, if that is working on your system. Here is a dev-version:
-
I’m gonna download the version you sent me this weekend and test it to see how it’s doing with my computer.
-
I tried the version of Enmap that you sent me and on my PC it works well as you do not notice any particular slowdowns or bugs. I also take this opportunity to thank you for your availability and your help in this university project. I wish you a good weekend.
-
I too have the same issue of the wavelength info not getting embedded with the tiff file. I do understand that the QGIS environment shows the wavelength details very clearly. But I am trying to use the tiff file in ENVI 5.3, along with other files, where i am not getting the wavelength information. I have attached some screenshots for your perusal.
-
Never mind. I got it… Thanks anyway….
-
Hi all,
could you gently tell me if is possible to
- apply a scale factor of 100
- Perform QUAC atmospheric correction
to a prisma L1 product using enmap box?
I have a problem in dealing with prisma on ENVI since I have version 5.0 and 5.3 which do no support natively PRISMA data
-
@Andreas Janz could you please help me? It seems you are into this topic
-
Hi G C, I just answered your email. Regards.
- Log in to comment
PRISMA data is stored in a strange way and can not be displayed correctly as is in QGIS/EnMAP-Box.
Use the Add Product → PRISMA L2D to reformat it. (Only works for L2D data!)