Download ASDC Data from DSCOVR/EPIC

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
carlosjimenez
Posts: 2
Joined: Tue Jan 11, 2022 3:10 pm America/New_York
Answers: 0

Download ASDC Data from DSCOVR/EPIC

by carlosjimenez » Tue Jan 11, 2022 3:14 pm America/New_York

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)

Filters:

ASDC - ingridgs
User Services
User Services
Posts: 176
Joined: Fri Apr 23, 2021 9:14 am America/New_York
Answers: 1
Has thanked: 18 times
Been thanked: 7 times

Re: Download ASDC Data from DSCOVR/EPIC

by ASDC - ingridgs » Wed Jan 12, 2022 11:14 am America/New_York

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,

Post Reply