Giter Club home page Giter Club logo

phenocamr's People

Contributors

bnasr avatar khufkens avatar tmilliman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

phenocamr's Issues

Documentation example error

Example usage should be:

download_phenocam(site = "harvard",
vegetation = "DB",
frequency = 3,
phenophase = TRUE)

i.e. argument is 'phenophase' not 'phenophases'.

split out post processing for local reprocessing of data

Worked example of how to deal with local post processing using the process_phenocam() function.

# install the latest development release!
library(phenocamr)

# I'll download some normal data. I'll use your
# home directory for this.

download_phenocam("spruceT0P19E",
                  frequency = 3,
                  veg_type = "EN",
                  smooth = FALSE,
                  outlier_detection = FALSE,
                  phenophase = FALSE,
                  out_dir = "~")
#> Downloading: spruceT0P19E_EN_1000_3day.csv


# List your snow flagged files
files <- list.files("~","*3day.csv", full.names = TRUE)

# loops over all files if multiple ones provided,
# snow_flags will be removed by the detect_outlier()
# routine if present.
lapply(files, function(file){
  
  # only do the smoothing (no phenophases)
  # write files to disk (will overwrite original if the same
  # directory is provided)
  process_phenocam(file,
                   out_dir = "~",
                   phenophase = FALSE,
                   internal = FALSE)
})
#> -- Flagging outliers!
#> -- Smoothing time series!

Created on 2019-04-09 by the reprex package (v0.2.1)

change implementation of PELT

Personal communications with Rebecca Killick [email protected]

"If you take the first differences of the data then you now have a 0-mean process and the problem reduces to a change in variance, i.e. cpt.var(gcc,method='PELT',penalty='SIC1'). I noticed in your code that you use smoothing splines on the data first. This is not advised as it changes the structure of the data and makes abrupt changes appear more gradual."

Question about "optimal_span" documentation

Hi! I am intrigued by the "optimal_span" function you have written because I'm looking for a way to find the optimal span for a series of loess regressions I'm running.

In your documentation for the function, you write in the code "Internal function only, should not be used stand-alone." Could you explain if you mean I shouldn't use this function by itself or something else? Also, if possible could you please explain why this is the case? Thanks! Appreciate the work!
https://github.com/khufkens/phenocamr/blob/cd1ed0b708b551852830a22ab7cb772cddefd87a/R/optimal_span.r

SVG version of logo

Hi! I'm looking to add this project to the LF Energy Landscape ( l.lfenergy.org ) and was wondering if you had a pure SVG version of the logo. If you have an EPS or AI version that works too. Thanks!

Readme issue

Just a note that the example code on the README.md has phenophases = TRUE in the download_phenocam when it should just be phenophase = TRUE

I noticed when copying to make an instructional for someone and it threw up an error, figured I'd drop you a line just in case. Thanks!

Hue (HSV) based snow flagging

A Hue based filter performs well in finding images with snow and cloud contamination, even on average daily values across an ROI (no image processing needed).

# HSV based snow flagging
library(phenocamr)
library(tidyverse)

if(!file.exists(file.path(tempdir(),"chibougamau_EN_1000_1day.csv"))){
  download_phenocam(site = "chibougamau",
                    out_dir = tempdir(),
                    frequency = 1,
                    roi_id = 1000)
}

# read data
df <- read.table(file.path(tempdir(),"chibougamau_EN_1000_1day.csv"),
                 sep = ",",
                 header = TRUE,
                 stringsAsFactors = FALSE)

df <- df %>% filter(!is.na(r_mean))

hsv <- rgb2hsv(df$r_mean, df$g_mean, df$b_mean)

df$snow_flag <- ifelse(hsv[1,] > 0.55 & hsv[1,] < 0.97,"snow","no snow")

p <- ggplot(df) +
  geom_point(aes(as.Date(date), gcc_90, col = as.factor(snow_flag))) +
  theme_minimal()

print(p)

snow_flags

download_phenocam() with frequency = 1 is inconsistent with frequency = 3.

Not sure how this is supposed to work but when I use frequency=1 I get the following error message:

    > download_phenocam(site = "harvard$",
    +                   veg_type = "DB",
    +                   roi_id = "1000",
    +                   frequency = "1",
    +                   contract=FALSE)
    Downloading: harvard_DB_1000_1day.csv
    Error in contract_phenocam(data, internal = TRUE, no_padding = TRUE) : 
      This is a 1-day file, will not be contracted to 3-day frequency

And the resulting downloaded file is not padded with the +/- 90 days. My expectations were that the download would result in a file with padding as was the case with the 3-day frequency. This seems to be a problem with expand_phenocam() calling contract_phenocam() which fails for the 1-day file and stops the padding from occurring. I've got a local workaround but not sure if the logic matches your intent.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.