Error downloading CyAN data through R httr::GET
-
- Posts: 4
- Joined: Tue Apr 25, 2023 6:32 pm America/New_York
Error downloading CyAN data through R httr::GET
I am attempting to download CyAN data through R, following guidance posted here: https://wiki.earthdata.nasa.gov/display/EL/How+to+access+data+with+R.
The URL for the file I'm requesting is https://oceandata.sci.gsfc.nasa.gov/ob/getfile/L2022001.L3m_DAY_CYAN_CI_cyano_CYAN_CONUS_300m_1_1.tif. In R, I can run the following code with no error in R itself. However, the file it downloads is not the expected GeoTIFF, but instead a HTML that reads: ".:. ERROR .:. Ocean Biology Distributed Active Archive Center (OB.DAAC)
We are sorry, but an error has occurred. Please use the back button to return to the previous page".
R code (with "APPKEY" inserted instead of my actual application key):
set_config(config(followlocation=1,netrc=1,netrc_file=netrc_path,cookie=cookie_path,cookiefile=cookie_path,cookiejar=cookie_path))
httr::GET(url = 'https://oceandata.sci.gsfc.nasa.gov/ob/getfile/L2022001.L3m_DAY_CYAN_CI_cyano_CYAN_CONUS_300m_1_1.tif?appkey=[APPKEY]',
write_disk("C:/Users/Megan.Coffer/Downloads/test.tif", overwrite = TRUE))
Any guidance on what might be causing this error? I saw one other forum post with the same error, but the fix was a different URL which I don't know how to generate for this specific data.
The URL for the file I'm requesting is https://oceandata.sci.gsfc.nasa.gov/ob/getfile/L2022001.L3m_DAY_CYAN_CI_cyano_CYAN_CONUS_300m_1_1.tif. In R, I can run the following code with no error in R itself. However, the file it downloads is not the expected GeoTIFF, but instead a HTML that reads: ".:. ERROR .:. Ocean Biology Distributed Active Archive Center (OB.DAAC)
We are sorry, but an error has occurred. Please use the back button to return to the previous page".
R code (with "APPKEY" inserted instead of my actual application key):
set_config(config(followlocation=1,netrc=1,netrc_file=netrc_path,cookie=cookie_path,cookiefile=cookie_path,cookiejar=cookie_path))
httr::GET(url = 'https://oceandata.sci.gsfc.nasa.gov/ob/getfile/L2022001.L3m_DAY_CYAN_CI_cyano_CYAN_CONUS_300m_1_1.tif?appkey=[APPKEY]',
write_disk("C:/Users/Megan.Coffer/Downloads/test.tif", overwrite = TRUE))
Any guidance on what might be causing this error? I saw one other forum post with the same error, but the fix was a different URL which I don't know how to generate for this specific data.
Filters:
-
- Subject Matter Expert
- Posts: 109
- Joined: Fri Jun 03, 2022 10:54 am America/New_York
- Location: NASA GSFC
- Been thanked: 8 times
- Contact:
Re: Error downloading CyAN data through R httr::GET
Hello,
We recently fixed a data access issue. Please try again and let us know if the problem persists.
We recently fixed a data access issue. Please try again and let us know if the problem persists.
-
- Posts: 4
- Joined: Tue Apr 25, 2023 6:32 pm America/New_York