hifexplo / hylite

An open-source toolbox for spectral geology
MIT License
39 stars 9 forks source link

Loading data #5

Closed thomaskaa closed 2 years ago

thomaskaa commented 2 years ago

Hey, any hint to loads sentinel 2 data, Thanks for the works, Thomas

samthiele commented 2 years ago

Morning Thomas.

I've not loaded any Sentinel data before, but what file format is it? If it can be loaded by GDAL or spectral python (SPy) then hylite might be able to read it natively. Otherwise you can always load the data into a numpy array using whatever library is convenient and then put it into a highlight image using:

image = hylite.HyImage( my_hypercube_data_array ) # optional: also specify an affine transform using the affine = keyword
image.set_wavelengths( my_hypercube_wavelenght_array )

Hope this helps.

thomaskaa commented 2 years ago

Thansk for you're answer, I have data's in a Geotiff format with the 12 different bands, normaly it can be loaded buy GDAL, but i dont know how to integrate it on your code. I read on your papers and also based on the 01_The_basics.ipynb, that i can load images ( .tiff) , can i only use the Geotiff and is differents bands to make the analysis ? Also, do you think I need to correct the data, the data that I use are already atmospherically corrected, Thanks for your support

samthiele commented 2 years ago

If it is a geotiff and GDAL is installed ( conda install gdal ) then you should be able to load the image as follows:

from hylite import io
image = io.load( path )

And if you don't need to fuse the data with a point cloud then just working with HyImage instances should be fine (meaning no geometric corrections). Atmospheric correction can be quite tricky, but if the data you have is already well corrected then yes - you can skip that step too :-)