Easiest way to get a a subset from MODIS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Easiest way to get a a subset from MODIS

Andy Bunn-3
Hi all, It's been years since I've used any MODIS data. Looking around I see there are many R packages that purport to interface nicely with MODIS servers and deliver you a subset of data.

I have an EarthData login and can (and have) download the tile I want via http://search.earthdata.nasa.gov but getting the hdf, converting to tif, clipping etc. is tedious and I'm wondering what the best way to do this in R is. So,  let's imagine I would like to get a class(raster) object of the "250m_16_days_NDVI" band from "MYD13Q1" product for a 10x10km area around the point c(68.75,161.42) for the period of nearest July 1, 2015. What package and approach is the easiest in R?

Is it something like this?

library(MODISTools)
dat2get <- data.frame(lat=68.75,long=161.42,
                      start.date=as.POSIXlt("2015-07-01"),
                      end.date=as.POSIXlt("2015-07-01"),
                      ID=1)

MODISSubsets(LoadDat = dat2get,
             Products = "MYD13Q1",
             Bands = "250m_16_days_NDVI",
             Size = c(10,10),
             StartDate = TRUE)

Regards, Andy



        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easiest way to get a a subset from MODIS

Andy Bunn-3
Answering my own question.

I was able to do what I wanted using the MODIS package. The runGdal function does what I want. Thanks to those who coded it!

-A

From: Andy Bunn <[hidden email]<mailto:[hidden email]>>
Date: Wednesday, May 24, 2017 at 12:22 PM
To: R-sig-Geo <[hidden email]<mailto:[hidden email]>>
Subject: Easiest way to get a a subset from MODIS

Hi all, It's been years since I've used any MODIS data. Looking around I see there are many R packages that purport to interface nicely with MODIS servers and deliver you a subset of data.

I have an EarthData login and can (and have) download the tile I want via http://search.earthdata.nasa.gov but getting the hdf, converting to tif, clipping etc. is tedious and I'm wondering what the best way to do this in R is. So,  let's imagine I would like to get a class(raster) object of the "250m_16_days_NDVI" band from "MYD13Q1" product for a 10x10km area around the point c(68.75,161.42) for the period of nearest July 1, 2015. What package and approach is the easiest in R?

Is it something like this?

library(MODISTools)
dat2get <- data.frame(lat=68.75,long=161.42,
                      start.date=as.POSIXlt("2015-07-01"),
                      end.date=as.POSIXlt("2015-07-01"),
                      ID=1)

MODISSubsets(LoadDat = dat2get,
             Products = "MYD13Q1",
             Bands = "250m_16_days_NDVI",
             Size = c(10,10),
             StartDate = TRUE)

Regards, Andy



        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Loading...