0

:D

I'm trying to download many files with OpenDap in R software but I have a problem ... Indeed, I want to download all files of GHRSST Level 4 MUR Global Foundation Sea Surface Temperature Analysis (v4.1)from 2002 to 2018 because I need to get the sea ice fraction.

But I just need these data on a specific grid so I would like to create a loop to download all files with some constraints of variables and latitude / longitude . In the order to do this, I have got the URL for (an example) the 2019 september 20th : https://podaac-opendap.jpl.nasa.gov:443/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/v4.1/2017/263/20170920090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc?time[0:1:0],lat[2000:1:4000],lon[18000:1:27000],sea_ice_fraction[0:1:0][2000:1:4000][18000:1:27000]

When I try download this URL directly by the R software (function download.file), I have the whole of this file, all variables on the whole of the Earth so it's a great problem because each file make 330 Mo ... and the file that I want make less 100 Mo ...

My function in R studio is : download.file("https://podaac-opendap.jpl.nasa.gov:443/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/v4.1/2017/263/20170920090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc?time[0:1:0],lat[2000:1:4000],lon[18000:1:27000],sea_ice_fraction[0:1:0][2000:1:4000][18000:1:27000]", "nc_20110910090000.nc.nc4",mode="wb") I hope you can assist me ...

Kind regards,

Alexandre Modi

  • Sorry but a part of my message has left! It's "Hello everyone" at the beginning of this message. – Alexandre MODI Feb 28 '19 at 11:12
  • then edit your message... :) – Oerd Feb 28 '19 at 11:17
  • 1
    Oh, sorry ... I don't know how this forum works ! The next time, I'll edit my message. Thank you – Alexandre MODI Feb 28 '19 at 11:23
  • I don't understand your question. You can only download files that exist. Does a file which contains exactly what you want actually exist? If not, your question is about extracting data from a file that you know how to download, in which case even talking about downloading is irrelevant. Please clarify. – John Coleman Feb 28 '19 at 11:29
  • Yes, initially, I have a file which include the data on the whole of the Earth. But with the OpenDAP in podaac, I can to subset the entire grid in a specific grid (to me is : between -70 / - 50 south and 0 and 90 east). This step is feasible by selecting variables and values that you desired on this adresse web : https://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/v4.1/2017/020/20170120090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc.html When we adjust variables and values, the constraints is added between hooks on the data URL. – Alexandre MODI Feb 28 '19 at 11:51
  • So, when I put this previous adress and the constraints, I get "https://podaac-opendap.jpl.nasa.gov:443/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/v4.1/2017/263/20170920090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc?time[0:1:0],lat[2000:1:4000],lon[18000:1:27000],sea_ice_fraction[0:1:0][2000:1:4000][18000:1:27000]. If I download the file with this adress on r studio, I get a file which include all the data and not only on my specific grid so the contraints are not taken into account ... Is it necessary to add an argument in r function? Thank's a lot for your answer – Alexandre MODI Feb 28 '19 at 11:57
  • I don't know why R seems to be using just part of the url. Perhaps this will help: https://lukemiller.org/index.php/2011/02/accessing-noaa-tide-data-with-r/ – John Coleman Feb 28 '19 at 12:06
  • Thank you M. Coleman, I will se this web site. I hope that the solution will be here. – Alexandre MODI Feb 28 '19 at 12:10

0 Answers0