olivierhagolle / Sentinel-download

Automated download of Sentinel-2 L1C data from ESA (through wget) :http://olivierhagolle.github.io/Sentinel-download

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with password file

SnakeAkaPython opened this issue · comments

Hello Olivier,

when I am trying to run the following line in the command line I always receive "error with the password file". As a result the problem is between line 160 - 168. What I figured out ithat if I add a print statement <<(print ("error"))>> before the code <<f=file(options.apihub)>> line 161 and I run the following code in the command line <<Sentinel_download.py --lat 43.6 --lon 1.44 -a apihub>> I get in my screen the following:
image
However, if I add a print statement after the <<f=file(options.apihub)>>, it never appears on my screen. So, I believe the line <<f=file(options.apihub)>> does not work.

Any help would be much appreciated. Thank you!!

Regards,
Andronikos

Dear Andronikos
are you sure the apihub.txt exists and contains correctly your scihub ID and password ?
Best,
Olivier

Dear Olivier,

thank you for your fast response, I am 100% that my apihub.txt exists as you can see below:
image
and the first word is schihub ID and the second is my password. I have also used them to download image via sentinelsat and it worded perfectly. That is why I am confused becuase it looks like there is bug. Is it possible to assign the two variables in the script (account and password) within the script with the need of reading from the txt file?

As you can see below:
image
only the first and last error appears, while I am running the search query.

Furthermore, if I write the following code in the command line:
image
the apihub.txt file open, so it is in the same directory with the Sentinel_download.py script.
image

I do not know if I make it more clear to you, but its an issue that makes no sense.
Thank you in advance.

Regards,
Andronikos

Dear Andronikos,
sorry, I have been quite busy this week. Hope you managed to find a workaround.
Of course you may assign directly the account and password in the code.

Python is a well tested code so I can't see how there could be a bug in the "file" function.
Sorry, very difficult to help you from here
Best regards,
Olivier

Hi Adronikos!
Funny to see you here, how are you?
I think it has something to do with the difference in encoding of windows and unix like systems.
Can you send me your apihub.txt file? (please change your password for safety reasons before sending) you can use my wur or gmail address.

Gert

Dear Olivier and Gert,

What a coincidence to see me here Gert, I have send you the apihub file using the wur mail address.
Do not worry Olivier, I have managed to find a workaround by assigning directly the account and password in the code.
Everything wokrs fine but the part of the code with the start and the end date does not work.
In other words it looks like that only the else statement work.
image
For instance when I am searching using the below code:
--lat 50.668639 --lon 5.371120 -a apihub.txt -d 20160801 -f 20160831 --downloader aria2 -n
It returns me the all the images from 2015/11/30 until today.

Thank you in advance.

Regards,
Andronikos

Hi Andronikos and Gert
Strange, it works for me .

The command below retrieved the following products
./Sentinel_download.py --lat 50.668639 --lon 5.371120 -a apihub.txt -d 20160801 -f 20160831 -n

The only thing is that I don't know how to access to the acquisition date in the catalog request ( I know how to access the ingestion date), so I filter the date a posteriori. I am now having troubles because of the new limitation to 100 rows in the requests.

Best regards,
Olivier

=============================================
S2A_OPER_PRD_MSIL1C_PDMC_20160830T212808_R051_V20160829T105032_20160829T105541.SAFE
https://scihub.copernicus.eu/apihub/odata/v1/Products('50112409-f995-4175-ba05-889b30375ad5')/\$value
cloud percentage = 74.71 %
===============================================


===============================================
S2A_OPER_PRD_MSIL1C_PDMC_20160827T181148_R008_V20160826T104022_20160826T104023.SAFE
https://scihub.copernicus.eu/apihub/odata/v1/Products('fdd3535b-6740-4397-ade8-c53900cbab12')/\$value
cloud percentage =  1.13 %
===============================================

===============================================
S2A_OPER_PRD_MSIL1C_PDMC_20160819T234105_R051_V20160819T105032_20160819T105337.SAFE
https://scihub.copernicus.eu/apihub/odata/v1/Products('8735f55b-7853-489f-8864-b56cd742c933')/\$value
cloud percentage = 86.08 %
===============================================



===============================================
S2A_OPER_PRD_MSIL1C_PDMC_20160816T230746_R008_V20160816T104022_20160816T104025.SAFE
https://scihub.copernicus.eu/apihub/odata/v1/Products('6bb2d90d-86fe-451a-9e9c-82e46fd14520')/\$value
cloud percentage = 33.57 %
===============================================



===============================================
S2A_OPER_PRD_MSIL1C_PDMC_20160811T040836_R051_V20160809T105032_20160809T105030.SAFE
https://scihub.copernicus.eu/apihub/odata/v1/Products('97d04eeb-2435-4e82-96b6-f8d634602373')/\$value
cloud percentage = 24.73 %
===============================================


===============================================
S2A_OPER_PRD_MSIL1C_PDMC_20160811T035114_R008_V20160806T104032_20160806T104026.SAFE
https://scihub.copernicus.eu/apihub/odata/v1/Products('41ddac9f-c5ce-43aa-95a1-46b788b64322')/\$value
cloud percentage = 35.80 %
===============================================

I have implemented again possibility to make queries with constraints on ingestion date
python Sentinel_download.py --lat 43.6 --lon 1.44 -a apihub.txt -o 51 --id 2016-11-01 --if 2016-12-01

Hi Olivier,

thank you for your help. Actually I managed to solve the issue with the dates. The problem was that the tabs and spaces were messed up on that part of the code. Now it is working perfectly.

However, I observed another issue. The images that I have downloaded using the script there is missing one xml file in comparison with images that I have downloaded manually. The file that is missing you can find it if you go to : \S2A_OPER_PRD_MSIL1C_PDMC_20160926T222130_R008_V20160925T104022_20160925T104115.SAFE\DATASTRIP\S2A_OPER_MSI_L1C_DS_SGS__20160925T161027_S20160925T104115_N02.04\QI_DATA
In the folder QI_DATA you can find a geometric_quality_report file which does not exist in images downloaded through the script.

Have you got any idea why this is happening?
Thank you in advance.

Regards,
Andronikos

Hi Olivier and Gert,

I have another issue regarding the tile download.
When I run the following code:
image
It gave me the following error:
image

Have you got any idea why this is happening?
Any help would be much appreciated.
Thank you in advance.

Regards,
Andronikos

Hello,

I can confirm that I too had a similar issue with wrong password file. apihub.txt file existed and had the right credentials. Hard coding the username and password was needed.

@anuchandra
hello,
I have the same issue but i don't get where and how to modify the code?
Thank you in advance.

Hi @SugethaK

It might happen that the password has special characters which are changed when parsed.
Could you try simplifying your password with only alphanumerics a-z, A-Z, 0-9 ?
Best regards,
Olivier

Hello @olivier,
Thanks for your reply. I have only alphanumeric characters. I tried to modify the code but i'm getting the error:

IOError: [Errno 2] No such file or directory: 'query_results.xml