

Generate a synthentic CCDC image for a given date Plot( jdoy_to_date(ts_nir),ts_nir,type = 'l',xlab = 'Date',ylab = 'NIR Band Surface Reflectance')
#Ccdc icare packages series#
#Plot the time series plot( jdoy_to_date(ts_green),ts_green,type = 'l',xlab = 'Date',ylab = 'Green Band Surface Reflectance') Ts_nir <- get_ccdc_ts(ccdc_img,x_coord,y_coord,epsg, 'nir', 8) #Get the near-infrared (nir) surface reflectance time series (ts) for all 8-segments at the point. Ts_green <- get_ccdc_ts(ccdc_img,x_coord,y_coord,epsg, 'green', 8) #Get the green surface reflectance time series (ts) for all 8-segments at the point. Notice that the time series has a breakpoint at ~2018 in both the green and nir bands indicating a landcover change at this location occurred then. Any XY coordinate that intersect the raster data can be specified, for any band exported in the CCDC raster. Plot synthetic surface reflectance at a pixel locationīelow we use R.ccdc.tools::get_ccdc_ts to retrieve the CCDC coefficients to generate the synthetic surface reflectance time series at the pixel that intersects the coordinates above for the green and nir bands. #View the coefficients for each segment, these are used in 'get_ccdc_ts' to generate the time series data #Arbitrary example coordinates (EPSG:3005) within the image boundsĮpsg <-3005 #Extract the model coefficients at the point from the CCDC imageĭF <- ame(x = c(x_coord), y = c(y_coord))ĭF_sf = st_as_sf(DF, coords = c( "x", "y"),Įxtracted <- st_as_sf( st_extract(ccdc_img, DF_sf)) Notice additional attributes (e.g., S1_tStart) related to change detection and the individual segments are also present in the raster data as additional bands. For instance, S1_green_coef_INTP is the green band intercept coefficient for the first segment in the surface reflectance time series at the XY location 1794834, 609232.

#Ccdc icare packages code#
In the code below we define a random point within the AOI, and extract the CCDC raster values at that location to illustrate what attributes are present in the output image of GEE-Script. The Landsat blue, green, red, near-infrared, shortwave-infrared 1, shortwave-infrared 2 and thermal band coefficients are included as blue,green,red,nir,swir1,swir2 and therm, these are the expected band names. This CCDC raster contains the CCDC coefficients for each segment, in this case 8 segments were exported using the CCDC API. Load example CCDC output from package data, explore dataīelow we load in from R.ccdc.tools a CCDC image (exported from GEE-Script) for a small area of interest, we use the R.ccdc.tools::name_ccdc_bands function to rename the bands, as they are lost during export.
