Re: [R] MODISTools Help

2017-06-23 Thread Caroline
In case anyone else experiences the same error: 

The package creators responded and the issue was that I was using time frames 
between 14-30 days. EVI and NDVI are only calculated every 16 days so using 
that time span entailed that there was only one pixel per observation. I 
expanded my timeframe to 32 days and my analysis now works. 

I.E. changed: 

firstobs$start.date <- firstobs[,2] - as.difftime(14, unit='days') ###time 
frame now spands two weeks 

To 

firstobs$start.date <- firstobs[,2] - as.difftime(32, unit='days') ###time 
frame now stands 32 days 

Where first obs is the data set that contains the date that the data was 
collected, latitude, and longitude of collection site from one observation. I 
used the date the data was collected as the end date and transformed the date 
the data was collected to 32 days prior as the start date. 

firstobs before transformation: 

 idstart.date  end.date   latlong 
B1-1108  28-Nov-08 28-Nov-08 -25.07324 31.936 

firstobs after transformation 

 id  start.date end.date   lat  long 
B1-1108 2008-10-27 2008-11-28 -25.07324 31.936 
> On Jun 23, 2017, at 8:49 AM, Robert Baer  wrote:
> 
> 
> 
> On 6/22/2017 7:05 PM, Caroline wrote:
>> ##MODISTools example
>> library(MODISTools)
>> library(lubridate)
>> setwd('~/Documents/Modis data')
>> 
>> #MODISTools with buffalo data
>> 
>> ###Read in data rename for easier coding
>> tbdata <- read.csv('~/Desktop/All TB data for EVI, NDVI.csv')
> Since this dataset is only on your desktop it cannot help us reproduce your 
> error.  Can you supply a small dataset that cause the
> error you are talking about?
> 
> One way to do this is to use supply the results of
> dput(tbdata)
> if it is small enough.  If not, maybe create a subset of the data and then 
> use dput()
> 
> Did you get the problem when you tried with the tutorial Bert suggested?
>> firstobs <- subset(tbdata, capture.ID == 'B1-1108')
>> firstobs <- firstobs[,c(1,2,2,3,4)]
>> colnames(firstobs) <- c('id', 'start.date','end.date','lat','long')
>> 
>> ###change date format and change start date to previous 14 days
>> firstobs$start.date <- dmy(firstobs$start.date)
>> firstobs$end.date <- dmy(firstobs$end.date)
>> firstobs$start.date <- firstobs[,2] - as.difftime(14, unit='days') ###time 
>> frame now spands two weeks
>> 
>> ###define parameters
>> product <- "MOD13Q1"
>> bands <- c('250m_16_days_EVI', '250m_16_days_NDVI', 
>> '250m_16_days_VI_Quality')
>> pixel <- c(0,0)
>> 
>> ###define data
>> period <- data.frame(lat=firstobs$lat, long=firstobs$long, start.date 
>> =firstobs$start.date, end.date = firstobs$end.date, id=firstobs$id)
>> 
>> 
>> ###MODISSubsets
>> MODISSubsets(LoadDat = period, Products = product, Bands=bands, Size=pixel, 
>> SaveDir='.', StartDate=T)
>> 
>> 
>> ###MODISSummaries
>> MODISSummaries(LoadDat = period, FileSep=',',Product='MOD13Q1', Bands = 
>> '250m_16_days_EVI', ValidRange=c(-2000,1), NoDataFill=-3000, ScaleFactor 
>> = 0.0001, StartDate = TRUE, Interpolate = T, QualityScreen = TRUE, 
>> QualityThreshold = 0, QualityBand = '250m_16_days_VI_Quality')
>> 
>> 
>>> On Jun 22, 2017, at 4:50 PM, Bert Gunter  wrote:
>>> 
>>> 1. You should always cc the list unless there is a clear reason not to.
>>> 
>>> 2. You still have failed to follow the posting guide: You say you have
>>> difficulty troubleshooting your code, but you have shown us no code.
>>> You got an error message that seems explicit, but with neither code
>>> nor data, I do not know whether anyone can make sense of it. In any
>>> case, I certainly cannot.
>>> 
>>> 
>>> Cheers,
>>> Bert
>>> 
>>> 
>>> Bert Gunter
>>> 
>>> "The trouble with having an open mind is that people keep coming along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>> 
>>> 
>>> On Thu, Jun 22, 2017 at 4:41 PM, Caroline
>>>  wrote:
 Hi Bert,
 
 I have spent a lot of time searching the web for my error message and have 
 gone through multiple tutorials. I have not found anything relevant to my 
 error message which is why I posted on R-help.
 
 Caroline
 
> On Jun 22, 2017, at 4:38 PM, Bert Gunter  wrote:
> 
> This is a specialized package that fairly few of us are likely to have
> familiarity with, especialy when you have not followed the posting
> guide (below) and posted code and a reproducible example.
> 
> That said, a web search on R MODIS appeared to bring up relevant hits,
> including a MODIS tutorial. Have you tried that?
> 
> Cheers,
> Bert
> 
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Thu, Jun 22, 2017 at 2:12 PM, Caroline
>  wrote:
>> I am using MODIS Tools and am having a lot of difficulty troubleshoot

Re: [R] MODISTools Help

2017-06-23 Thread Robert Baer



On 6/22/2017 7:05 PM, Caroline wrote:

##MODISTools example
library(MODISTools)
library(lubridate)
setwd('~/Documents/Modis data')

#MODISTools with buffalo data

###Read in data rename for easier coding
tbdata <- read.csv('~/Desktop/All TB data for EVI, NDVI.csv')
Since this dataset is only on your desktop it cannot help us reproduce 
your error.  Can you supply a small dataset that cause the

error you are talking about?

One way to do this is to use supply the results of
dput(tbdata)
if it is small enough.  If not, maybe create a subset of the data and 
then use dput()


Did you get the problem when you tried with the tutorial Bert suggested?

firstobs <- subset(tbdata, capture.ID == 'B1-1108')
firstobs <- firstobs[,c(1,2,2,3,4)]
colnames(firstobs) <- c('id', 'start.date','end.date','lat','long')

###change date format and change start date to previous 14 days
firstobs$start.date <- dmy(firstobs$start.date)
firstobs$end.date <- dmy(firstobs$end.date)
firstobs$start.date <- firstobs[,2] - as.difftime(14, unit='days') ###time 
frame now spands two weeks

###define parameters
product <- "MOD13Q1"
bands <- c('250m_16_days_EVI', '250m_16_days_NDVI', '250m_16_days_VI_Quality')
pixel <- c(0,0)

###define data
period <- data.frame(lat=firstobs$lat, long=firstobs$long, start.date 
=firstobs$start.date, end.date = firstobs$end.date, id=firstobs$id)


###MODISSubsets
MODISSubsets(LoadDat = period, Products = product, Bands=bands, Size=pixel, 
SaveDir='.', StartDate=T)


###MODISSummaries
MODISSummaries(LoadDat = period, FileSep=',',Product='MOD13Q1', Bands = 
'250m_16_days_EVI', ValidRange=c(-2000,1), NoDataFill=-3000, ScaleFactor = 
0.0001, StartDate = TRUE, Interpolate = T, QualityScreen = TRUE, 
QualityThreshold = 0, QualityBand = '250m_16_days_VI_Quality')



On Jun 22, 2017, at 4:50 PM, Bert Gunter  wrote:

1. You should always cc the list unless there is a clear reason not to.

2. You still have failed to follow the posting guide: You say you have
difficulty troubleshooting your code, but you have shown us no code.
You got an error message that seems explicit, but with neither code
nor data, I do not know whether anyone can make sense of it. In any
case, I certainly cannot.


Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jun 22, 2017 at 4:41 PM, Caroline
 wrote:

Hi Bert,

I have spent a lot of time searching the web for my error message and have gone 
through multiple tutorials. I have not found anything relevant to my error 
message which is why I posted on R-help.

Caroline


On Jun 22, 2017, at 4:38 PM, Bert Gunter  wrote:

This is a specialized package that fairly few of us are likely to have
familiarity with, especialy when you have not followed the posting
guide (below) and posted code and a reproducible example.

That said, a web search on R MODIS appeared to bring up relevant hits,
including a MODIS tutorial. Have you tried that?

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jun 22, 2017 at 2:12 PM, Caroline
 wrote:

I am using MODIS Tools and am having a lot of difficulty troubleshooting my 
code.

I am a PhD student studying African buffalo in Kruger National Park, South 
Africa. The study I am currently working on involves a herd of 200 African 
buffalo caught every six months for 4 years. I am trying to use EVI and NDVI to 
assess seasonal variation thus I would like mean EVI and NDVI for each 
observation (each time each buffalo was captured). I have capture date, lat and 
long for each observation.

However, when using ‘250m_16_days_pixel_reliability’ as my quality control band 
I keep getting the warning message:

Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = "MOD13Q1", 
 :
Only single data point that passed the quality screen: cannot summarise

When using ‘250m_16_days_VI_Quality’ as my quality control band I keep getting 
the warning message:

Error in QualityCheck(Data = band.time.series, QualityScores = QA.time.series,  
:
QualityScores not all in range of MOD13Q1's QC: 0-3

I seem to get this message with all subsets of my data (I have tried running 
all of my data at once and then just one data point at a time). I have also 
tried using wider date ranges as well as wider size ranges (in case the pixel 
reliability is poor within a certain area or time frame) but still get the same 
messages.
   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



Re: [R] MODISTools help - with reproducible examples

2017-06-23 Thread Caroline
In case anyone else experiences the same error:

The package creators responded and the issue was that I was using time frames 
between 14-30 days. EVI and NDVI are only calculated every 16 days so using 
that time span entailed that there was only one pixel per observation. I 
expanded my timeframe to 32 days and my analysis now works. 

I.E. changed:

firstobs$start.date <- firstobs[,2] - as.difftime(14, unit='days') ###time 
frame now spands two weeks

To

firstobs$start.date <- firstobs[,2] - as.difftime(32, unit='days') ###time 
frame now stands 32 days

Where first obs is the data set that contains the date that the data was 
collected, latitude, and longitude of collection site from one observation. I 
used the date the data was collected as the end date and transformed the date 
the data was collected to 32 days prior as the start date. 

firstobs before transformation:

 id start.date  end.date   lat   long
2 B1-1108  28-Nov-08 28-Nov-08 -25.07324 31.936

firstobs after transformation

 id start.date   end.date   lat   long
2 B1-1108 2008-10-27 2008-11-28 -25.07324 31.936

The key point is that the time frame used for analysis should be greater than 
or equal to 32 days. 

> On Jun 23, 2017, at 7:37 AM, Jeff Newmiller  wrote:
> 
> Please read up [1][2][3] on what constitutes reproducibility.  A sample of 
> data that triggers the problem is essential. 
> 
> [1] 
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
> 
> [2] http://adv-r.had.co.nz/Reproducibility.html
> 
> [3] https://cran.r-project.org/web/packages/reprex/index.html
> -- 
> Sent from my phone. Please excuse my brevity.
> 
> On June 23, 2017 6:54:48 AM PDT, Caroline  
> wrote:
>> I have and they have not yet replied - however that was only two or
>> three days ago. 
>> 
>> I have included a code example. 
>>> On Jun 22, 2017, at 8:25 PM, David Winsemius 
>> wrote:
>>> 
 
 On Jun 22, 2017, at 4:44 PM, Caroline
>>  wrote:
 
 I am using the R-package MODISTools (different than MODIS) and am
>> having a lot of difficulty troubleshooting my code. I have spent awhile
>> going through MODISTools tutorials, searching for my error code,
>> looking at the source code. However, I have not been able to find any
>> relevant information related to my error message. 
 
 The study I am currently working on involves a herd of 200 African
>> buffalo caught every six months for 4 years. I am trying to use EVI and
>> NDVI to assess seasonal variation thus I would like mean EVI and NDVI
>> for each observation (each time each buffalo was captured). I have
>> capture date, lat and long for each observation. 
 
 However, when using ‘250m_16_days_pixel_reliability’ as my quality
>> control band I keep getting the warning message:
 
 Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product =
>> "MOD13Q1",  :
 Only single data point that passed the quality screen: cannot
>> summarise
 
 When using ‘250m_16_days_VI_Quality’ as my quality control band I
>> keep getting the warning message: 
 
 Error in QualityCheck(Data = band.time.series, QualityScores =
>> QA.time.series,  : 
 QualityScores not all in range of MOD13Q1's QC: 0-3
 
 I seem to get this message with all subsets of my data (I have tried
>> running all of my data at once and then just one data point at a time).
>> I have also tried using wider date ranges as well as wider size ranges
>> (in case the pixel reliability is poor within a certain area or time
>> frame) but still get the same messages. 
 
 I have attached the data file I have been using as well as my code
>> (subsetted to just one animal so the run time is faster) 
 
 Has anyone seen this error message before/have any suggestions for
>> why I may be getting these errors?
>>> 
>>> I don't and you have not provided the accepted means to investigate
>> which would be code and data . Have you contacted the package
>> maintainer?
>>> 
>>> -- 
>>> 
>>> David Winsemius
>>> Alameda, CA, USA
>> 
>> 
>>  [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] MODISTools help - with reproducible examples

2017-06-23 Thread Jeff Newmiller
Please read up [1][2][3] on what constitutes reproducibility.  A sample of data 
that triggers the problem is essential. 

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html
-- 
Sent from my phone. Please excuse my brevity.

On June 23, 2017 6:54:48 AM PDT, Caroline  
wrote:
>I have and they have not yet replied - however that was only two or
>three days ago. 
>
>I have included a code example. 
>> On Jun 22, 2017, at 8:25 PM, David Winsemius 
>wrote:
>> 
>>> 
>>> On Jun 22, 2017, at 4:44 PM, Caroline
> wrote:
>>> 
>>> I am using the R-package MODISTools (different than MODIS) and am
>having a lot of difficulty troubleshooting my code. I have spent awhile
>going through MODISTools tutorials, searching for my error code,
>looking at the source code. However, I have not been able to find any
>relevant information related to my error message. 
>>> 
>>> The study I am currently working on involves a herd of 200 African
>buffalo caught every six months for 4 years. I am trying to use EVI and
>NDVI to assess seasonal variation thus I would like mean EVI and NDVI
>for each observation (each time each buffalo was captured). I have
>capture date, lat and long for each observation. 
>>> 
>>> However, when using ‘250m_16_days_pixel_reliability’ as my quality
>control band I keep getting the warning message:
>>> 
>>> Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product =
>"MOD13Q1",  :
>>> Only single data point that passed the quality screen: cannot
>summarise
>>> 
>>> When using ‘250m_16_days_VI_Quality’ as my quality control band I
>keep getting the warning message: 
>>> 
>>> Error in QualityCheck(Data = band.time.series, QualityScores =
>QA.time.series,  : 
>>> QualityScores not all in range of MOD13Q1's QC: 0-3
>>> 
>>> I seem to get this message with all subsets of my data (I have tried
>running all of my data at once and then just one data point at a time).
>I have also tried using wider date ranges as well as wider size ranges
>(in case the pixel reliability is poor within a certain area or time
>frame) but still get the same messages. 
>>> 
>>> I have attached the data file I have been using as well as my code
>(subsetted to just one animal so the run time is faster) 
>>> 
>>> Has anyone seen this error message before/have any suggestions for
>why I may be getting these errors?
>> 
>> I don't and you have not provided the accepted means to investigate
>which would be code and data . Have you contacted the package
>maintainer?
>> 
>> -- 
>> 
>> David Winsemius
>> Alameda, CA, USA
>
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] MODISTools help - with reproducible examples

2017-06-23 Thread Caroline
I have and they have not yet replied - however that was only two or three days 
ago. 

I have included a code example. 
> On Jun 22, 2017, at 8:25 PM, David Winsemius  wrote:
> 
>> 
>> On Jun 22, 2017, at 4:44 PM, Caroline  
>> wrote:
>> 
>> I am using the R-package MODISTools (different than MODIS) and am having a 
>> lot of difficulty troubleshooting my code. I have spent awhile going through 
>> MODISTools tutorials, searching for my error code, looking at the source 
>> code. However, I have not been able to find any relevant information related 
>> to my error message. 
>> 
>> The study I am currently working on involves a herd of 200 African buffalo 
>> caught every six months for 4 years. I am trying to use EVI and NDVI to 
>> assess seasonal variation thus I would like mean EVI and NDVI for each 
>> observation (each time each buffalo was captured). I have capture date, lat 
>> and long for each observation. 
>> 
>> However, when using ‘250m_16_days_pixel_reliability’ as my quality control 
>> band I keep getting the warning message:
>> 
>> Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = 
>> "MOD13Q1",  :
>> Only single data point that passed the quality screen: cannot summarise
>> 
>> When using ‘250m_16_days_VI_Quality’ as my quality control band I keep 
>> getting the warning message: 
>> 
>> Error in QualityCheck(Data = band.time.series, QualityScores = 
>> QA.time.series,  : 
>> QualityScores not all in range of MOD13Q1's QC: 0-3
>> 
>> I seem to get this message with all subsets of my data (I have tried running 
>> all of my data at once and then just one data point at a time). I have also 
>> tried using wider date ranges as well as wider size ranges (in case the 
>> pixel reliability is poor within a certain area or time frame) but still get 
>> the same messages. 
>> 
>> I have attached the data file I have been using as well as my code 
>> (subsetted to just one animal so the run time is faster) 
>> 
>> Has anyone seen this error message before/have any suggestions for why I may 
>> be getting these errors?
> 
> I don't and you have not provided the accepted means to investigate which 
> would be code and data . Have you contacted the package maintainer?
> 
> -- 
> 
> David Winsemius
> Alameda, CA, USA


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] MODISTools help - with reproducible examples

2017-06-22 Thread David Winsemius

> On Jun 22, 2017, at 4:44 PM, Caroline  
> wrote:
> 
> I am using the R-package MODISTools (different than MODIS) and am having a 
> lot of difficulty troubleshooting my code. I have spent awhile going through 
> MODISTools tutorials, searching for my error code, looking at the source 
> code. However, I have not been able to find any relevant information related 
> to my error message. 
> 
> The study I am currently working on involves a herd of 200 African buffalo 
> caught every six months for 4 years. I am trying to use EVI and NDVI to 
> assess seasonal variation thus I would like mean EVI and NDVI for each 
> observation (each time each buffalo was captured). I have capture date, lat 
> and long for each observation. 
> 
> However, when using ‘250m_16_days_pixel_reliability’ as my quality control 
> band I keep getting the warning message:
> 
> Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = 
> "MOD13Q1",  :
>  Only single data point that passed the quality screen: cannot summarise
> 
> When using ‘250m_16_days_VI_Quality’ as my quality control band I keep 
> getting the warning message: 
> 
> Error in QualityCheck(Data = band.time.series, QualityScores = 
> QA.time.series,  : 
>  QualityScores not all in range of MOD13Q1's QC: 0-3
> 
> I seem to get this message with all subsets of my data (I have tried running 
> all of my data at once and then just one data point at a time). I have also 
> tried using wider date ranges as well as wider size ranges (in case the pixel 
> reliability is poor within a certain area or time frame) but still get the 
> same messages. 
> 
> I have attached the data file I have been using as well as my code (subsetted 
> to just one animal so the run time is faster) 
> 
> Has anyone seen this error message before/have any suggestions for why I may 
> be getting these errors?

I don't and you have not provided the accepted means to investigate which would 
be code and data . Have you contacted the package maintainer?

-- 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] MODISTools help - with reproducible examples

2017-06-22 Thread Caroline
I am using the R-package MODISTools (different than MODIS) and am having a lot 
of difficulty troubleshooting my code. I have spent awhile going through 
MODISTools tutorials, searching for my error code, looking at the source code. 
However, I have not been able to find any relevant information related to my 
error message. 

The study I am currently working on involves a herd of 200 African buffalo 
caught every six months for 4 years. I am trying to use EVI and NDVI to assess 
seasonal variation thus I would like mean EVI and NDVI for each observation 
(each time each buffalo was captured). I have capture date, lat and long for 
each observation. 

However, when using ‘250m_16_days_pixel_reliability’ as my quality control band 
I keep getting the warning message:

Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = "MOD13Q1", 
 :
  Only single data point that passed the quality screen: cannot summarise

When using ‘250m_16_days_VI_Quality’ as my quality control band I keep getting 
the warning message: 

Error in QualityCheck(Data = band.time.series, QualityScores = QA.time.series,  
: 
  QualityScores not all in range of MOD13Q1's QC: 0-3

I seem to get this message with all subsets of my data (I have tried running 
all of my data at once and then just one data point at a time). I have also 
tried using wider date ranges as well as wider size ranges (in case the pixel 
reliability is poor within a certain area or time frame) but still get the same 
messages. 

I have attached the data file I have been using as well as my code (subsetted 
to just one animal so the run time is faster) 

Has anyone seen this error message before/have any suggestions for why I may be 
getting these errors?


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] MODISTools Help

2017-06-22 Thread Caroline
##MODISTools example
library(MODISTools)
library(lubridate)
setwd('~/Documents/Modis data')

#MODISTools with buffalo data

###Read in data rename for easier coding
tbdata <- read.csv('~/Desktop/All TB data for EVI, NDVI.csv')
firstobs <- subset(tbdata, capture.ID == 'B1-1108')
firstobs <- firstobs[,c(1,2,2,3,4)]
colnames(firstobs) <- c('id', 'start.date','end.date','lat','long')

###change date format and change start date to previous 14 days
firstobs$start.date <- dmy(firstobs$start.date)
firstobs$end.date <- dmy(firstobs$end.date)
firstobs$start.date <- firstobs[,2] - as.difftime(14, unit='days') ###time 
frame now spands two weeks

###define parameters 
product <- "MOD13Q1"
bands <- c('250m_16_days_EVI', '250m_16_days_NDVI', '250m_16_days_VI_Quality')
pixel <- c(0,0)

###define data
period <- data.frame(lat=firstobs$lat, long=firstobs$long, start.date 
=firstobs$start.date, end.date = firstobs$end.date, id=firstobs$id)


###MODISSubsets
MODISSubsets(LoadDat = period, Products = product, Bands=bands, Size=pixel, 
SaveDir='.', StartDate=T)


###MODISSummaries
MODISSummaries(LoadDat = period, FileSep=',',Product='MOD13Q1', Bands = 
'250m_16_days_EVI', ValidRange=c(-2000,1), NoDataFill=-3000, ScaleFactor = 
0.0001, StartDate = TRUE, Interpolate = T, QualityScreen = TRUE, 
QualityThreshold = 0, QualityBand = '250m_16_days_VI_Quality')


> On Jun 22, 2017, at 4:50 PM, Bert Gunter  wrote:
> 
> 1. You should always cc the list unless there is a clear reason not to.
> 
> 2. You still have failed to follow the posting guide: You say you have
> difficulty troubleshooting your code, but you have shown us no code.
> You got an error message that seems explicit, but with neither code
> nor data, I do not know whether anyone can make sense of it. In any
> case, I certainly cannot.
> 
> 
> Cheers,
> Bert
> 
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Thu, Jun 22, 2017 at 4:41 PM, Caroline
>  wrote:
>> Hi Bert,
>> 
>> I have spent a lot of time searching the web for my error message and have 
>> gone through multiple tutorials. I have not found anything relevant to my 
>> error message which is why I posted on R-help.
>> 
>> Caroline
>> 
>>> On Jun 22, 2017, at 4:38 PM, Bert Gunter  wrote:
>>> 
>>> This is a specialized package that fairly few of us are likely to have
>>> familiarity with, especialy when you have not followed the posting
>>> guide (below) and posted code and a reproducible example.
>>> 
>>> That said, a web search on R MODIS appeared to bring up relevant hits,
>>> including a MODIS tutorial. Have you tried that?
>>> 
>>> Cheers,
>>> Bert
>>> 
>>> 
>>> Bert Gunter
>>> 
>>> "The trouble with having an open mind is that people keep coming along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>> 
>>> 
>>> On Thu, Jun 22, 2017 at 2:12 PM, Caroline
>>>  wrote:
 I am using MODIS Tools and am having a lot of difficulty troubleshooting 
 my code.
 
 I am a PhD student studying African buffalo in Kruger National Park, South 
 Africa. The study I am currently working on involves a herd of 200 African 
 buffalo caught every six months for 4 years. I am trying to use EVI and 
 NDVI to assess seasonal variation thus I would like mean EVI and NDVI for 
 each observation (each time each buffalo was captured). I have capture 
 date, lat and long for each observation.
 
 However, when using ‘250m_16_days_pixel_reliability’ as my quality control 
 band I keep getting the warning message:
 
 Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = 
 "MOD13Q1",  :
 Only single data point that passed the quality screen: cannot summarise
 
 When using ‘250m_16_days_VI_Quality’ as my quality control band I keep 
 getting the warning message:
 
 Error in QualityCheck(Data = band.time.series, QualityScores = 
 QA.time.series,  :
 QualityScores not all in range of MOD13Q1's QC: 0-3
 
 I seem to get this message with all subsets of my data (I have tried 
 running all of my data at once and then just one data point at a time). I 
 have also tried using wider date ranges as well as wider size ranges (in 
 case the pixel reliability is poor within a certain area or time frame) 
 but still get the same messages.
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
>> 


[[alternative HTML version deleted]]

___

Re: [R] MODISTools Help

2017-06-22 Thread Bert Gunter
1. You should always cc the list unless there is a clear reason not to.

2. You still have failed to follow the posting guide: You say you have
difficulty troubleshooting your code, but you have shown us no code.
You got an error message that seems explicit, but with neither code
nor data, I do not know whether anyone can make sense of it. In any
case, I certainly cannot.


Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jun 22, 2017 at 4:41 PM, Caroline
 wrote:
> Hi Bert,
>
> I have spent a lot of time searching the web for my error message and have 
> gone through multiple tutorials. I have not found anything relevant to my 
> error message which is why I posted on R-help.
>
> Caroline
>
>> On Jun 22, 2017, at 4:38 PM, Bert Gunter  wrote:
>>
>> This is a specialized package that fairly few of us are likely to have
>> familiarity with, especialy when you have not followed the posting
>> guide (below) and posted code and a reproducible example.
>>
>> That said, a web search on R MODIS appeared to bring up relevant hits,
>> including a MODIS tutorial. Have you tried that?
>>
>> Cheers,
>> Bert
>>
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>> On Thu, Jun 22, 2017 at 2:12 PM, Caroline
>>  wrote:
>>> I am using MODIS Tools and am having a lot of difficulty troubleshooting my 
>>> code.
>>>
>>> I am a PhD student studying African buffalo in Kruger National Park, South 
>>> Africa. The study I am currently working on involves a herd of 200 African 
>>> buffalo caught every six months for 4 years. I am trying to use EVI and 
>>> NDVI to assess seasonal variation thus I would like mean EVI and NDVI for 
>>> each observation (each time each buffalo was captured). I have capture 
>>> date, lat and long for each observation.
>>>
>>> However, when using ‘250m_16_days_pixel_reliability’ as my quality control 
>>> band I keep getting the warning message:
>>>
>>> Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = 
>>> "MOD13Q1",  :
>>>  Only single data point that passed the quality screen: cannot summarise
>>>
>>> When using ‘250m_16_days_VI_Quality’ as my quality control band I keep 
>>> getting the warning message:
>>>
>>> Error in QualityCheck(Data = band.time.series, QualityScores = 
>>> QA.time.series,  :
>>>  QualityScores not all in range of MOD13Q1's QC: 0-3
>>>
>>> I seem to get this message with all subsets of my data (I have tried 
>>> running all of my data at once and then just one data point at a time). I 
>>> have also tried using wider date ranges as well as wider size ranges (in 
>>> case the pixel reliability is poor within a certain area or time frame) but 
>>> still get the same messages.
>>>[[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] MODISTools Help

2017-06-22 Thread Bert Gunter
This is a specialized package that fairly few of us are likely to have
familiarity with, especialy when you have not followed the posting
guide (below) and posted code and a reproducible example.

That said, a web search on R MODIS appeared to bring up relevant hits,
including a MODIS tutorial. Have you tried that?

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jun 22, 2017 at 2:12 PM, Caroline
 wrote:
> I am using MODIS Tools and am having a lot of difficulty troubleshooting my 
> code.
>
> I am a PhD student studying African buffalo in Kruger National Park, South 
> Africa. The study I am currently working on involves a herd of 200 African 
> buffalo caught every six months for 4 years. I am trying to use EVI and NDVI 
> to assess seasonal variation thus I would like mean EVI and NDVI for each 
> observation (each time each buffalo was captured). I have capture date, lat 
> and long for each observation.
>
> However, when using ‘250m_16_days_pixel_reliability’ as my quality control 
> band I keep getting the warning message:
>
> Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = 
> "MOD13Q1",  :
>   Only single data point that passed the quality screen: cannot summarise
>
> When using ‘250m_16_days_VI_Quality’ as my quality control band I keep 
> getting the warning message:
>
> Error in QualityCheck(Data = band.time.series, QualityScores = 
> QA.time.series,  :
>   QualityScores not all in range of MOD13Q1's QC: 0-3
>
> I seem to get this message with all subsets of my data (I have tried running 
> all of my data at once and then just one data point at a time). I have also 
> tried using wider date ranges as well as wider size ranges (in case the pixel 
> reliability is poor within a certain area or time frame) but still get the 
> same messages.
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] MODISTools Help

2017-06-22 Thread Caroline
I am using MODIS Tools and am having a lot of difficulty troubleshooting my 
code. 

I am a PhD student studying African buffalo in Kruger National Park, South 
Africa. The study I am currently working on involves a herd of 200 African 
buffalo caught every six months for 4 years. I am trying to use EVI and NDVI to 
assess seasonal variation thus I would like mean EVI and NDVI for each 
observation (each time each buffalo was captured). I have capture date, lat and 
long for each observation. 

However, when using ‘250m_16_days_pixel_reliability’ as my quality control band 
I keep getting the warning message:

Warning in MODISSummaries(LoadDat = period, FileSep = ",", Product = "MOD13Q1", 
 :
  Only single data point that passed the quality screen: cannot summarise

When using ‘250m_16_days_VI_Quality’ as my quality control band I keep getting 
the warning message: 

Error in QualityCheck(Data = band.time.series, QualityScores = QA.time.series,  
: 
  QualityScores not all in range of MOD13Q1's QC: 0-3

I seem to get this message with all subsets of my data (I have tried running 
all of my data at once and then just one data point at a time). I have also 
tried using wider date ranges as well as wider size ranges (in case the pixel 
reliability is poor within a certain area or time frame) but still get the same 
messages. 
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.