PRISMA (PRecursore IperSpettrale della Missione Applicativa) is a pilot hyperspectral satellite launched by ASI (Agenzia Spaziale Italiana) in 2019. Its main research pillars are agriculture, forest, waters, climate change, and raw material exploration. In the context of PRISMA data processing, three issues arise when dealing with L1 (Top of Atmosphere Radiance) and L2 (Bottom of Atmosphere Reflectance) products. First, the products are delivered in HDF format, which is not commonly ready-to-use in a geospatial software, and hyperspectral data is stored into two different stacks, Visibile to Near InfraRed and ShortWave InfraRed, to be merged for further processing. Secondly, PRISMA geocoding accuracy is not within the pixel size (30 m), and then requires a refinement. Thirdly, users may need to perform an ad hoc atmospheric correction for particular targets (e.g. water) and L1 is not geocoded. Available PRISMA tools, importing its format are ENVI-toolkit (NV5 Geospatial Software, Inc.), PRISMA-toolbox (Planetek) and EnMap-Box (GFZ), but only the former – that is commercial - provides for geocoding refinement and no geocoding for L1. To fill this lack with open SW, we realized a seamless procedure starting from standard HDF files to build the L1 geocoded and the L2 geocoding-refined products, in addition, regridding and smoothing routines are offered. The tool is based on open source libraries: prismaread for data conversion, cube merging and basic metadata gathering, and AROSICS and gdal for the geocoding (refinement of L2 or process of L1). For L1 information useful for atmospheric correction (e.g. sun and sensors view angles, band centers, etc.) are also extracted from HDF metadata. The regridding step is added both to L1 and L2 image to enable for multi-temporal image stacks. Last step is the spectral smoothing that is straightforwardly applied to the L2 process chain while it is applied to L1 chain only after atmospheric correction. Since the workflow takes advantages of different libraries and languages (R, Python) an Rstudio Server docker has been created together with a GitHub code repository, to create an easy-to-use distribution which do not require to solve all the dependencies of all libraries used.
PRISTAR-GEOSPEC tool can help you in:
- importing L0, L1, L2 PRISMA products;
- extracting and cleaning cloud mask for PRISMA;
- creating unique hyperspectral datacube VNIR+SWIR;
- extracting raster of angles;
- extracting central wavelengths and FWHMs;
- extracting and computing sun and sensor angles of PRISMA image (e.g. for your own atmospheric correction procedure);
- DEM-guided orthoprojection of PRISMA with DEM and Sentinel-2 image using AROSICS and Rational Polynomial Function (RPF);
- coregistration of PRISMA to Sentinel-2 image using AROSICS and gdalwarp;
- spectral smoothing and bad-bands removal;
- regriding and cropping the PRISMA image to a master PRISMA image.
#Emanuele Spirito @ CNR-IREA #Author
#Giandomenico De Luca @ CNR-IBE for advice on versions of GDAL and Arosics and for reading L0 products #https://doi.org/10.1016/j.isprsjprs.2024.07.003, https://doi.org/10.5281/zenodo.11547257
#Lorenzo Busetto @ CNR-IREA for prismaread package #https://github.com/IREA-CNR-MI/prismaread #distributed under GPL-3.0 license
#Federico Filipponi @ CNR-IGAG for his coregistration procedure made with Arosics and GDAL, for the maintanance of the Docker Container and any hardware-related solution #https://github.com/GFZ/arosics #distributed under Apache-2.0 license #https://gdal.org/en/stable #distributed under MIT license
#Lorenzo Parigi @ CNR-IREA for smoothing procedure
#Riccardo Canazza for advice in regrid procedure
#Yulun Wu @ University of Ottawa for PRISMA_angle.py code #https://github.com/yulunwu8/tmart/blob/main/tmart/AEC/read_PRISMA_vaa.py #distributed under GPL-3.0 license
Download docker from https://www.docker.com/products/docker-desktop/. Install it and install WSL using the Docker procedure. After the installation is finished, restart your PC and open Docker. Download PRISTAR-GEOSPEC master github repo into a folder that will be the PRISTAR-GEOSPEC folder. Download the docker image from dockerhub https://hub.docker.com/r/emanuelespiritowork/pristar-geospec/tags. Use the following command in the Windows terminal:
docker run --rm -ti -e DISABLE_AUTH=true -p 127.0.0.1:8787:8787 --memory="24576m" --memory-swap="24576m" -v C:/your/path/to/PRISTAR-GEOSPEC/folder:/space:rw emanuelespiritowork/pristar-geospec:#.#where you insert version number where above is #.# and 24576 stands for the amount of RAM to be used (24GB in this case). Then a UNIX console will be opened and you can start your Docker writing:
./initOpen a browser and enter the following URL:
localhost:8787An Rstudio Server will be loaded. Go to the right panel and click over the setup:
then put inside the box:
/space/Use case:
- you want read a L0 PRISMA image. Put data_SubAcq3_C_SWIR_SURFACE-OBS_Part0_S11.h5 and data_SubAcq3_C_VNIR_SURFACE-OBS_Part0_S11.he5 into put_PRISMA_he5_and_S2_tif_here folder. Then choose a L1 PRISMA image with same or similar view angle to the L0 products and put the .he5 file inside the put_PRISMA_he5_and_S2_tif_here folder. Then open main.R file in Rstudio server and in the procedure_order variable put
procedure_order <- c("inject","read")- you want to read a L1 or L2 PRISMA image in .he5 format. Put your PRISMA file in .he5 format in the put_PRISMA_he5_and_S2_tif_here folder. Then open main.R file in Rstudio server and in the procedure_order variable put
procedure_order <- c("read")- you want to read, generate cloud mask and angle file. Put your PRISMA file in .he5 format in the put_PRISMA_he5_and_S2_tif_here folder. Then open main.R file in Rstudio server and in the procedure_order variable put
procedure_order <- c("read","cloud","atcor")- you want to read and coregister your PRISMA image to a one-band Sentinel-2 image using gdalwarp. Put your PRISMA file in .he5 format and S2 one-band image in .tif format in the put_PRISMA_he5_and_S2_tif_here folder. Choose the PRISMA band for coregistration and if you want a validation for coregistration. Then open main.R file in Rstudio server and in the procedure_order variable put
procedure_order <- c("read","coreg")
validation_for_coreg <- F
PRS_band_for_coreg <- 52- you want to read and orthoproject your PRISMA image. Put your PRISMA file in .he5 format and S2 one-band image in .tif format in the put_PRISMA_he5_and_S2_tif_here folder. Then put your DEM image into .tif format into DEM folder. Choose the PRISMA band for coregistration and if you want a validation for coregistration. Then open main.R file in Rstudio server and in the procedure_order variable put
procedure_order <- c("read","ortho")
validation_for_coreg <- F
PRS_band_for_coreg <- 52- you want to read, coregister your PRISMA image and spectral smooth with bad bands removal. Put your PRISMA file in .he5 format and S2 one-band image in .tif format in the put_PRISMA_he5_and_S2_tif_here folder. Choose the PRISMA band for coregistration and if you want a validation for coregistration. Then open main.R file in Rstudio server and put
full_230_bands <- F
procedure_order <- c("read","coreg","smooth")
validation_for_coreg <- F
PRS_band_for_coreg <- 52- you want to read, coregister your PRISMA image and regrid the PRISMA image to a master image. Put your PRISMA file in .he5 format and S2 one-band image in .tif format in the put_PRISMA_he5_and_S2_tif_here folder. Then put your master PRISMA image in .tif format into master_image_for_regridding folder. Choose the PRISMA band for coregistration and if you want a validation for coregistration. Choose type of resampling ("N" for nearest neighbor, "B" for bilinear, "C" for cubic). Then open main.R file in Rstudio server and put
regrid_option <- "N" #that can be either "B" or "C"
procedure_order <- c("read","coreg","regrid")
validation_for_coreg <- F
PRS_band_for_coreg <- 52Click on source and the code will start.
Ask
