Skip to content

Commit

Permalink
Merge pull request #477 from e-sensing/dev
Browse files Browse the repository at this point in the history
Pre-release 0.15.1
  • Loading branch information
rolfsimoes authored Nov 17, 2021
2 parents c92a3b7 + b68ca8c commit edb09d3
Show file tree
Hide file tree
Showing 215 changed files with 2,926 additions and 9,059 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ Makevars
Makevars.*
*.gcda
*.gcno
^_snaps

11 changes: 4 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sits
Type: Package
Version: 0.15.0-4
Version: 0.15.1
Title: Satellite Image Time Series Analysis for Remote Sensing Data Cubes
Authors@R: c(person('Rolf', 'Simoes', role = c('aut'), email = 'rolf.simoes@inpe.br'),
person('Gilberto', 'Camara', role = c('aut', 'cre'), email = 'gilberto.camara@inpe.br'),
Expand Down Expand Up @@ -43,7 +43,8 @@ Imports:
parallel,
purrr (>= 0.3.0),
raster (>= 3.4),
rstac (>= 0.9.1-4),
Rcpp (>= 1.0.7),
rstac (>= 0.9.1-5),
sf (>= 0.9),
slider (>= 0.1.5),
stats,
Expand All @@ -67,7 +68,6 @@ Suggests:
nnet,
openxlsx,
randomForest,
Rcpp,
RcppArmadillo,
Rwtss (>= 0.9.1),
scales,
Expand All @@ -90,7 +90,6 @@ Collate:
'sits_accuracy.R'
'sits_bands.R'
'sits_bbox.R'
'sits_brewer.R'
'sits_classification.R'
'sits_classify_ts.R'
'sits_classify_cube.R'
Expand All @@ -107,13 +106,10 @@ Collate:
'sits_filters.R'
'sits_gdalcubes.R'
'sits_get_data.R'
'sits_indexes.R'
'sits_imputation.R'
'sits_keras.R'
'sits_labels.R'
'sits_labels_set.R'
'sits_label_classification.R'
'sits_labels_summary.R'
'sits_machine_learning.R'
'sits_merge.R'
'sits_mlp.R'
Expand Down Expand Up @@ -144,6 +140,7 @@ Collate:
'sits_source_api_bdc.R'
'sits_source_api_deafrica.R'
'sits_source_api_local.R'
'sits_source_api_mspc.R'
'sits_source_api_satveg.R'
'sits_source_api_stac.R'
'sits_source_api_usgs.R'
Expand Down
22 changes: 11 additions & 11 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method("sits_labels<-",pattern)
S3method("sits_labels<-",probs_cube)
S3method("sits_labels<-",sits)
S3method(.raster_check_package,default)
S3method(.raster_check_package,raster)
Expand Down Expand Up @@ -58,6 +58,7 @@ S3method(.raster_yres,terra)
S3method(.sits_roi_bbox,ll)
S3method(.sits_roi_bbox,sf)
S3method(.sits_roi_bbox,xy)
S3method(.source_collection_access_test,mspc_cube)
S3method(.source_collection_access_test,satveg_cube)
S3method(.source_collection_access_test,stac_cube)
S3method(.source_collection_access_test,wtss_cube)
Expand All @@ -75,19 +76,26 @@ S3method(.source_items_cube,stac_cube)
S3method(.source_items_cube,wtss_cube)
S3method(.source_items_fileinfo,stac_cube)
S3method(.source_items_fileinfo,wtss_cube)
S3method(.source_items_new,"mspc_cube_landsat-8-c2-l2")
S3method(.source_items_new,"mspc_cube_sentinel-2-l2a")
S3method(.source_items_new,aws_cube)
S3method(.source_items_new,bdc_cube)
S3method(.source_items_new,deafrica_cube)
S3method(.source_items_new,usgs_cube)
S3method(.source_items_new,wtss_cube)
S3method(.source_items_tile_get_bbox,stac_cube)
S3method(.source_items_tile_get_crs,"mspc_cube_landsat-8-c2-l2")
S3method(.source_items_tile_get_crs,"mspc_cube_sentinel-2-l2a")
S3method(.source_items_tile_get_crs,aws_cube)
S3method(.source_items_tile_get_crs,bdc_cube)
S3method(.source_items_tile_get_crs,deafrica_cube)
S3method(.source_items_tile_get_crs,usgs_cube)
S3method(.source_items_tile_get_name,"mspc_cube_sentinel-2-l2a")
S3method(.source_items_tile_get_name,bdc_cube)
S3method(.source_items_tile_get_name,deafrica_cube)
S3method(.source_items_tile_get_name,stac_cube)
S3method(.source_items_tiles_group,"mspc_cube_landsat-8-c2-l2")
S3method(.source_items_tiles_group,"mspc_cube_sentinel-2-l2a")
S3method(.source_items_tiles_group,aws_cube)
S3method(.source_items_tiles_group,bdc_cube)
S3method(.source_items_tiles_group,deafrica_cube)
Expand Down Expand Up @@ -145,6 +153,7 @@ S3method(sits_timeline,probs_cube)
S3method(sits_timeline,raster_cube)
S3method(sits_timeline,satveg_cube)
S3method(sits_timeline,sits)
S3method(sits_timeline,sits_model)
S3method(sits_timeline,wtss_cube)
S3method(sits_values,bands_cases_dates)
S3method(sits_values,bands_dates_cases)
Expand All @@ -168,42 +177,32 @@ export(sits_cluster_dendro)
export(sits_cluster_frequency)
export(sits_config)
export(sits_config_show)
export(sits_create_folds)
export(sits_cube)
export(sits_data_to_csv)
export(sits_envelope)
export(sits_filter)
export(sits_formula_linear)
export(sits_formula_logref)
export(sits_from_zoo)
export(sits_get_data)
export(sits_impute_linear)
export(sits_interp)
export(sits_keras_diagnostics)
export(sits_kfold_validate)
export(sits_label_classification)
export(sits_labels)
export(sits_labels_summary)
export(sits_linear_interp)
export(sits_list_collections)
export(sits_merge)
export(sits_metadata_to_csv)
export(sits_missing_values)
export(sits_mlp)
export(sits_mlr)
export(sits_mutate_bands)
export(sits_ndwi)
export(sits_patterns)
export(sits_regularize)
export(sits_rfor)
export(sits_sample)
export(sits_savi)
export(sits_select)
export(sits_sgolay)
export(sits_show_prediction)
export(sits_smooth)
export(sits_som_clean_samples)
export(sits_som_cluster)
export(sits_som_evaluate_cluster)
export(sits_som_map)
export(sits_svm)
Expand All @@ -217,6 +216,7 @@ export(sits_values)
export(sits_view)
export(sits_whittaker)
export(sits_xgboost)
importFrom(Rcpp,sourceCpp)
importFrom(data.table,":=")
importFrom(lubridate,"%m+%")
importFrom(lubridate,"%within%")
Expand Down
24 changes: 24 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

We are preparing to release the package on CRAN and are making relevant changes in the development version.

# What's new in SITS version 0.15.1

### New features in SITS version 0.15.1
* Update README.Rmd
* Support `sits_timeline()` to sits model objects
* Update drone image
* Simplify `config_colors.yml` by removing palette names
* Temporary python files are being generated in the check
* Organise color handling in SITS
* Organise configuration files
* Improve preconditions in `sits_regularize()`
* Compress external data with bzip2
* Update gdalcubes format files
* Update rstac version
* Check provided parameters in sits_regularize function
* Use default palette for SOM colors
* Remove `start_date` and `end_date` from validation csv file
* Use a default brewer palette to plot classified cube
* Improve package help pages
* Remove unused data sets
* Remove rarely used functions
* `sits_regularize()` is producing *Float64* images as output
* Full support for Microsoft Planetary Computing

# What's new in SITS version 0.15.0

### New features in SITS version 0.15.0-4
Expand Down
61 changes: 0 additions & 61 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,64 +57,3 @@ NULL
#' cube (the name of the cube associated with the data),
#' time_series (list containing a tibble with the values of the time series).
NULL

#' @title Samples of nine classes for the state of Mato Grosso
#'
#' @description A dataset containing a tibble with time series samples
#' for the Mato Grosso state in Brasil.
#' The time series come from MOD13Q1 collection 6 images.
#' The data set has the following classes:
#' Cerrado, Fallow_Cotton, Forest, Pasture,
#' Soy_Corn, Soy_Cotton, Soy_Fallow,
#' Soy_Millet, and Soy_Sunflower.
#'
#' @docType data
#' @keywords datasets
#' @name samples_mt_6bands
#' @usage data(samples_mt_6bands)
#' @format A tibble with 425 rows and 7 variables:
#' longitude: East-west coordinate of the time series sample (WGS 84),
#' latitude (North-south coordinate of the time series sample in WGS 84),
#' start_date (initial date of the time series),
#' end_date (final date of the time series),
#' label (the class label associated to the sample),
#' cube (the name of the cube associated with the data),
#' time_series (list containing a tibble with the values of the time series).
NULL

#' @title A time series in the ZOO format
#'
#' @description A dataset containing a one ZOO time series samples
#' in the Mato Grosso state of Brazil.
#' The time series comes from MOD13Q1 collection 5 images.
#'
#' @docType data
#' @keywords datasets
#' @name ts_zoo
#' @usage data(ts_zoo)
#' @format A ZOO time series with bands NDVI and EVI for a one year period
NULL

#' @title The timeline for the sequence of images for MOD13Q1 collection 6
#'
#' @description The timeline for the time series used in the examples
#' that use data from MODIS collection 6.
#' There are 407 instances from 2000-02-18 until 2017-10-16.
#' @docType data
#' @keywords datasets
#' @name timeline_2000_2017
#' @usage data(timeline_2000_2017)
#' @format A vector with 407 dates in YYYY-MM-DD format.
NULL

#' @title The timeline for the sequence of images one year (2013 to 2014)
#'
#' @description The timeline for the time series used in the examples
#' that use data for one year classification.
#' There are 23 instances from 2013-09-14 until 2014-08-29.
#' @docType data
#' @keywords datasets
#' @name timeline_2013_2014
#' @usage data(timeline_2013_2014)
#' @format A vector with 23 dates in YYYY-MM-DD format.
NULL
2 changes: 1 addition & 1 deletion R/sits-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' @description Satellite Image Time Series Analysis
#' for Earth Observation Data Cubes
#'
#' @section SITS API:
#' @section Purpose:
#'
#' The SITS package provides a set of tools for analysis,
#' visualization and classification of satellite image time series.
Expand Down
8 changes: 3 additions & 5 deletions R/sits_ResNet.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Train a model using the ResNet model
#' @title Train ResNet classification models
#' @name sits_ResNet
#'
#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br}
Expand Down Expand Up @@ -96,12 +96,10 @@ sits_ResNet <- function(samples = NULL,
stop("Please install package keras", call. = FALSE)
}

valid_activations <- c("relu", "elu", "selu", "sigmoid")
# pre-conditions
.check_chr_within(
x = activation,
within = valid_activations,
discriminator = "any_of",
within = .config_get("dl_activation_methods"),
discriminator = "one_of",
msg = "invalid CNN activation method"
)

Expand Down
9 changes: 3 additions & 6 deletions R/sits_TempCNN.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#' @title Train a model using the Temporal Convolutional Neural Network
#' @title Train temporal convolutional neural network models
#' @name sits_TempCNN
#'
#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br}
Expand Down Expand Up @@ -95,9 +95,6 @@ sits_TempCNN <- function(samples = NULL,
stop("Please install package keras", call. = FALSE)
}

# pre-conditions
valid_activations <- c("relu", "elu", "selu", "sigmoid")

.check_length(
x = cnn_layers,
len_min = length(cnn_kernels),
Expand All @@ -124,14 +121,14 @@ sits_TempCNN <- function(samples = NULL,

.check_chr_within(
x = cnn_activation,
within = valid_activations,
within = .config_get("dl_activation_methods"),
discriminator = "one_of",
msg = "invalid CNN activation method"
)

.check_chr_within(
x = dense_layer_activation,
within = valid_activations,
within = .config_get("dl_activation_methods"),
discriminator = "one_of",
msg = "invalid node activation method"
)
Expand Down
10 changes: 6 additions & 4 deletions R/sits_accuracy.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Area-weighted classification accuracy assessment
#' @title Assess classification accuracy (area-weighted method)
#' @name sits_accuracy
#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br}
#' @author Alber Sanchez, \email{alber.ipia@@inpe.br}
Expand Down Expand Up @@ -167,7 +167,10 @@ sits_accuracy.classified_image <- function(data, ..., validation_csv) {
stringsAsFactors = FALSE))

# Precondition - check if CSV file is correct
.sits_csv_check(csv_tb)
.check_chr_contains(
x = colnames(csv_tb),
contains = c("longitude", "latitude", "label"),
msg = "invalid csv file")

# find the labels of the cube
labels_cube <- sits_labels(data)
Expand Down Expand Up @@ -204,8 +207,7 @@ sits_accuracy.classified_image <- function(data, ..., validation_csv) {
points_row <- dplyr::filter(
points,
X >= row$xmin & X <= row$xmax &
Y >= row$ymin & Y <= row$ymax,
start_date == row$file_info[[1]]$start_date
Y >= row$ymin & Y <= row$ymax
)

# if there are no points in the cube, return an empty list
Expand Down
6 changes: 3 additions & 3 deletions R/sits_bands.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' @title Informs the names of the bands
#' @title Get the names of the bands
#'
#' @name sits_bands
#'
#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br}
#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br}
#'
#' @description Finds/replaces the names of the bands of
#' @description Finds the names of the bands of
#' a set of time series or of a data cube
#'
#' @param x Valid sits tibble (time series or a cube)
Expand All @@ -15,7 +15,7 @@
#' @examples {
#' # Retrieve the set of samples for Mato Grosso (provided by EMBRAPA)
#' # show the bands
#' sits_bands(samples_mt_6bands)
#' sits_bands(samples_modis_4bands)
#' }
#'
#' @export
Expand Down
Loading

0 comments on commit edb09d3

Please sign in to comment.