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
| # 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
| 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
| 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
| 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
| # 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
| import numpy | |
| from wtss import WTSS | |
| service = WTSS('https://brazildatacube.dpi.inpe.br/', access_token='seu-token') | |
| cbers4_coverage = service['CB4_64_16D_STK-1'] | |
| # | |
| # bandas | |
| # |
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: Felipe Menino Carlos | |
| # Date: 19/04/2021 | |
| # | |
| # ReproZip configuration file | |
| # This file was generated by reprozip 1.0.16 at 2021-03-15T02:04:56+00:00 | |
| # You might want to edit this file before running the packer | |
| # See 'reprozip pack -h' for help | |
| # Run info |
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
| # Autor: Felipe Menino Carlos | |
| # Data: 25/04/2021 | |
| set.seed(777) | |
| library(sits) | |
| # | |
| # Auxiliary function | |
| # | |
| extract_ts_by_sample_location <- function(collection, start_date, end_date, bands, sample_file) { |