NasjonaltBakkeSegment / safe_to_netcdf

Python scripts for converting specific Copernicus Sentinel products in Standard Archive Format for Europe (SAFE) to NetCDF/CF
GNU General Public License v3.0
6 stars 5 forks source link

Error when processing older S2L2A products #18

Closed ElodieFZ closed 2 years ago

ElodieFZ commented 2 years ago

When processing old S2L2A products (sensing time 2018, baseline N0207), production fails with

Traceback (most recent call last): File "/home/nbs/file_conversion/nbs_tools/script/wrapper", line 78, in wrapper(product, product_id, cfg) File "/home/nbs/file_conversion/nbs_tools/tools/wrapper.py", line 193, in wrapper conversion_object = Sentinel2_reader_and_NetCDF_converter(product=product, indir=tmp_dir, outdir=tmp_dir) File "/home/nbs/file_conversion/safe_to_netcdf/s2_reader_and_NetCDF_converter.py", line 75, in init self.main() File "/home/nbs/file_conversion/safe_to_netcdf/s2_reader_and_NetCDF_converter.py", line 100, in main self.readSunAndViewAngles(currXml) File "/home/nbs/file_conversion/safe_to_netcdf/s2_reader_and_NetCDF_converter.py", line 561, in readSunAndViewAngles root = utils.xml_read(xmlfile) File "/home/nbs/file_conversion/safe_to_netcdf/utils.py", line 24, in xml_read if not pathlib.Path(xml_file).is_file(): File "/modules/centos7/conda/Feb2021/envs/production/lib/python3.8/pathlib.py", line 1041, in new self = cls._from_parts(args, init=False) File "/modules/centos7/conda/Feb2021/envs/production/lib/python3.8/pathlib.py", line 682, in _from_parts drv, root, parts = self._parse_args(args) File "/modules/centos7/conda/Feb2021/envs/production/lib/python3.8/pathlib.py", line 666, in _parse_args a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not list

ElodieFZ commented 2 years ago

Closed with #19

ElodieFZ commented 2 years ago

For two products of this baseline, there are more typos in the xml files as described in the SAFE archive.

2022-06-17 11:41:12,142 - safe_to_netcdf.utils - ERROR - Error: Can't find xmlfile /lustre/storeB/project/NBS2/sentinel/production/NorwAREA/netCDFNBS_work/production/products_being_processed/S2B_MSIL2A_20180612T104019_N0208_R008_T32VNN_20180612T121641/S2B_MSIL2A_20180612T104019_N0208_R008_T32VNN_20180612T121641.SAFE/pc/app/facilities/PHOEBUS-core/PHOEBUS-core-3.4.317/DPC/exec/data/share/wp_in_progress/fasttrack_20180612_1/app_data/step_step_EUP_FastTrack/launch_5/.40601_1528809325724/.S2B_OPER_MSI_L2A_TL_EPAE_20180612T121641_A006612_T32VNN_N02.08/GRANULE/L2A_T32VNN_A006612_20180612T104020/MTD_TL.xml

ElodieFZ commented 2 years ago

Similar errors for some products from baseline N0208:

ERROR - Error: Can't find xmlfile /lustre/storeB/project/NBS2/sentinel/production/NorwAREA/netCDFNBS_work/production/products_being_processed/S2A_MSIL2A_20180607T104021_N0208_R008_T32VMK_20180607T132721/S2A_MSIL2A_20180607T104021_N0208_R008_T32VMK_20180607T132721.SAFE/pc/app/facilities/PHOEBUS-core/PHOEBUS-core-3.4.317/DPC/exec/data/share/wp_in_progress/fasttrack_20180607_2/app_data/step_step_EUP_FastTrack/launch_11/.35075_1528383154415/.S2A_OPER_MSI_L2A_TL_SGS__20180607T132721_A015449_T32VMK_N02.08/GRANULE/L2A_T32VMK_A015449_20180607T104022/MTD_TL.xml