You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when executing the datacube indexing process. It raised RuntimeError: mismatch of attribute 'resolution'. I used the dataset which is processed using geocode function with EPSG:4326. Here the detail of the geocode script:
After finished the geocode process, I try to execute datacube indexing process with the following script:
frompathlibimportPathfrompyroSAR.datacube_utilimportProduct, DatasetfrompyroSAR.ancillaryimportfind_datasets, groupby# find pyroSAR files by metadata attributesarchive_dir=Path("sentinel")
scenes=find_datasets(str(archive_dir), recursive=True)
# group the found files by their file basenames# files with the same basename are considered to belong to the same datasetgrouped=groupby(scenes, "outname_base")
# define the polarization units describing the data setsunits= {"VV": "backscatter VV", "VH": "backscatter VH"}
# create a new productproduct_name="s1_gamma0_rtc"product_type="gamma0"withProduct(
name=product_name,
product_type=product_type,
description="Gamma Naught RTC backscatter",
) asprod:
fordatasetingrouped:
withDataset(dataset, units=units) asds:
# add the dataset to the productprod.add(ds)
# parse datacube indexing YMLs from product and data set metadatayml_index_oudir=Path(dataset[0]).parentyml_index=sorted(yml_index_oudir.glob("*.yml"))
iflen(yml_index) ==0:
prod.export_indexing_yml(ds, str(yml_index_oudir))
# write the product YMLyml_product=archive_dir.joinpath(f"{product_name}.yml")
prod.write(str(yml_product))
# print the product metadata which is written to the product YMLprint(prod)
But I encountered this error:
Traceback (most recent call last):
File "E:\Data\eodatasets\s1_indexing_pyrosar.py", line 29, in <module>
prod.add(ds)
File "C:\Users\suhen\miniconda3\envs\odc\lib\site-packages\pyroSAR\datacube_util.py", line 552, in add
self.check_integrity(dataset, allow_new_measurements=True)
File "C:\Users\suhen\miniconda3\envs\odc\lib\site-packages\pyroSAR\datacube_util.py", line 592, in check_integrity
raise RuntimeError("mismatch of attribute '{0}': {1}, {2}".format(attr, val_ds, val_prod))
RuntimeError: mismatch of attribute 'resolution': {'longitude': 8.983152841195213e-05, 'latitude': 8.983152841195213e-05}, {'longitude': 8.983152841195205e-05, 'latitude': 8.983152841195205e-05}
Is there any mistake in my script or anything else?
Hi @suhendra0812. Just as a word of warning... pyroSAR's Open Data Cube functionality has not seen an update since 2019 so it is very likely that it does not longer work as it is.
However, your error seems to be coming from the fact that I always worked with data in UTM projection (and thus resolution in meters) and you work with resolution in degrees. There is a slight mismatch between resolutions:
This test in check_integrity needs to be adjusted to account for this. Unfortunately I currently do not have the time to do this. You are very welcome to contribute..
Hi, all.
I encountered an issue when executing the datacube indexing process. It raised
RuntimeError: mismatch of attribute 'resolution'
. I used the dataset which is processed usinggeocode
function withEPSG:4326
. Here the detail of the geocode script:After finished the geocode process, I try to execute datacube indexing process with the following script:
But I encountered this error:
Is there any mistake in my script or anything else?
These are datasets that I use:
Please assist me if there is something wrong with my script.
Thank you in advance.
Best Regards,
Suhendra
The text was updated successfully, but these errors were encountered: