Donwload earthdata with R script

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
Posts: 1
Joined: Mon Mar 28, 2022 3:53 pm America/New_York
Answers: 0

Donwload earthdata with R script

by vharvey » Mon Mar 28, 2022 3:55 pm America/New_York

Hi Is there an convient way to donwload Modis data using an R script? Here an example of teh faile I would liek to download: [/opendap/MODISA/L3SMI/2017/241/]

Thanks for your help.



OB.DAAC - amscott
User Services
User Services
Posts: 324
Joined: Mon Jun 22, 2020 5:24 pm America/New_York
Answers: 1
Has thanked: 7 times
Been thanked: 3 times

Re: Donwload earthdata with R script

by OB.DAAC - amscott » Thu Mar 31, 2022 7:54 pm America/New_York

Hi Val,

I don't know R, but we have a convenient python script on our site.

If you'd like help with your R script and you don't mind pasting or attaching the code, maybe the user community can be of assistance.

Posts: 10
Joined: Fri Jun 04, 2021 4:12 pm America/New_York
Answers: 0

Re: Donwload earthdata with R script

by imaginaryfish » Tue Apr 05, 2022 11:54 am America/New_York

Hi vharvey,
The following code will download the file you are interested in.

url <- ' [/opendap/MODISA/L3SMI/2017/241/]'

modis <- nc_open(url)
chl_ocx <- ncvar_get(modis, 'chl_ocx')
lonm <- ncvar_get(modis, 'lon')
latm <- ncvar_get(modis, 'lat')


Post Reply