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
# Adapted from: https://github.com/albhasan/deforestation-sentinel2/blob/master/06_validation/validate_results.R | |
# validation_dataset_bands.csv is avaliable online on: https://doi.pangaea.de/10.1594/PANGAEA.921387?format=html#download | |
set.seed(666) | |
validation_dataset_bands <- readr::read_csv("validation_dataset_bands.csv") | |
deforestation <- dplyr::filter(validation_dataset_bands, label == "Deforestation") | |
non_forest <- dplyr::filter(validation_dataset_bands, label == "Non-Forest") | |
forest <- dplyr::filter(validation_dataset_bands, label == "Forest") |
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
default: | |
# estimated relative growth size of R memory relative to block size | |
R_memory_bloat : 4 | |
R_processing_bloat : 5 | |
# minimum number of samples for multicore processing | |
minimum_number_samples : 1000 | |
# Data cube types known to sits |
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
chooseCRANmirror(graphics=FALSE, ind=1) | |
# Install devtools, rmarkdown, knitr, testthat and Rcpp if not already available | |
install.packages(c("devtools", "rmarkdown", "Rcpp", "knitr", "testthat", "remotes")) | |
# Please install the Suggested packages that are used by sits | |
install.packages(c("DBI","dendextend", "dtwclust","dtwSat", "e1071", "flexclust", | |
"imager", "imputeTS", "kohonen", "lwgeom", "MASS", "methods", | |
"mgcv", "nnet", "proto", "proxy", "ptw", "ranger", "RCurl", | |
"RSQLite", "signal", "xgboost", "zoo", "randomForest", "desc")) |
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
version: 0.6.0 | |
inputs: | |
directories: | |
- R | |
options: | |
CACHE: on # Cache the steps results | |
workflow: | |
type: serial | |
specification: | |
steps: |
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
# STAC.py | |
bdc_stac_service = stac.STAC('http://brazildatacube.dpi.inpe.br/stac/') | |
# Select a collection and get items | |
collection = bdc_stac_service.collection('S2_10_16D_STK-1') | |
items = collection.get_items(filter={'bbox':'-61, 2.8, -60, 1.8', 'datetime':'2018-08-01/2019-07-31'}) | |
# Generate a "1D" (One variable) datacube | |
## mutate_1d_cube from github.com/M3nin0/xarray-stac/ | |
cube1d = mutate_1d_cube(items['features'], 'NDVI') |
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
# Autor: Felipe Menino Carlos | |
# Data: 11/09/2020 | |
' | |
Calcula o SpeedUp | |
' | |
speedUp <- function(serialTime, parallelTime) | |
{ | |
return(serialTime / parallelTime) | |
} |
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
import stac | |
bdc_stac_service = stac.STAC('http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/') | |
collection = bdc_stac_service.search({'collections': ['LC8SR'], "intersects": {"type": "Point", "coordinates": [-45, -13] }, "limit": 10}) |
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
import numpy as np | |
import pandas as pd | |
from sklearn import linear_model | |
import matplotlib.pyplot as plt | |
# Carregando os dados | |
data_owd = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv') | |
# Filtrando os dados (Canadá) | |
can = data_owd[data_owd.iso_code == 'CAN'] |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Arbitrary Spectral Slope Noise Generation % | |
% with OCTAVE Implementation % | |
% % | |
% From Little, 1992. Adapted from R. Rosa (08/08/14) % | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
function x = powernoise(beta, N, varargin) | |
% Generate samples of power law noise. The power spectrum | |
% of the signal scales as f^(-beta). |
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
#include <iostream> | |
// Idea from: https://stackoverflow.com/questions/5171739/tostring-override-in-c | |
class Teste | |
{ | |
private: | |
int a; | |
public: | |
Teste(int a) |