This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Wray Buntine' | |
_VERSION = '0.1' | |
import numpy; | |
import random; | |
########## | |
# globals | |
# | |
# WARNING: need to recode to remove dependence of beta on x-range!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
scribble_creator <- function(folder) { | |
points <- list.files(folder, full.names = TRUE) | |
message(sprintf("%s fueron detectados", length(points))) | |
Sys.sleep(2) | |
for (index in seq_along(points)) { | |
in_files <- list.files(points[index]) | |
jsonf <- in_files[grepl("cloud_segmentation", in_files)] | |
js_list <- jsonlite::read_json(sprintf("%s/%s", points[index], jsonf)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgee) | |
library(rgeeExtra) | |
# Roy account | |
ee_Initialize("roy1") | |
# Load Planet, Sentinel-2, and Landsat-8 | |
# ee_utils_dataset_display(planet) | |
planet <- ee$ImageCollection('projects/planet-nicfi/assets/basemaps/americas') | |
s2 <- ee$ImageCollection$Dataset$COPERNICUS_S2_SR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
library(reticulate) | |
library(raster) | |
np <- import("numpy") | |
save_manual_labeling_scribble <- function(point, output) { | |
points_x <- list.files( | |
path = sprintf("%s/%s.iris/segmentation", point, basename(point)), | |
pattern = "2_final\\.npy", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
library(reticulate) | |
library(raster) | |
np <- import("numpy") | |
save_manual_labeling_scribble <- function(point, output) { | |
points_x <- list.files( | |
path = sprintf("%s/%s.iris/segmentation", point, basename(point)), | |
pattern = "2_final\\.npy", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
scribble_ano <- function(file) { | |
segmentation_point <- jsonlite::read_json(file) | |
segmentation_point$classes <- list( | |
list( | |
name = "Clear", | |
description = "All clear pixels, i.e. without cloud contamination or cloud shadows.", | |
colour = c(255, 255, 255, 0), | |
user_colour = c(0, 255, 255, 85) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viz_patches <- function(pid) { | |
metadata_list <- read.csv("https://storage.googleapis.com/flood_dataset/flood-training-metadata.csv") | |
date <- metadata_list[metadata_list$chip_id %in% pid, 6][1] | |
url <- sprintf("https://storage.googleapis.com/flood_dataset/%s.tif", pid) | |
local_tif <- tempfile(fileext = ".tif") | |
download.file(url, local_tif) | |
# BOX | |
ee_extent <- local_tif %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Script to sample multiple layers by years 1990 - 2011 using a point dataset | |
#' @description Layers: Landsat spectral values; NDVI; NDMI; NBR; Elevation, Slope, Aspect. | |
#' | |
#' PARAMETERS | |
#' | |
#' | |
library(rgee) | |
ee_Initialize() | |
USUptsNew <- ee$FeatureCollection("users/dougramsey/ForCaMF/PointData/USU_RandomPoints_NEW") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgee) | |
library(sf) | |
library(magick) | |
ee_Initialize() | |
mask <- system.file("shp/arequipa.shp", package = "rgee") %>% | |
st_read(quiet = TRUE) %>% | |
sf_as_ee() |