There is a newer version of the record available.

Published May 3, 2018 | Version v0.3.2
Software Open

sen2r: an R toolbox to find, download and preprocess Sentinel-2 data

  • 1. CNR-IREA

Description

This is an improvement of version 0.3.1, with several fixes and improvements.

New functions

  • check_sen2r_deps(): a new GUI to help checking dependencies.

  • Add function s2_perc_masked() to compute the percentage of cloud-masked surface.

GUI changes

  • Major GUI improvements in the definition of the extent: now the main map is used only to show the extent and the tiles, while the definition of the extent (drawn, specified with a bounding box or taken from a loaded polygon) is donee in separate maps (this allows to avoid many errors).

  • Add radiobutton for index datatype, to choose the datatype when an index is generated.

  • Add maximum cloud cover threshold.

  • Implement seasonal time period (#74).

  • Implement the download with aria2c.

Processing chain

  • Major commit: retrieve also existing filenames. Before this commit, if some products were partially retrieved (e.g. output BOA) and some depending on them are missing (e.g. an index) but SAFE were not required, the corresponding expected vectors were not retrieved (missing SAFE tile names nothing was generated). Now, existing names matching the parameters are attached to each "_exp" vector.

  • Manage parallelisation:

    • add partial parallelisation in s2_calcindices() (on infiles, not on indices);
    • add "parallel" argument in sen2r() to allow singlecore mode;
    • fix parallel=FALSE in function (force n_cores=1). In general, now the whole processing chain can be optionally launched in single core.

Addition to existing functions

  • Improvement in integer / byte data types for generation of indices: Int16 is now the default data type; chosing an integer data type the output values are clipped on the valid format range, and the scaling factor can be chosen by the user; chosing Byte, interval -1 to 1 is coherced to 0-200 (with nodata=255).

  • Use standard nodata values to compute indices.

  • Return the list of created files after processing.

  • Accept custom mask combinations: now it is possible to define masks with a custom combination of SCL classes to be masked.

  • Allow argument "timewindow" in sen2r() to be a single integer value, which is interpreted as the period between today and n days ago.

  • Uniform temporary directories (#73). Now the principal functions have the parameters tmpdir and rmtmp to set the temporary directory and the choice to delete /not to delete temporary files. Only two exceptions: create_indices_db() uses a fixed temporary directory (since it is a function intended not to be run by endusers); sen2cor() launched from sen2r() uses a default temporary directory if tempdir is in a SAMBA mountpoint over Windows.

Other changes

  • Update to sen2cor 2.5.5, and manage S2A L2A operational products (https://scihub.copernicus.eu/news/News00305).

  • Add a welcome message and a logo.

  • Change package name from SALTO to sen2r, and rename the main function consequently to sen2r().

  • Remove s2download as dependence (now it is integrated within the package).

  • Remove sprawl dependencies.

Major fixes

  • Avoid blurs and artifices in thumbnails. stack2rgb() now works with GDAL routines; gdalwarp is used instead than gdal_translate for reducing the size of input images (to avoid averaging NA values, which produced blurs on borders of BOA thumbnails); intermediate GTiff files are used to bypass the presence of artifices in SCL PNG thumbnails and to produce JPEG multiband TOA/BOA thumbnails.

  • Load python modules correctly. Now on Windows all the modules are imported using import_from_path() in init_python(), which is called anywhere modules are needed.

  • Fix unrecognised osgeo in Windows. When running gdal_calc in Windows with multiple Python installlations, the wrong one (i.e. Anaconda) is used, and "no module names osgeo" error is returned.

  • Other minor fixes.

Files

ranghetti/sen2r-v0.3.2.zip

Files (7.7 MB)

Name Size Download all
md5:0203d74e2d0d71574de9c17761e3c71f
7.7 MB Preview Download

Additional details

Related works