New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to download only enchanced_measrement.nc file from a Sen-3 SRAL product using node filter ? #566
Comments
Hi @usamarehan557, could you please provide more information? |
`def print_products():
Error Log:
Process finished with exit code 0 |
It seems that in S3 products the mainfest file is named |
I encountered the same error while trying to download individual bands of a Sentinel 3 SY_2_SYN___ product. Could anyone point me to the code that handles partial downloads? Would a PR be welcome on this issue? |
IMHO it would be indeed appreciated. sentinelsat/sentinelsat/sentinel.py Line 1082 in 3682e43
|
Alright after delving into the code a little (it was my first time looking at the API), I managed to make it work: The issue lies with the fact that the code always assumes that the folder path of the product ends with '.SAFE', while Sentinel 3 paths end with '.SEN3', and that the manifest file is named 'manifest.safe', while in Sentinel 3 products it is named 'xfdumanifest.xml'. More in detail, the portions of the code that prevent node filtering from working with Sentinel-3 are the following:
Simply replacing '.SAFE' with '.SEN3' and 'manifest.safe' with 'xfdumanifest.xml' allows the _filter_nodes function to correctly find the manifest file and to correctly return the filtered sub-products. A simple fix would be to rewrite these portions of code while properly handling products that have a differently named path and manifest file. Is there a recommended way to go at this? Could one infer the product type using the OData output and set the manifest filename and path ending accordingly? Furthermore, are there any other Sentinel products that have differently ending paths and differently named manifest files and that should be handled accordingly? |
IMHO adding a couple of private methods for getting the "manifest" filename and the "product directory" name and using them consistently across the code would be the better solution. |
Querying the full detailed product metadata when calling the get_product_odata function allows us to get the product directory using the 'Filename' key: sentinelsat/sentinelsat/sentinel.py Line 512 in a25a640
Unfortunately there is no mention of the manifest filename, and I see no way to retrieve it even going through the raw scihub response. However, the issue could very easily be fixed by
if values['Filename'].endswith('.SAFE'):
values['Manifest name'] = 'manifest.safe'
elif values['Filename'].endswith('.SEN3'):
values['Manifest name'] = 'xfdumanifest.xml'
I tried this in my local anaconda environment and tested it with Sentinel-1, 2 and 3, and everything seems to work fine. |
PRs are always encouraged to fix bugs. For now there was no need to change the naming, since that was designed when communication by Copernicus was that all files will end in One consideration that I can see becoming an issue is the performance of the query. If I am understanding you correctly the proposal is to use If that is the case we might have to fork this earlier in the application logic to get a list of the |
Yes, I am running the fork locally and I'm not seeing any noticeable slowdown, but I understand that server-side one may want to limit the traffic as much as possible. It would be ideal if the folder path and manifest filename were to be passed along with the basic query, but the latter is not included even in the full version, and I have no idea were to look to try and approach this. |
@valpamp IMHO from the "title" you should be able to identify the sensor because Sentinel product have a fixed naming. The product name starts with S1 for Sentinel-1, S2 for Sentinel-2 and so on. |
If this is enough I can just check if the "title" field starts with 'S3' and set the paths accordingly. It will only work for Sentinel-3 products, but I don't think there are any others that need this treatment at the moment. |
Yeah, "data fomatting" in Sentinel products is a mess... and slow bureaucracy didn't help in getting things aligned. Technically there is a spec for "Sentinel-SAFE" which was a sort of extension (loosening in some case) of the "SAFE" packaging format which is why the groups working on Sentinel-3 opted for the
I worked on the Sentinel 3 processors (the software that makes the images), and when we were asked to review/comment on the spec, I pushed for for I guess I didn't shout loud enough, I will totally accept the blame for this one 🤣 All this to say that yes, the product name ( |
Hi,
I'm trying to download only enhanced_measurement.nc file from a SEN 3 SRAL product using node_filter but I'm getting error every time:
Unexpected nav segment Navigation Property: org.apache.olingo.odata2.core...
I think I'm not making my node_filter right so kindly help me make a node_filter for my case.
Thanks alot.
The text was updated successfully, but these errors were encountered: