Hello there, I have been trying to write a script that can download single files from this folder `https://asdc.larc.nasa.gov/data/DSCOVR/ ... 3/2015/06/`. I have been using a script I found in one of the questions. Below is the code I have been using:
from getpass import getpass
from pathlib import Path
from requests import Session
import netCDF4 as nc
username = "omitting this part"
password = "omitting this part"
# Replace this URL with the URL you want to download
url = "https://asdc.larc.nasa.gov/data/DSCOVR/ ... 3/2015/06/"
# This code downloads the file to your current working directory (where you ran python from)
file_name = Path(url).name
session = Session()
_redirect = session.get(url)
_response = session.get(_redirect.url, auth=(username, password))
with open(file_name, 'wb') as file:
file.write(_response._content)
# print(_response._content)
Download ASDC Data from DSCOVR/EPIC
-
- Posts: 2
- Joined: Tue Jan 11, 2022 3:10 pm America/New_York
-
- Posts: 196
- Joined: Fri Apr 23, 2021 9:14 am America/New_York
- Has thanked: 25 times
- Been thanked: 7 times
Re: Download ASDC Data from DSCOVR/EPIC
Hello Carlos,
Thank you for reaching the Forum.
Is there a specific question you had regarding the python code?
If you are trying to download one single file, you can also just click on the link of the file, and will directly download it into your machine. Or you can also use the Earthdata Search link to choose your granules.
https://asdc.larc.nasa.gov/project/DSCO ... 2_CLOUD_03
Please let us know,
Thank you for reaching the Forum.
Is there a specific question you had regarding the python code?
If you are trying to download one single file, you can also just click on the link of the file, and will directly download it into your machine. Or you can also use the Earthdata Search link to choose your granules.
https://asdc.larc.nasa.gov/project/DSCO ... 2_CLOUD_03
Please let us know,