Python data downloader

Hi all,

Using the sentinelsat python library, I made a very simple user interface to download Sentinel-1 and 2 data.

data_downloader.py (4.7 KB)

image

I use it a lot to update in 30 seconds my data directories once every moon.

It is far from perfect but quite serves its role, so I think it may be usefull for other people too.

To use it, just go in a terminal where the .py file is and write :

python3 data_downloader.py

Make sure dependencies are respected (sentinelsat and tkinter).

note : the geoJson file should not be too “complex”. The request is sent by creating a URL, containing the geometry of the geojson. The URL has limited length, meaning that a very precise geojson (hundred of points) cannot be used.

6 Likes

when i click on submit button i encountered the following error. what might be the reason ?

you have to change the location and the name of the geojson file according to your own one in line 104 of the script. The directories in the script are not valid on your computer and have to adjusted accordingly.

can i give any location of my choice for “GeoJSON location” and “Destination directory” ?

You can try and see what happens

Well I guess you can. For practical reasons, I put my most commonly used area of interest which is, in my case, /media/qg/Disk3/DATA_ARCHIVE_MIMO

If you want to change the default value, edit the line 104 of the code.

Note that the geoJson file should not be too “complex”. The request is sent by creating a URL, containing the geometry of the geojson. The URL which has limited length, meaning that a very precise geojson (hundred of points) cannot be used.

I have tried giving my own path for “GeoJSON location” and “Destination directory” as per your suggestion(A:\algo) but still it was showing some errors when i run the code.

I’m sorry to hear it doesn’t work as well for you. The error suggests you don’t have the right to access A:\algo
Maybe try using administrator rights?

Also, I’m not a Windows guy but a path beginning with the letter A sounds strange to me. Maybe I’m wrong but the absolute paths in Windows are C:\, D:\, E:\ and so forth, aren’t they?

You are right. A is not very common. It was used for floppy disks in the ancient times.
However, you can assign any letter to a hard drive. Maybe that’s what SaiKiran did.

Also, I would question the double backslash in the path. Maybe the path should be A:\algo and not A:\algo

what @marpet has said is correct. ‘A’ is just the name of the drive which I kept in my personal laptop. Though I changed the path to C drive it was showing the same errors :

Screenshot%20(124)

I would change it from
C:/
to
C:\
just to go sure.

Actually, I kept it like this only at the beginning

C:/

but the shell was showing some error with respect to that. so, later I changed that to

C:\

In the original code given by @qglaude the path is given in the same way

the code of @qglaude is linux syntax which mostly uses this slash / while Windows paths use the backslash \

often it doesn’t matter but C:/ looks quite wrong. As you see, there are no drive letters in his script.

The error with “scanning string literal” indicates that there is a special character somewhere in the green variables.

1 Like

Thank you very much, I was doing the same, I already had the code in python but it was only done by console and my intention was to make a GUI.

Thank you very much for the contribution.

1 Like

The “permission denied” really makes me wander if you have the rights to do it. Have you tried using administrator rights or something?

I haven’t tried any sort of administrators rights. I am using my own pc.

Is the script exploiting the 2 simultaneous download limitation? Or does it only download 1 file at a time?

One download at a time

Thanks for the info.

Using multithreading, I may be able to update the script to perform dual downloading. I will then post an update