0

I need to get solar insolation data from different parts of the world. I have several latitude and longitude coordinates and I would like to get a mean solar insolation value across different years.

I found this data from NASA:

https://neo.sci.gsfc.nasa.gov/view.php?datasetId=CERES_INSOL_M

From that website you can download the GEOTiff files, but I couldn't find a way to download several files (say monthly) across different years to get a mean estimate.

Is there a way to do it? Or are there any other resources that I could use to get this data (preferably in R)?

2 Answers2

1

I tried to make a script that allow you download your data. Sadly seems NASA dont have a each file already generated but create them 'on-fly'. This can be assumed given the 'RenderData?' into url. Thats why we can't create a jpg or tif file before 'save as' command.

I made the follow:

## Set your dates    
myDates <- c('2000-11-11', '2002-11-11', '2004-11-11')


for(d in myDates){
  webDwnld <- readLines(paste0('https://neo.sci.gsfc.nasa.gov/view.php?datasetId=CERES_INSOL_M&date=', d))
  imgLines <- grep('<td><strong><a href="https\\:\\/\\/neo\\.sci\\.gsfc\\.nasa\\.gov\\/servlet\\/RenderData\\?si\\=', webDwnld, value = TRUE)[3]
  url0 <- strsplit(strsplit(imgLines, 'href=')[[1]][2], 'class=')[[1]][1]
  url1 <- gsub(' |"', '', url0)
  #url2 <- gsub('format=JPEG', 'format=TIFF', url1)
  #download.file(url2, destfile = paste0('C:/OneDrive/stackOverFlow/q5NASA/tif_.TIFF'))
  download.file(url1, destfile = paste0('C:/OneDrive/stackOverFlow/jpg_.jpg'))
  print(url1)
}

This will try to download a corrupt jpg (tif dont even save a image). Instead of that yo can get your url an make a manual process of saving your image.

If you want change parameters use the follow into the ´paste´:

  • CERES_INSOL_D : day
  • CERES_INSOL_E : week
  • CERES_INSOL_M : month

  • format=JPEG: jpeg (non-georreferenced)

  • format=TIFF: tiff (georreferenced)

  • width=360&height=180 ncol, nrow

  • width=720&height=360 ncol, nrow
  • width=1440&height=720 ncol, nrow
gonzalez.ivan90
  • 283
  • 3
  • 11
0

All of the GeoTIFF (and other formats) files in this dataset are available from the NEO FTP site: ftp://neoftp.sci.gsfc.nasa.gov/geotiff/CERES_INSOL_M/

Jacob F
  • 964
  • 4
  • 8