1

I am exporting GEE files to my local machine through the geemap Python API using the following code:

# download 30m SRTM data
SRTM30 = ee.Image('USGS/SRTMGL1_003');
filename = os.path.join(OUTpath, 'DEM_'+domain+'.tif');
geemap.ee_export_image(SRTM30, filename=filename, scale=sm_resolution, region=my_domain, crs = epsg_code);

The geemap.ee_export_image function outputs the following user updates each time it exports an image:

enter image description here

I am exporting a large number of files so I am wondering if there is a way to suppress these user updates so my cron job confirmation email is not so long.

0

1 Answer 1

1

Not directly. You could submit a ticket asking for a verbose parameter to be added to the function.

As a workaround, you could redirect sys.stdout temporarily:

import contextlib
# etc...
with contextlib.redirect_stdout(None):
    geemap.ee_export_image(SRTM30, filename=filename, scale=sm_resolution, region=my_domain, crs = epsg_code)

Or if you are going to use geemap.ee_export_image more than once in your script, you could wrap it into a function

import contextlib
# etc...

def ee_export_image(*args, **kwargs):
    with contextlib.redirect_stdout(None):
        geemap.ee_export_image(*args, **kwargs)

# etc...

ee_export_image(SRTM30, filename=filename, scale=sm_resolution, region=my_domain, crs = epsg_code)
1
  • Thank you so much for your help! Commented Sep 14, 2021 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.