Hi,
I am downloading SWOT data using the API in Python.
I want to suppress all of the update information, and I was only partially successful with my code below.
Specically, I am still repeatedly getting "Loading widget..." as an output. I think this happens each time it downloads a dataset.
Thank you,
Fritz Policelli
NASA, GSFC
with contextlib.redirect_stdout(output_buffer), contextlib.redirect_stderr(output_buffer):
results = earthaccess.search_data(short_name = 'SWOT_L2_HR_RiverSP_2.0', bounding_box=
(x_min,y_min,x_max,y_max))
directory = 'reach_id_' + str(reach_id) + 'SWOT_data'
if not os.path.exists(directory):
os.makedirs(directory)
for result in results:
with contextlib.redirect_stdout(output_buffer), contextlib.redirect_stderr(output_buffer):
earthaccess.download([result], directory)
I found another command to suppress the output. You can ignore this.
Suppressing Output During Download with API
-
- User Services
- Posts: 2
- Joined: Fri Jul 07, 2023 12:49 pm America/New_York