Skip to content

Instantly share code, notes, and snippets.

View csaybar's full-sized avatar
🇵🇪

Cesar Aybar csaybar

🇵🇪
View GitHub Profile
Polynomial dataset
-5 -192.239
-4.5 71.537
-4 0.537
-3.5 -35.671
-3 -48.052
-2.5 -42.445
-2 -29.914
-1.5 -13.828
-1 -0.084
Linear dataset
-5 -4.291
-4 -2.86
-3 -2.918
-2 -1.954
-1 -1.426
0 1.988
1 0.157
2 0.593
3 2.044
@csaybar
csaybar / demo.jl
Last active October 30, 2021 15:34
julia and ee_extra
using Plots, Colors, FileIO, ImageIO
using PyCall
using EarthEngine
Initialize()
ee_extra = pyimport("ee_extra")
landsat_module = "users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js"
ee_extra.install(landsat_module)
lsmodule = ee_extra.require(landsat_module)
@csaybar
csaybar / homework.py
Created October 15, 2021 09:27
polynomial
__author__ = 'Wray Buntine'
_VERSION = '0.1'
import numpy;
import random;
##########
# globals
#
# WARNING: need to recode to remove dependence of beta on x-range!!!
@csaybar
csaybar / scribble.R
Created September 16, 2021 20:04
ddddd
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))
@csaybar
csaybar / comparison.R
Created September 14, 2021 13:07
LANDSAT VS SENTINEL VS PLANET
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
@csaybar
csaybar / hq_save.R
Created August 28, 2021 10:41
<<<<<<<<<<>>>>>>>>>>>>>
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",
@csaybar
csaybar / scribble_save.R
Created August 28, 2021 10:40
<<<<<<<<<>>>>>>>>>>><
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",
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)
@csaybar
csaybar / display.R
Created August 17, 2021 13:16
display tiles - flood
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 %>%