Use Sen2Cor results in Envi

hello ,

i did atmospheric correction in sentinel 2 image with the sen2cor and resample in 10 m . The type of the output product is a dim file. I couldn’t save in envi format. Can anyone help? I just want to open the image in envi after the correction and resample.

thanks in advance

Within the *.data directory, you find envi compatible files. Or When you export your resampled product you can directly choose the envi format or some other compatible format

thanks for your answer , i am going to look it again

i looked on the data that were extracted , but when i open the images in the envi , do not keep the reflectance from the snap. In metadata spectral radiance only 0.001 to all the images from B2 to B12 (resampled 10m)

How do the values compare in snap and envi? What is the value range?
You still use the envi files from *.data directory?
Maybe there is a scaling factor stored with the DIMAP file. You can check this if you open the information for a certain band.

Well, these are the steps that i did, so that to have an reflectance image (atmospherically corrected) of sentinel 2 and to open this image in envi 5.3

firstly i open the image in snap and in sen2cor so that to do the atmopherical correction for the 10m and 20m.
Then i did the resampling in 10m. After that i save in product file .dim .
In the file product.dim, there are the bands in hdr extension. So, i open in envi all th bands from 2 to 11, but the images are not atmospherically corrected. The values are not reflectance values.

Also in the product.dim folder there are azimuth, and zenith for each image (Β2-Β11)

Or else , how can i input the gains and offsets of the images in envi?
Also i opened the images (B2-B11)in envi , layer stacking and i devote with 10000 (float(b1)/10000).
Do you think is that right?

Furthermore, i tried to save in envi format the resampled image but the message that shows me is:

I don’t work often with S2 data, so I don’t know the output of sen2cor. But dividing the values by 10000 is probably a good idea. Also I’m not in the office and don’t have the possibilities to investigate as usual.

@obarrilero, can you take over?

P.S. I moved the discussion to a separate thread

Hi @rinokeros,

first of all, if you are using only the reflectance and not the angles, I suggest you to make a subset before saving the product and to select only the bands you are interested, this way it will be faster.

I have made the following steps:
Sen2Cor at 10m -> Resampling at 10m -> Subset (only bands B2 and B5) -> Save as BEAM-DIMAP

When I open the .hdr in SNAP (I do not have ENVI) the pixel values seem to be OK. The conversion from DN to reflectance should be automatic, since the gain and offset values are indicated in the hdr file (you can explore it in a text editor):

If you open your hdr files in SNAP, the values are OK? What values are you obtaining in ENVI? Are they different?

1 Like

the values in snap are ok, are reflectance values after the sen2cor. In envi i open the images (hdr) - layer stacking- profile spectra, in y axes the values are not reflectance values. So, i devided the image with 10000. My question is , the atmospherical correction is it hold in the hdr? if it did why the image does not have reflectance values?

I upload the hdr of band 3

thank you all of you for helping me!


I have been able to test in a computer with ENVI 4 and it opens the .img files properly, but it does not recognize directly the gain value, so you should transform the image by using band math with some expression like Float(B1)/10000.0 (for getting reflectance from DN you have to divide by 10000).

ok ! so it is atmospherically corrected in envi, only the gain value is the problem.
Thank you very much!!