LorenzoStucchi / SEN-ET_automatization

Automatization of the SEN-et SNAP plugin for multi-temporal analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[SEN-ET_automatization]"NameError: name 'valid_list_s2_images' is not defined" during code run

coomomo opened this issue · comments

Hello, I encountered "NameError: name 'valid_list_s2_images' is not defined" when running the code "0_path_read.py". I don't know how to fix this error, I hope I can get some help, thanks!

Dear @coomomo, the error seems connected to the fact that there are no Sentinel-2 images in the indicated directory. Did you follow the steps indicated in the README.md and download the satellite images?

As before I believe this should be an issue with the path, try to check if the path exists.

It is searching the file connected with the S3 images and only that, so maybe your file are in the wrong location

I cannot see your image, try to attach them on github issue and not in the email

Thank you very much for your previous answer, I have solved the path problem. But there are still several problems in the program that I have tried many times and still can't solve.I hope I can get your help,Thanks again.

` Processing the image S2 2021_01_18
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Executing processing graph
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32648
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
INFO: org.hsqldb.persist.Logger: dataFileCache open start
WARNING: org.esa.s2tbx.dataio.s2.ortho.metadata.S2OrthoMetadata: Warning: missing file E:\TEMP\MAIN_FOLDER\s2\2021_01_18\S2B_MSIL2A_20210118T033059_N0214_R018_T48QXM_20210118T062400.SAFE\GRANULE\L2A_T48QXM_A020207_20210118T033053\QI_DATA\L2A_T48QXM_20210118T033059_DDV_20
m.jp2

WARNING: org.esa.s2tbx.dataio.s2.ortho.metadata.S2OrthoMetadata: Warning: no image files found for band quality_dense_dark_vegetation

SEVERE: org.esa.s2tbx.biophysical.BiophysicalAuxdata: Error when reading C:\Users\Administrator.snap\auxdata\s2tbx\biophysical\3_0\S2B\LAI_Cw\LAI_Cw_TestCases
WARNING: org.esa.s2tbx.biophysical.BiophysicalAuxdata: Error when loading coefficients TEST_CASES for variable LAI_Cw model S2B. They won't be available.`

Sharpening the image S3 2021_01_18 03:03 INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 3.0.2 found on system. JNI driver will be used. INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.2 set to be used by SNAP. INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience. INFO: Deriving solar illumination conditions... INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.2 set to be used by SNAP. INFO: org.hsqldb.persist.Logger: dataFileCache open start INFO: org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter: writing to output file C:\Users\ADMINI~1\AppData\Local\Temp\tmph1zuweee.tif Saved C:\Users\ADMINI~1\AppData\Local\Temp\tmph1zuweee_cos_theta.tif INFO: Preparing high-resolution data... INFO: org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter: writing to output file C:\Users\ADMINI~1\AppData\Local\Temp\tmp_lsb7_ij.tif Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. INFO: org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter: writing to output file C:\Users\ADMINI~1\AppData\Local\Temp\tmpinzg6xr1.tif INFO: org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter: writing to output file C:\Users\ADMINI~1\AppData\Local\Temp\tmpn1tefd__.tif INFO: Training regressor... Traceback (most recent call last): File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts\data_mining_sharpener.py", line 216, in <module> main() File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\lib\site-packages\click\core.py", line 764, in __call__ return self.main(*args, **kwargs) File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\lib\site-packages\click\core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\lib\site-packages\click\core.py", line 555, in invoke return callback(*args, **kwargs) File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts\data_mining_sharpener.py", line 97, in main disaggregator.trainSharpener() File "C:\Users\Administrator\.snap\auxdata\sen-et-conda-Win64\lib\site-packages\pyDMS\pyDMS.py", line 332, in trainSharpener qualityPix = np.logical_and(qualityPix, ~np.isnan(data_LR)) ValueError: operands could not be broadcast together with shapes (5490,5490) (96,96)

Although "WARNING: org.esa.s2tbx.biophysical.BiophysicalAuxdata: Error when loading coefficients TEST_CASES for variable LAI_Cw model S2B. They won't be available." appears, but this process has result output, I'm not sure if the result is correct. And "Sharpen LST" has no result output

I am using windows 10, snap8.0, python3.4

Although "WARNING: org.esa.s2tbx.biophysical.BiophysicalAuxdata: Error when loading coefficients TEST_CASES for variable LAI_Cw model S2B. They won't be available." appears, but this process has result output, I'm not sure if the result is correct. And "Sharpen LST" has no result output

This is a SNAP warning, it is ok and the results is valid

Although "WARNING: org.esa.s2tbx.biophysical.BiophysicalAuxdata: Error when loading coefficients TEST_CASES for variable LAI_Cw model S2B. They won't be available." appears, but this process has result output, I'm not sure if the result is correct. And "Sharpen LST" has no result output

This is a SNAP warning, it is ok and the results is valid

Thank you. "ValueError: operands could not be broadcast together with shapes" when I try to run "Sharpen LST". How should I correct this mistake?

Thank you. "ValueError: operands could not be broadcast together with shapes" when I try to run "Sharpen LST". How should I correct this mistake?

Sorry, I don't have enough information to provide help. Do you insert all the correct inputs?

@coomomo did you solve the found issue? Do you need more help?

@LorenzoStucchi
The problem I encountered regarding "ValueError: operands could not be broadcast together with shapes (5490,5490) (96,96)" has been solved. My solution was to manually operate in SNAP when doing "warp to template", "sharpen LST" and the input file must be "graph" The input file must be the "LST", "MASK" and "observation geometry" from the "graph" folder of sentinel_3_pre_processing.xml. I think the reason for this one error may be that the study area is not in the right range.
Thank you again for your previous help.