diff --git a/.travis.yml b/.travis.yml index c6d593e3739a..4862b2996079 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ matrix: - flex - flip - libfcgi-dev + - libfftw3-3 - libpq-dev - libqscintilla2-dev - libqt4-dev @@ -83,6 +84,7 @@ matrix: - graphviz - libpq-dev - libfcgi-dev + - libfftw3-3 - pkg-config - poppler-utils - txt2tags diff --git a/ci/travis/linux/qt5/blacklist.txt b/ci/travis/linux/qt5/blacklist.txt index 9f8d03127ee4..ac0a554b1475 100755 --- a/ci/travis/linux/qt5/blacklist.txt +++ b/ci/travis/linux/qt5/blacklist.txt @@ -13,3 +13,4 @@ PyQgsVirtualLayerDefinition PyQgsVirtualLayerProvider qgis_composermapgridtest qgis_composerutils +ProcessingGrass7AlgorithmsTest diff --git a/python/plugins/processing/algs/grass7/Grass7Algorithm.py b/python/plugins/processing/algs/grass7/Grass7Algorithm.py index 226b29ca9ddd..7a703c1cc834 100644 --- a/python/plugins/processing/algs/grass7/Grass7Algorithm.py +++ b/python/plugins/processing/algs/grass7/Grass7Algorithm.py @@ -558,7 +558,7 @@ def exportVectorLayer(self, orgFilename): return command def setSessionProjectionFromProject(self, commands): - if not Grass7Utils.projectionSet: + if not Grass7Utils.projectionSet and iface: proj4 = iface.mapCanvas().mapSettings().destinationCrs().toProj4() command = 'g.proj' command += ' -c' diff --git a/python/plugins/processing/algs/grass7/TODO b/python/plugins/processing/algs/grass7/TODO index 8255922a422f..e05bf57ebe3d 100644 --- a/python/plugins/processing/algs/grass7/TODO +++ b/python/plugins/processing/algs/grass7/TODO @@ -1,9 +1,70 @@ -* http://trac.osgeo.org/grass/wiki/Grass7/NewFeatures#Replacedandremovedmodules -* TODO: Merged modules - r.average: merged into G7:r.statistics, G7:r.statistics2, G7:r.statistics3 - r.bilinear merged into G7:r.resamp.interp - r.median: merged into G7:r.statistics, G7:r.statistics2, G7:r.statistics3 - r.sum: merged into G7:r.statistics, G7:r.statistics2, G7:r.statistics3 -* http://trac.osgeo.org/grass/wiki/Grass7/NewFeatures#Renamedmodules +TODO List for GRASS7 algorithms support into QGIS Processing + +Unit tests +========== + +i.* modules: +------------ + +* i.albedo: needs better data +* i.aster.toar: needs OutputDir support in tests +* i.atcorr: OK (basic implementation) +* i.biomass: OK (basic implementation) +* i.cca: needs OutputDir support in tests +* i.cluster: OK (full implementation) +* i.colors.enhance: needs other raster data +* i.eb.eta: OK (basic implementation) +* i.eb.evapfr: needs better data +* i.eb.hsebal01: OK (basic implementation) +* i.eb.netrad: OK (basic implementation) +* i.eb.soilheatflux: OK (basic implementation) +* i.emissivity: OK (basic implementation) +* i.evapo.mh: OK (basic implementation) +* i.evapo.pm: OK (basic implementation) +* i.evapo.pt: OK (basic implementation) +* i.evapo.time: broken (don't know why, should work) +* i.fft: OK (full implementation) +* i.gensig: OK (full implementation) +* i.gensigset: OK (full implementation) +* i.group: OK (full implementation) +* i.his.rgb: needs better data +* i.ifft: needs specific raster data +* i.image.mosaic: OK (basic implementation) +* i.in.spotvgt: needs probably a true NVDI SPOT file (quite huge for tests). +* i.landsat.acca: needs better data +* i.landsat.toar: needs OutputDir support in tests +* i.maxlik: OK (full implementation) +* i.modis.qc: OK (full implementation) +* i.oif: OK (full implementation) +* i.ortho.camera: not implemented in Processing +* i.ortho.elev: not implemented in Processing +* i.ortho.rectify: not implemented in Processing +* i.pansharpen: OK (full implementation) +* i.pca: needs OutputDir support in tests +* i.rectify: needs OutputDir support in tests +* i.rgb.his: OK (full implementation) +* i.segment: OK (full implementation) +* i.smap: OK (full implementation) +* i.spectral: not implementable in Processing +* i.target: not implementable in Processing +* i.tasscap: needs OutputDir support in tests +* i.topo.corr.ill: OK (basic implementation) +* i.topo.corr: needs OutputDir support in tests +* i.vi: OK (basic implementation) +* i.zc: OK (basic implementation) + +r.* modules +----------- + +Need to write everything + +v.* modules +----------- + +Need to write everything + +Other +===== + * TODO: decide what to do with nviz: nviz_cmd -> G7:m.nviz.image diff --git a/python/plugins/processing/algs/grass7/description/i.albedo.txt b/python/plugins/processing/algs/grass7/description/i.albedo.txt new file mode 100644 index 000000000000..dbeef0c956cf --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.albedo.txt @@ -0,0 +1,11 @@ +i.albedo +Computes broad band albedo from surface reflectance. +Imagery (i.*) +ParameterMultipleInput|input|Name of input raster maps|3|False +ParameterBoolean|-m|MODIS (7 input bands:1,2,3,4,5,6,7)|False +ParameterBoolean|-n|NOAA AVHRR (2 input bands:1,2)|False +ParameterBoolean|-l|Landsat 5+7 (6 input bands:1,2,3,4,5,7)|False +ParameterBoolean|-a|ASTER (6 input bands:1,3,5,6,8,9)|False +ParameterBoolean|-c|Aggressive mode (Landsat)|False +ParameterBoolean|-d|Soft mode (MODIS)|False +OutputRaster|output|Albedo diff --git a/python/plugins/processing/algs/grass7/description/i.aster.toar.txt b/python/plugins/processing/algs/grass7/description/i.aster.toar.txt new file mode 100644 index 000000000000..266686e6b6e8 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.aster.toar.txt @@ -0,0 +1,13 @@ +i.aster.toar +Calculates Top of Atmosphere Radiance/Reflectance/Brightness Temperature from ASTER DN. +Imagery (i.*) +ParameterMultipleInput|input|Names of ASTER DN layers (15 layers)|3|False +ParameterNumber|dayofyear|Day of Year of satellite overpass [0-366]|0|366|0|False +ParameterNumber|sun_elevation|Sun elevation angle (degrees, < 90.0)|0.0|90.0|45.0|False +ParameterBoolean|-r|Output is radiance (W/m2)|False +ParameterBoolean|-a|VNIR is High Gain|False +ParameterBoolean|-b|SWIR is High Gain|False +ParameterBoolean|-c|VNIR is Low Gain 1|False +ParameterBoolean|-d|SWIR is Low Gain 1|False +ParameterBoolean|-e|SWIR is Low Gain 2|False +OutputDirectory|output|Output Directory diff --git a/python/plugins/processing/algs/grass7/description/i.atcorr.txt b/python/plugins/processing/algs/grass7/description/i.atcorr.txt index fa8e9a992317..47671c4d6597 100644 --- a/python/plugins/processing/algs/grass7/description/i.atcorr.txt +++ b/python/plugins/processing/algs/grass7/description/i.atcorr.txt @@ -2,14 +2,15 @@ i.atcorr Performs atmospheric correction using the 6S algorithm. Imagery (i.*) ParameterRaster|input|Name of input raster map|False -ParameterBoolean|-a|Input from ETM+ image taken after July 1, 2000|False -ParameterBoolean|-b|Input from ETM+ image taken before July 1, 2000|False +ParameterRange|range|Input imagery range [0,255]|0,255|True ParameterRaster|elevation|Input altitude raster map in m (optional)|True ParameterRaster|visibility|Input visibility raster map in km (optional)|True -ParameterFile|parameters|Name of input text file|False -ParameterRange|range|Input imagery range [0,255]|0,255 -ParameterBoolean|-o|Try to increase computation speed when altitude and/or visibility map is used|True +ParameterFile|parameters|Name of input text file|False|False +ParameterRange|rescale|Rescale output raster map [0,255]|0,255|True OutputRaster|output|Atmospheric correction -ParameterBoolean|-f|Output raster is floating point|False -ParameterRange|rescale|Rescale output raster map [0,255]|0,255 +*ParameterBoolean|-i|Output raster map as integer|False +*ParameterBoolean|-r|Input raster map converted to reflectance (default is radiance)|False +*ParameterBoolean|-a|Input from ETM+ image taken after July 1, 2000|False +*ParameterBoolean|-b|Input from ETM+ image taken before July 1, 2000|False + diff --git a/python/plugins/processing/algs/grass7/description/i.biomass.txt b/python/plugins/processing/algs/grass7/description/i.biomass.txt new file mode 100644 index 000000000000..26bb661b34a8 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.biomass.txt @@ -0,0 +1,10 @@ +i.biomass +Computes biomass growth, precursor of crop yield calculation. +Imagery (i.*) +ParameterRaster|fpar|Name of fPAR raster map|False +ParameterRaster|lightuse_efficiency|Name of light use efficiency raster map (UZB:cotton=1.9)|False +ParameterRaster|latitude|Name of degree latitude raster map [dd.ddd]|False +ParameterRaster|dayofyear|Name of Day of Year raster map [1-366]|False +ParameterRaster|transmissivity_singleway|Name of single-way transmissivity raster map [0.0-1.0]False +ParameterRaster|water_availability|Value of water availability raster map [0.0-1.0]|False +OutputRaster|output|Biomass diff --git a/python/plugins/processing/algs/grass7/description/i.cca.txt b/python/plugins/processing/algs/grass7/description/i.cca.txt new file mode 100644 index 000000000000..7492fcb00acf --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.cca.txt @@ -0,0 +1,6 @@ +i.cca +Canonical components analysis (CCA) program for image processing. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters (2 to 8)|3|False +ParameterFile|signature|File containing spectral signatures|False|False +OutputDirectory|output|Output Directory diff --git a/python/plugins/processing/algs/grass7/description/i.cluster.txt b/python/plugins/processing/algs/grass7/description/i.cluster.txt new file mode 100644 index 000000000000..cf3048ac779f --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.cluster.txt @@ -0,0 +1,13 @@ +i.cluster +Generates spectral signatures for land cover types in an image using a clustering algorithm. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters|3|False +ParameterNumber|classes|Initial number of classes (1-255)|1|255|1|True +ParameterFile|seed|Name of file containing initial signatures|False|True +ParameterString|sample|Sampling intervals (by row and col)|None|False|True +ParameterNumber|iterations|Maximum number of iterations|1|None|30|True +ParameterNumber|convergence|Percent convergence|0.0|100.0|98.0|True +ParameterNumber|separation|Cluster separation|0.0|None|0.0|True +ParameterNumber|min_size|Minimum number of pixels in a class|1|None|17|True +OutputFile|signaturefile|Signature File +OutputFile|reportfile|Final Report File diff --git a/python/plugins/processing/algs/grass7/description/i.colors.enhance.txt b/python/plugins/processing/algs/grass7/description/i.colors.enhance.txt new file mode 100644 index 000000000000..4a931c6132d5 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.colors.enhance.txt @@ -0,0 +1,15 @@ +i.colors.enhance +Performs auto-balancing of colors for RGB images. +Imagery (i.*) +ParameterRaster|red|Name of red channel|False +ParameterRaster|green|Name of green channel|False +ParameterRaster|blue|Name of blue channel|False +ParameterNumber|strength|Cropping intensity (upper brightness level)|0|100|98|True +*ParameterBoolean|-f|Extend colors to full range of data on each channel|False +*ParameterBoolean|-p|Preserve relative colors, adjust brightness only|False +*ParameterBoolean|-r|Reset to standard color range|False +*ParameterBoolean|-s|Process bands serially (default: run in parallel)|False +OutputRaster|redoutput|Enhanced Red +OutputRaster|greenoutput|Enhanced Green +OutputRaster|blueoutput|Enhanced Blue + diff --git a/python/plugins/processing/algs/grass7/description/i.eb.eta.txt b/python/plugins/processing/algs/grass7/description/i.eb.eta.txt new file mode 100644 index 000000000000..0dabb99c6c5c --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.eb.eta.txt @@ -0,0 +1,7 @@ +i.eb.eta +Actual evapotranspiration for diurnal period (Bastiaanssen, 1995). +Imagery (i.*) +ParameterRaster|netradiationdiurnal|Name of the diurnal net radiation map [W/m2]|False +ParameterRaster|evaporativefraction|Name of the evaporative fraction map|False +ParameterRaster|temperature|Name of the surface skin temperature [K]|False +OutputRaster|output|Evapotranspiration diff --git a/python/plugins/processing/algs/grass7/description/i.eb.evapfr.txt b/python/plugins/processing/algs/grass7/description/i.eb.evapfr.txt new file mode 100644 index 000000000000..c0a3c0cfd433 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.eb.evapfr.txt @@ -0,0 +1,9 @@ +i.eb.evapfr +Computes evaporative fraction (Bastiaanssen, 1995) and root zone soil moisture (Makin, Molden and Bastiaanssen, 2001). +Imagery (i.*) +ParameterRaster|netradiation|Name of Net Radiation raster map [W/m2]|False +ParameterRaster|soilheatflux|Name of soil heat flux raster map [W/m2]|False +ParameterRaster|sensibleheatflux|Name of sensible heat flux raster map [W/m2]|False +Hardcoded|-m +OutputRaster|evaporativefraction|Evaporative Fraction +OutputRaster|soilmoisture|Root Zone Soil Moisture diff --git a/python/plugins/processing/algs/grass7/description/i.eb.hsebal01.coords.txt b/python/plugins/processing/algs/grass7/description/i.eb.hsebal01.coords.txt new file mode 100644 index 000000000000..fb7b8e37817c --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.eb.hsebal01.coords.txt @@ -0,0 +1,15 @@ +i.eb.hsebal01 +i.eb.hsebal01.coords - Computes sensible heat flux iteration SEBAL 01. Inline coordinates +Imagery (i.*) +ParameterRaster|netradiation|Name of instantaneous net radiation raster map [W/m2]|False +ParameterRaster|soilheatflux|Name of instantaneous soil heat flux raster map [W/m2]|False +ParameterRaster|aerodynresistance|Name of aerodynamic resistance to heat momentum raster map [s/m]|False +ParameterRaster|temperaturemeansealevel|Name of altitude corrected surface temperature raster map [K]|False +ParameterNumber|frictionvelocitystar|Value of the height independent friction velocity (u*) [m/s]|0.0|None|0.32407|False +ParameterNumber|vapourpressureactual|Value of the actual vapour pressure (e_act) [KPa]|0.0|None|1.511|False +ParameterString|row_wet_pixel|Row value of the wet pixel|None|False|False +ParameterString|column_wet_pixel|Column value of the wet pixel|None|False|False +ParameterString|row_dry_pixel|Row value of the dry pixel|None|False|False +ParameterString|column_dry_pixel|Column value of the dry pixel|None|False|False +*ParameterBoolean|-c|Dry/Wet pixels coordinates are in image projection, not row/col|False +OutputRaster|output|Sensible Heat Flux diff --git a/python/plugins/processing/algs/grass7/description/i.eb.hsebal01.txt b/python/plugins/processing/algs/grass7/description/i.eb.hsebal01.txt new file mode 100644 index 000000000000..3f70ca78ab2a --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.eb.hsebal01.txt @@ -0,0 +1,11 @@ +i.eb.hsebal01 +Computes sensible heat flux iteration SEBAL 01. +Imagery (i.*) +ParameterRaster|netradiation|Name of instantaneous net radiation raster map [W/m2]|False +ParameterRaster|soilheatflux|Name of instantaneous soil heat flux raster map [W/m2]|False +ParameterRaster|aerodynresistance|Name of aerodynamic resistance to heat momentum raster map [s/m]|False +ParameterRaster|temperaturemeansealevel|Name of altitude corrected surface temperature raster map [K]|False +ParameterNumber|frictionvelocitystar|Value of the height independent friction velocity (u*) [m/s]|0.0|None|0.32407|False +ParameterNumber|vapourpressureactual|Value of the actual vapour pressure (e_act) [KPa]|0.0|None|1.511|False +Hardcoded|-a +OutputRaster|output|Sensible Heat Flux diff --git a/python/plugins/processing/algs/grass7/description/i.eb.netrad.txt b/python/plugins/processing/algs/grass7/description/i.eb.netrad.txt new file mode 100644 index 000000000000..7fec8da8c71e --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.eb.netrad.txt @@ -0,0 +1,13 @@ +i.eb.netrad +Net radiation approximation (Bastiaanssen, 1995). +Imagery (i.*) +ParameterRaster|albedo|Name of albedo raster map [0.0;1.0]|False +ParameterRaster|ndvi|Name of NDVI raster map [-1.0;+1.0]|False +ParameterRaster|temperature|Name of surface temperature raster map [K]|False +ParameterRaster|localutctime|Name of time of satellite overpass raster map [local time in UTC]|False +ParameterRaster|temperaturedifference2m|Name of the difference map of temperature from surface skin to about 2 m height [K]|False +ParameterRaster|emissivity|Name of the emissivity map [-]|False +ParameterRaster|transmissivity_singleway|Name of the single-way atmospheric transmissivitymap [-]|False +ParameterRaster|dayofyear|Name of the Day Of Year (DOY) map [-]|False +ParameterRaster|sunzenithangle|Name of the sun zenith angle map [degrees]|False +OutputRaster|output|Net Radiation diff --git a/python/plugins/processing/algs/grass7/description/i.eb.soilheatflux.txt b/python/plugins/processing/algs/grass7/description/i.eb.soilheatflux.txt new file mode 100644 index 000000000000..da6e0138e7d8 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.eb.soilheatflux.txt @@ -0,0 +1,10 @@ +i.eb.soilheatflux +Soil heat flux approximation (Bastiaanssen, 1995). +Imagery (i.*) +ParameterRaster|albedo|Name of albedo raster map [0.0;1.0]|False +ParameterRaster|ndvi|Name of NDVI raster map [-1.0;+1.0]|False +ParameterRaster|temperature|Name of Surface temperature raster map [K]|False +ParameterRaster|netradiation|Name of Net Radiation raster map [W/m2]|False +ParameterRaster|localutctime|Name of time of satellite overpass raster map [local time in UTC]|False +ParameterBoolean|-r|HAPEX-Sahel empirical correction (Roerink, 1995)|False +OutputRaster|output|Soil Heat Flux diff --git a/python/plugins/processing/algs/grass7/description/i.emissivity.txt b/python/plugins/processing/algs/grass7/description/i.emissivity.txt new file mode 100644 index 000000000000..1510b9dcec07 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.emissivity.txt @@ -0,0 +1,5 @@ +i.emissivity +Computes emissivity from NDVI, generic method for sparse land. +Imagery (i.*) +ParameterRaster|input|Name of NDVI raster map [-]|False +OutputRaster|output|Emissivity diff --git a/python/plugins/processing/algs/grass7/description/i.evapo.mh.txt b/python/plugins/processing/algs/grass7/description/i.evapo.mh.txt new file mode 100644 index 000000000000..a6b740d211b3 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.evapo.mh.txt @@ -0,0 +1,12 @@ +i.evapo.mh +Computes evapotranspiration calculation modified or original Hargreaves formulation, 2001. +Imagery (i.*) +ParameterRaster|netradiation_diurnal|Name of input diurnal net radiation raster map [W/m2/d]|False +ParameterRaster|average_temperature|Name of input average air temperature raster map [C]|False +ParameterRaster|minimum_temperature|Name of input minimum air temperature raster map [C]|False +ParameterRaster|maximum_temperature|Name of input maximum air temperature raster map [C]|False +ParameterRaster|precipitation|Name of precipitation raster map [mm/month]|True +*ParameterBoolean|-z|Set negative ETa to zero|False +*ParameterBoolean|-h|Use original Hargreaves (1985)|False +*ParameterBoolean|-s|Use Hargreaves-Samani (1985)|False +OutputRaster|output|Evapotranspiration diff --git a/python/plugins/processing/algs/grass7/description/i.evapo.pm.txt b/python/plugins/processing/algs/grass7/description/i.evapo.pm.txt new file mode 100644 index 000000000000..aef1d96312f1 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.evapo.pm.txt @@ -0,0 +1,12 @@ +i.evapo.pm +Computes potential evapotranspiration calculation with hourly Penman-Monteith. +Imagery (i.*) +ParameterRaster|elevation|Name of input elevation raster map [m a.s.l.]|False +ParameterRaster|temperature|Name of input temperature raster map [C]|False +ParameterRaster|relativehumidity|Name of input relative humidity raster map [%]|False +ParameterRaster|windspeed|Name of input wind speed raster map [m/s]|False +ParameterRaster|netradiation|Name of input net solar radiation raster map [MJ/m2/h]|False +ParameterRaster|cropheight|Name of input crop height raster map [m]|False +*ParameterBoolean|-z|Set negative ETa to zero|False +*ParameterBoolean|-n|Use Night-time|False +OutputRaster|output|Evapotranspiration diff --git a/python/plugins/processing/algs/grass7/description/i.evapo.pt.txt b/python/plugins/processing/algs/grass7/description/i.evapo.pt.txt new file mode 100644 index 000000000000..0fdc44bda878 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.evapo.pt.txt @@ -0,0 +1,10 @@ +i.evapo.pt +Computes evapotranspiration calculation Priestley and Taylor formulation, 1972. +Imagery (i.*) +ParameterRaster|net_radiation|Name of input net radiation raster map [W/m2]|False +ParameterRaster|soil_heatflux|Name of input soil heat flux raster map [W/m2]|False +ParameterRaster|air_temperature|Name of input air temperature raster map [K]|False +ParameterRaster|atmospheric_pressure|Name of input atmospheric pressure raster map [millibars]|False +ParameterNumber|priestley_taylor_coeff|Priestley-Taylor coefficient|0.0|None|1.26|False +*ParameterBoolean|-z|Set negative ETa to zero|False +OutputRaster|output|Evapotranspiration diff --git a/python/plugins/processing/algs/grass7/description/i.evapo.time.txt b/python/plugins/processing/algs/grass7/description/i.evapo.time.txt new file mode 100644 index 000000000000..5991dc97aeba --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.evapo.time.txt @@ -0,0 +1,10 @@ +i.evapo.time +Computes temporal integration of satellite ET actual (ETa) following the daily ET reference (ETo) from meteorological station(s). +Imagery (i.*) +ParameterMultipleInput|eta|Names of satellite ETa raster maps [mm/d or cm/d]|3|False +ParameterMultipleInput|eta_doy|Names of satellite ETa Day of Year (DOY) raster maps [0-400] [-]|3|False +ParameterMultipleInput|eto|Names of meteorological station ETo raster maps [0-400] [mm/d or cm/d]|3|False +ParameterNumber|eto_doy_min|Value of DOY for ETo first day|0|366|1|False +ParameterNumber|start_period|Value of DOY for the first day of the period studied|0|366|1|False +ParameterNumber|end_period|Value of DOY for the last day of the period studied|0|366|1|False +OutputRaster|output|Temporal integration diff --git a/python/plugins/processing/algs/grass7/description/i.gensig.txt b/python/plugins/processing/algs/grass7/description/i.gensig.txt new file mode 100644 index 000000000000..8b95d602bf7d --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.gensig.txt @@ -0,0 +1,7 @@ +i.gensig +Generates statistics for i.maxlik from raster map. +Imagery (i.*) +ParameterRaster|trainingmap|Ground truth training map|False +ParameterMultipleInput|input|Input rasters|3|False +OutputFile|signaturefile|Signature File + diff --git a/python/plugins/processing/algs/grass7/description/i.gensigset.txt b/python/plugins/processing/algs/grass7/description/i.gensigset.txt new file mode 100644 index 000000000000..b7d4ec7598d4 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.gensigset.txt @@ -0,0 +1,8 @@ +i.gensigset +Generates statistics for i.smap from raster map. +Imagery (i.*) +ParameterRaster|trainingmap|Ground truth training map|False +ParameterMultipleInput|input|Input rasters|3|False +ParameterNumber|maxsig|Maximum number of sub-signatures in any class|1|None|5|True +OutputFile|signaturefile|Signature File + diff --git a/python/plugins/processing/algs/grass7/description/i.group.txt b/python/plugins/processing/algs/grass7/description/i.group.txt new file mode 100644 index 000000000000..43296b0ab5d4 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.group.txt @@ -0,0 +1,6 @@ +i.group +Regroup multiple mono-band rasters into a single multiband raster. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters|3|False +OutputRaster|group|Multiband raster + diff --git a/python/plugins/processing/algs/grass7/description/i.image.mosaic.txt b/python/plugins/processing/algs/grass7/description/i.image.mosaic.txt new file mode 100644 index 000000000000..ec620e785910 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.image.mosaic.txt @@ -0,0 +1,6 @@ +i.image.mosaic +Mosaics several images and extends colormap. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters|3|False +OutputRaster|output|Mosaic Raster + diff --git a/python/plugins/processing/algs/grass7/description/i.in.spotvgt.txt b/python/plugins/processing/algs/grass7/description/i.in.spotvgt.txt new file mode 100644 index 000000000000..1f47a9758174 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.in.spotvgt.txt @@ -0,0 +1,7 @@ +i.in.spotvgt +Imports SPOT VGT NDVI data into a raster map. +Imagery (i.*) +ParameterRaster|input|Name of input SPOT VGT NDVI HDF file|False +*ParameterBoolean|-a|Also import quality map (SM status map layer) and filter NDVI map|False +OutputRaster|output|SPOT NDVI Raster + diff --git a/python/plugins/processing/algs/grass7/description/i.landsat.acca.txt b/python/plugins/processing/algs/grass7/description/i.landsat.acca.txt new file mode 100644 index 000000000000..4b7e8f23bdb4 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.landsat.acca.txt @@ -0,0 +1,14 @@ +i.landsat.acca +Performs Landsat TM/ETM+ Automatic Cloud Cover Assessment (ACCA). +Imagery (i.*) +ParameterMultipleInput|rasters|Landsat input rasters|3|False +ParameterNumber|b56composite|B56composite (step 6)|0|None|225|True +ParameterNumber|b45ratio|B45ratio: Desert detection (step 10)|0|None|1|True +ParameterNumber|histogram|Number of classes in the cloud temperature histogram|0|None|100|True +*ParameterBoolean|-5|Data is Landsat-5 TM|False +*ParameterBoolean|-f|Apply post-processing filter to remove small holes|False +*ParameterBoolean|-x|Always use cloud signature (step 14)|False +*ParameterBoolean|-2|Bypass second-pass processing, and merge warm (not ambiguous) and cold clouds|False +*ParameterBoolean|-s|Include a category for cloud shadows|False +OutputRaster|output|ACCA Raster + diff --git a/python/plugins/processing/algs/grass7/description/i.landsat.toar.txt b/python/plugins/processing/algs/grass7/description/i.landsat.toar.txt new file mode 100644 index 000000000000..6c9ad52d40f8 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.landsat.toar.txt @@ -0,0 +1,19 @@ +i.landsat.toar +Calculates top-of-atmosphere radiance or reflectance and temperature for Landsat MSS/TM/ETM+/OLI +Imagery (i.*) +ParameterMultipleInput|rasters|Landsat input rasters|3|False +ParameterFile|metfile|Name of Landsat metadata file (.met or MTL.txt)|False|True +ParameterSelection|sensor|Spacecraft sensor|mss1;mss2;mss3;mss4;mss5;tm4;tm5;tm7;oli8|7 +ParameterSelection|method|Atmospheric correction method|uncorrected;dos1;dos2;dos2b;dos3;dos4|0 +ParameterString|date|Image acquisition date (yyyy-mm-dd)|None|False|True +ParameterString|sun_elevation|Sun elevation in degrees|None|False|True +ParameterString|product_date|Image creation date (yyyy-mm-dd)|None|False|True +ParameterString|gain|Gain (H/L) of all Landsat ETM+ bands (1-5,61,62,7,8)|None|False|True +ParameterNumber|percent|Percent of solar radiance in path radiance|0.0|100.0|0.01|True +ParameterNumber|pixel|Minimum pixels to consider digital number as dark object|0|None|1000|True +ParameterNumber|rayleigh|Rayleigh atmosphere (diffuse sky irradiance)|0.0|None|0.0|True +ParameterNumber|scale|Scale factor for output|1.0|None|1.0|True +*ParameterBoolean|-r|Output at-sensor radiance instead of reflectance for all bands|False +*ParameterBoolean|-n|Input raster maps use as extension the number of the band instead the code|False +OutputDirectory|output|Output Directory + diff --git a/python/plugins/processing/algs/grass7/description/i.maxlik.txt b/python/plugins/processing/algs/grass7/description/i.maxlik.txt new file mode 100644 index 000000000000..bc060085141c --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.maxlik.txt @@ -0,0 +1,7 @@ +i.maxlik +Classifies the cell spectral reflectances in imagery data. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters|3|False +ParameterFile|signaturefile|Name of input file containing signatures|False|False +OutputRaster|output|Classification +OutputRaster|reject|Reject Threshold diff --git a/python/plugins/processing/algs/grass7/description/i.modis.qc.txt b/python/plugins/processing/algs/grass7/description/i.modis.qc.txt new file mode 100644 index 000000000000..d13dc5b965cd --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.modis.qc.txt @@ -0,0 +1,9 @@ +i.modis.qc +Extracts quality control parameters from MODIS QC layers. +Imagery (i.*) +ParameterRaster|input|Name of input surface reflectance QC layer [bit array]|False +ParameterSelection|productname|Name of MODIS product type|mod09Q1;mod09A1;mod09A1s;mod09CMG;mod09CMGs;mod09CMGi;mod11A1;mod11A2;mod13A2;mcd43B2;mcd43B2q|8 +ParameterSelection|qcname|Name of QC type to extract|adjcorr;atcorr;cloud;data_quality;diff_orbit_from_500m;modland_qa;mandatory_qa_11A1;data_quality_flag_11A1;emis_error_11A1;lst_error_11A1;data_quality_flag_11A2;emis_error_11A2;mandatory_qa_11A2;lst_error_11A2;aerosol_quantity;brdf_correction_performed;cirrus_detected;cloud_shadow;cloud_state;internal_cloud_algorithm;internal_fire_algorithm;internal_snow_mask;land_water;mod35_snow_ice;pixel_adjacent_to_cloud;icm_cloudy;icm_clear;icm_high_clouds;icm_low_clouds;icm_snow;icm_fire;icm_sun_glint;icm_dust;icm_cloud_shadow;icm_pixel_is_adjacent_to_cloud;icm_cirrus;icm_pan_flag;icm_criteria_for_aerosol_retrieval;icm_aot_has_clim_val;modland_qa;vi_usefulness;aerosol_quantity;pixel_adjacent_to_cloud;brdf_correction_performed;mixed_clouds;land_water;possible_snow_ice;possible_shadow;platform;land_water;sun_z_angle_at_local_noon;brdf_correction_performed|5 +ParameterString|band|Band number of MODIS product (mod09Q1=[1,2],mod09A1=[1-7],m[o/y]d09CMG=[1-7], mcd43B2q=[1-7])|None|False|True +OutputRaster|output|QC Classification + diff --git a/python/plugins/processing/algs/grass7/description/i.oif.txt b/python/plugins/processing/algs/grass7/description/i.oif.txt new file mode 100644 index 000000000000..c5e5677ec216 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.oif.txt @@ -0,0 +1,8 @@ +i.oif +Calculates Optimum-Index-Factor table for spectral bands +Imagery (i.*) +ParameterMultipleInput|input|Name of input raster map(s)|3|False +*ParameterBoolean|-g|Print in shell script style|False +*ParameterBoolean|-s|Process bands serially (default: run in parallel)|False +OutputFile|output|OIF File + diff --git a/python/plugins/processing/algs/grass7/description/i.pansharpen.txt b/python/plugins/processing/algs/grass7/description/i.pansharpen.txt new file mode 100644 index 000000000000..e945b24d6475 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.pansharpen.txt @@ -0,0 +1,14 @@ +i.pansharpen +Image fusion algorithms to sharpen multispectral with high-res panchromatic channels +Imagery (i.*) +ParameterRaster|red|Name of red channel|False +ParameterRaster|green|Name of green channel|False +ParameterRaster|blue|Name of blue channel|False +ParameterRaster|pan|Name of raster map to be used for high resolution panchromatic channel|False +ParameterSelection|method|Method|brovey;ihs;pca|1 +*ParameterBoolean|-l|Rebalance blue channel for LANDSAT|False +*ParameterBoolean|-s|Process bands serially (default: run in parallel)|False +OutputRaster|redoutput|Enhanced Red +OutputRaster|greenoutput|Enhanced Green +OutputRaster|blueoutput|Enhanced Blue + diff --git a/python/plugins/processing/algs/grass7/description/i.pca.txt b/python/plugins/processing/algs/grass7/description/i.pca.txt new file mode 100644 index 000000000000..d4351af75047 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.pca.txt @@ -0,0 +1,10 @@ +i.pca +Principal components analysis (PCA) for image processing. +Imagery (i.*) +ParameterMultipleInput|input|Name of two or more input raster maps|3|False +ParameterString|rescale|Rescaling range for output maps. For no rescaling use 0,0|0,255|False|True +ParameterNumber|percent|Cumulative percent importance for filtering|50.0|99.0|99.0|True +*ParameterBoolean|-n|Normalize (center and scale) input maps|False +*ParameterBoolean|-f|Output will be filtered input bands|False +OutputDirectory|output|Output Directory + diff --git a/python/plugins/processing/algs/grass7/description/i.rectify.txt b/python/plugins/processing/algs/grass7/description/i.rectify.txt new file mode 100644 index 000000000000..9713451c8d55 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.rectify.txt @@ -0,0 +1,14 @@ +i.rectify +Rectifies an image by computing a coordinate transformation for each pixel in the image based on the control points. +Imagery (i.*) +ParameterMultipleInput|rasters|Name of raster maps to rectify|3|False +ParameterFile|gcp|Ground Control Points file|False|False +ParameterSelection|order|Rectification polynomial order|1;2;3|0 +ParameterString|resolution|Target resolution|None|False|True +ParameterNumber|memory|Amount of memory to use in MB|1|None|300|True +ParameterSelection|method|Interpolation method to use|nearest;linear;cubic;lanczos;linear_f;cubic_f;lanczos_f|0 +ParameterCrs|crs|Destination CRS|None|False +Hardcoded|extension=rectified +*ParameterBoolean|-t|Use thin plate spline|False +OutputDirectory|output|Output Directory + diff --git a/python/plugins/processing/algs/grass7/description/i.segment.txt b/python/plugins/processing/algs/grass7/description/i.segment.txt new file mode 100644 index 000000000000..a66fb8664218 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.segment.txt @@ -0,0 +1,16 @@ +i.segment +Identifies segments (objects) from imagery data. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters|3|False +ParameterNumber|threshold|Difference threshold between 0 and 1|0.0|1.0|0.5|False +ParameterSelection|method|Segmentation method|region_growing|0 +ParameterSelection|similarity|Similarity calculation method|euclidean;manhattan|0 +ParameterNumber|minsize|Minimum number of cells in a segment|1|100000|1|True +ParameterNumber|memory|Amount of memory to use in MB|1|None|300|True +ParameterNumber|iterations|Maximum number of iterations|1|None|20|True +ParameterRaster|seeds|Name for input raster map with starting seeds|True +ParameterRaster|bounds|Name of input bounding/constraining raster map|True +*ParameterBoolean|-d|Use 8 neighbors (3x3 neighborhood) instead of the default 4 neighbors for each pixel|False +*ParameterBoolean|-w|Weighted input, do not perform the default scaling of input raster maps|False +OutputRaster|output|Segmented Raster +OutputRaster|goodness|Goodness Raster diff --git a/python/plugins/processing/algs/grass7/description/i.smap.txt b/python/plugins/processing/algs/grass7/description/i.smap.txt new file mode 100644 index 000000000000..67250d02b4b5 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.smap.txt @@ -0,0 +1,9 @@ +i.smap +Performs contextual image classification using sequential maximum a posteriori (SMAP) estimation. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters|3|False +ParameterFile|signaturefile|Name of input file containing signatures|False|False +ParameterNumber|blocksize|Size of submatrix to process at one time|1|None|1024|True +*ParameterBoolean|-m|Use maximum likelihood estimation (instead of smap)|False +OutputRaster|output|Classification +OutputRaster|goodness|Goodness_of_fit diff --git a/python/plugins/processing/algs/grass7/description/i.tasscap.txt b/python/plugins/processing/algs/grass7/description/i.tasscap.txt new file mode 100644 index 000000000000..1caab8aa33f7 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.tasscap.txt @@ -0,0 +1,6 @@ +i.tasscap +Performs Tasseled Cap (Kauth Thomas) transformation. +Imagery (i.*) +ParameterMultipleInput|input|Input rasters. Landsat4-7: bands 1,2,3,4,5,7; Landsat8: bands 2,3,4,5,6,7; MODIS: bands 1,2,3,4,5,6,7|3|False +ParameterSelection|sensor|Satellite sensor|landsat4_tm;landsat5_tm;landsat7_etm;landsat8_oli;modis|0 +OutputDirectory|output|Output Directory diff --git a/python/plugins/processing/algs/grass7/description/i.topo.corr.ill.txt b/python/plugins/processing/algs/grass7/description/i.topo.corr.ill.txt new file mode 100644 index 000000000000..9982db8bcac1 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.topo.corr.ill.txt @@ -0,0 +1,8 @@ +i.topo.corr +i.topo.coor.ill - Creates illumination model for topographic correction of reflectance. +Imagery (i.*) +ParameterRaster|basemap|Name of elevation raster map|False +ParameterNumber|zenith|Solar zenith in degrees|0.0|360.0|0.0|False +ParameterNumber|azimuth|Solar azimuth in degrees|0.0|360.0|0.0|False +Hardcoded|-i +OutputRaster|output|Illumination Model diff --git a/python/plugins/processing/algs/grass7/description/i.topo.corr.txt b/python/plugins/processing/algs/grass7/description/i.topo.corr.txt new file mode 100644 index 000000000000..fb53a95d2b54 --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.topo.corr.txt @@ -0,0 +1,9 @@ +i.topo.corr +Computes topographic correction of reflectance. +Imagery (i.*) +ParameterMultipleInput|input|Name of reflectance raster maps to be corrected topographically|3|False +ParameterRaster|basemap|Name of illumination input base raster map|False +ParameterNumber|zenith|Solar zenith in degrees|0.0|360.0|0.0|False +ParameterSelection|method|Topographic correction method|cosine;minnaert;c-factor;percent|0 +*ParameterBoolean|-s|Scale output to input and copy color rules|False +OutputDirectory|output|Output Directory diff --git a/python/plugins/processing/algs/grass7/description/i.vi.txt b/python/plugins/processing/algs/grass7/description/i.vi.txt new file mode 100644 index 000000000000..6359a3959dfd --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.vi.txt @@ -0,0 +1,15 @@ +i.vi +Calculates different types of vegetation indices. +Imagery (i.*) +ParameterRaster|red|Name of input red channel surface reflectance map [0.0-1.0]|True +ParameterSelection|viname|Type of vegetation index|arvi;dvi;evi;evi2;gvi;gari;gemi;ipvi;msavi;msavi2;ndvi;pvi;savi;sr;vari;wdvi|10 +ParameterRaster|nir|Name of input nir channel surface reflectance map [0.0-1.0]|True +ParameterRaster|green|Name of input green channel surface reflectance map [0.0-1.0]|True +ParameterRaster|blue|Name of input blue channel surface reflectance map [0.0-1.0]|True +ParameterRaster|band5|Name of input 5th channel surface reflectance map [0.0-1.0]|True +ParameterRaster|band7|Name of input 7th channel surface reflectance map [0.0-1.0]|True +ParameterString|soil_line_slope|Value of the slope of the soil line (MSAVI2 only)|None|False|True +ParameterString|soil_line_intercept|Value of the factor of reduction of soil noise (MSAVI2 only)|None|False|True +ParameterString|soil_noise_reduction|Value of the slope of the soil line (MSAVI2 only)|None|False|True +ParameterSelection|storage_bit|Maximum bits for digital numbers|7;8;9;10;16|1 +OutputRaster|output|Vegetation Index diff --git a/python/plugins/processing/algs/grass7/ext/i.py b/python/plugins/processing/algs/grass7/ext/i.py new file mode 100644 index 000000000000..3b58250e8f7b --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i.py + ---- + Date : April 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : mederic dot ribreux at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'April 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from processing.core.parameters import ParameterRaster, getParameterFromString +from processing.tools.system import isWindows +from ..Grass7Utils import Grass7Utils +from os import path + + +def multipleOutputDir(alg, field, basename=None): + """ + Handle multiple output of rasters into a + directory. + """ + # We need to know where is the output directory + outputDir = alg.getOutputValue(field) + + # We need to grab the variable basename + if basename: + commands = ["for r in $(g.list type=rast pattern='{}*'); do".format(basename)] + # Otherwise, export everything + else: + commands = ["for r in $(g.list type=rast); do".format(basename)] + commands.append(" r.out.gdal -c -t -f input=${{r}} output={}/${{r}}.tif createopt=\"TFW=YES,COMPRESS=LZW\"".format(outputDir)) + commands.append("done") + alg.commands.extend(commands) + alg.outputCommands.extend(commands) + + +def orderedInput(alg, inputParameter, targetParameterDef, numSeq=None): + """Inport multiple rasters in the order""" + rasters = alg.getParameterValue(inputParameter).split(';') + # TODO: make targetParameter + inputParameter = getParameterFromString(targetParameterDef) + rootFilename = '{}_'.format(alg.getTempFilename()) + inputParameter.value = rootFilename + alg.addParameter(inputParameter) + # Handle specific range + if numSeq is None: + numSeq = range(1, len(rasters) + 1) + + for idx in range(len(rasters)): + layer = rasters[idx] + if layer in alg.exportedLayers.keys(): + continue + else: + destFilename = '{}{}'.format(rootFilename, numSeq[idx]) + alg.setSessionProjectionFromLayer(layer, alg.commands) + alg.exportedLayers[layer] = destFilename + command = 'r.external input={} band=1 output={} --overwrite -o'.format(layer, destFilename) + alg.commands.append(command) + + alg.setSessionProjectionFromProject(alg.commands) + + region = \ + unicode(alg.getParameterValue(alg.GRASS_REGION_EXTENT_PARAMETER)) + regionCoords = region.split(',') + command = 'g.region' + command += ' -a' + command += ' n=' + unicode(regionCoords[3]) + command += ' s=' + unicode(regionCoords[2]) + command += ' e=' + unicode(regionCoords[1]) + command += ' w=' + unicode(regionCoords[0]) + cellsize = alg.getParameterValue(alg.GRASS_REGION_CELLSIZE_PARAMETER) + if cellsize: + command += ' res=' + unicode(cellsize) + else: + command += ' res=' + unicode(alg.getDefaultCellsize()) + alignToResolution = \ + alg.getParameterValue(alg.GRASS_REGION_ALIGN_TO_RESOLUTION) + if alignToResolution: + command += ' -a' + alg.commands.append(command) + return rootFilename + + +def regroupRasters(alg, field, groupField, subgroupField=None, extFile=None): + """ + Group multiple input rasters into a group + * If there is a subgroupField, a subgroup will automatically created. + * When an external file is provided, the file is copied into the respective + directory of the subgroup. + * extFile is a dict of the form 'parameterName':'directory name'. + """ + # List of rasters names + rasters = alg.getParameterFromName(field) + rastersList = rasters.value.split(';') + alg.parameters.remove(rasters) + + # Insert a i.group command + group = getParameterFromString("ParameterString|{}|group of rasters|None|False|False".format(groupField)) + group.value = alg.getTempFilename() + alg.addParameter(group) + + if subgroupField: + subgroup = getParameterFromString("ParameterString|{}|subgroup of rasters|None|False|False".format(subgroupField)) + subgroup.value = alg.getTempFilename() + alg.addParameter(subgroup) + + command = 'i.group group={}{} input={}'.format( + group.value, + ' subgroup={}'.format(subgroup.value) if subgroupField else '', + ','.join([alg.exportedLayers[f] for f in rastersList]) + ) + alg.commands.append(command) + + # Handle external files + origExtParams = {} + if subgroupField and extFile: + for ext in extFile.keys(): + extFileName = alg.getParameterValue(ext) + if extFileName: + shortFileName = path.basename(extFileName) + destPath = path.join(Grass7Utils.grassMapsetFolder(), + 'PERMANENT', + 'group', group.value, + 'subgroup', subgroup.value, + extFile[ext], shortFileName) + copyFile(alg, extFileName, destPath) + origExtParams[ext] = extFileName + alg.setParameterValue(ext, shortFileName) + + # modify parameters values + alg.processCommand() + + # Re-add input rasters + alg.addParameter(rasters) + + # replace external files value with original value + for param in origExtParams.keys(): + alg.setParameterValue(param, origExtParams[param]) + + # Delete group: + alg.parameters.remove(group) + if subgroupField: + alg.parameters.remove(subgroup) + return group.value, subgroup.value + + return group.value + + +def exportInputRasters(alg, rasterDic): + """ + Export input rasters + Use a dict to make input/output link: + { 'inputName1': 'outputName1', 'inputName2': 'outputName2'} + """ + # Get inputs and outputs + for inputName, outputName in rasterDic.iteritems(): + inputRaster = alg.getParameterValue(inputName) + outputRaster = alg.getOutputFromName(outputName) + command = 'r.out.gdal -c -t -f --overwrite createopt="TFW=YES,COMPRESS=LZW" input={} output=\"{}\"'.format( + alg.exportedLayers[inputRaster], + outputRaster.value + ) + alg.commands.append(command) + alg.outputCommands.append(command) + + +def verifyRasterNum(alg, rasters, mini, maxi=None): + """Verify if we have at least n rasters in multipleInput""" + num = len(alg.getParameterValue(rasters).split(';')) + if num < mini: + return 'You need to set at least {} input rasters for this algorithm!'.format(mini) + if maxi and num > maxi: + return 'You need to set a maximum of {} input rasters for this algorithm!'.format(maxi) + return None + + +def file2Output(alg, output): + """Transform an OutputFile to a parameter""" + # Get the outputFile + outputFile = alg.getOutputFromName(output) + alg.removeOutputFromName(output) + + # Create output parameter + param = getParameterFromString("ParameterString|{}|output file|None|False|False".format(output)) + param.value = outputFile.value + alg.addParameter(param) + + return outputFile + + +def createDestDir(alg, toFile): + """ Generates an mkdir command for GRASS7 script """ + # Creates the destination directory + command = "{} {}".format( + "MD" if isWindows() else "mkdir -p", + path.dirname(toFile) + ) + alg.commands.append(command) + + +def moveFile(alg, fromFile, toFile): + """ Generates a move command for GRASS7 script """ + createDestDir(alg, toFile) + command = "{} {} {}".format( + "MOVE /Y" if isWindows() else "mv -f", + fromFile, + toFile + ) + alg.commands.append(command) + + +def copyFile(alg, fromFile, toFile): + """ Generates a copy command for GRASS7 script """ + createDestDir(alg, toFile) + command = "{} {} {}".format( + "COPY /Y" if isWindows() else "cp -f", + fromFile, + toFile) + alg.commands.append(command) diff --git a/python/plugins/processing/algs/grass7/ext/i_albedo.py b/python/plugins/processing/algs/grass7/ext/i_albedo.py new file mode 100644 index 000000000000..423eafd31696 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_albedo.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_albedo.py + ----------- + Date : February 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import verifyRasterNum + + +def checkParameterValuesBeforeExecuting(alg): + if alg.getParameterValue('-m'): + return verifyRasterNum(alg, 'input', 7) + elif alg.getParameterValue('-n'): + return verifyRasterNum(alg, 'input', 2) + elif alg.getParameterValue('-l') or alg.getParameterValue('-a'): + return verifyRasterNum(alg, 'input', 6) + return None diff --git a/python/plugins/processing/algs/grass7/ext/i_aster_toar.py b/python/plugins/processing/algs/grass7/ext/i_aster_toar.py new file mode 100644 index 000000000000..d0aac7027042 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_aster_toar.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_aster_toar.py + --------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import multipleOutputDir +from processoing.core.parameters import getParameterFromString + + +def processCommand(alg): + # Remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Create output parameter + param = getParameterFromString("ParameterString|output|output basename|None|False|False") + param.value = alg.getTempFilename() + alg.addParameter(param) + + alg.processCommand() + # re-add output + alg.addOutput(output) + + +def processOutputs(alg): + param = alg.getParameterFromName('output') + multipleOutputDir(alg, 'output', param.value) + + # Delete output parameter + alg.parameters.remove(param) diff --git a/python/plugins/processing/algs/grass7/ext/i_cca.py b/python/plugins/processing/algs/grass7/ext/i_cca.py new file mode 100644 index 000000000000..d2b7a2cd0d62 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_cca.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_cca.py + -------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import multipleOutputDir, verifyRasterNum, regroupRasters +from processing.core.parameters import getParameterFromString + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'input', 2, 8) + + +def processCommand(alg): + # Remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Create output parameter + param = getParameterFromString("ParameterString|output|output basename|None|False|False") + param.value = alg.getTempFilename() + alg.addParameter(param) + + # Regroup rasters + regroupRasters(alg, 'input', 'group', 'subgroup', {'signature': 'sig'}) + + # re-add output + alg.addOutput(output) + + +def processOutputs(alg): + param = alg.getParameterFromName('output') + multipleOutputDir(alg, 'output', param.value) + + # Delete output parameter + alg.parameters.remove(param) diff --git a/python/plugins/processing/algs/grass7/ext/i_cluster.py b/python/plugins/processing/algs/grass7/ext/i_cluster.py new file mode 100644 index 000000000000..dff3b933a122 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_cluster.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_cluster.py + ------------ + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters, file2Output, moveFile, verifyRasterNum +from os import path +from ..Grass7Utils import Grass7Utils + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'input', 2) + + +def processCommand(alg): + # We need to extract the basename of the signature file + signatureFile = alg.getOutputFromName('signaturefile') + origSigFile = signatureFile.value + shortSigFile = path.basename(origSigFile) + alg.setOutputValue('signaturefile', shortSigFile) + + # Transform output files in string parameters + signatureFile = file2Output(alg, 'signaturefile') + reportFile = file2Output(alg, 'reportfile') + + # Regroup rasters + group, subgroup = regroupRasters(alg, 'input', 'group', 'subgroup') + + # Re-add signature files + alg.addOutput(signatureFile) + alg.addOutput(reportFile) + + # Find Grass directory + interSig = path.join(Grass7Utils.grassMapsetFolder(), 'PERMANENT', 'group', group, 'subgroup', subgroup, 'sig', shortSigFile) + moveFile(alg, interSig, origSigFile) + alg.setOutputValue('signaturefile', origSigFile) diff --git a/python/plugins/processing/algs/grass7/ext/i_colors_enhance.py b/python/plugins/processing/algs/grass7/ext/i_colors_enhance.py new file mode 100644 index 000000000000..b5f45dbcf516 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_colors_enhance.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_colors_enhance.py + ------------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import exportInputRasters + + +def processCommand(alg): + + # Temporary remove outputs: + outputs = [alg.getOutputFromName('{}output'.format(f)) for f in ['red', 'green', 'blue']] + for out in outputs: + alg.removeOutputFromName(out.name) + + alg.processCommand() + + # Re-add outputs + for output in outputs: + alg.addOutput(output) + + +def processOutputs(alg): + # Input rasters are output rasters + rasterDic = {'red': 'redoutput', 'green': 'greenoutput', 'blue': 'blueoutput'} + exportInputRasters(alg, rasterDic) diff --git a/python/plugins/processing/algs/grass7/ext/i_evapo_mh.py b/python/plugins/processing/algs/grass7/ext/i_evapo_mh.py new file mode 100644 index 000000000000..b2041239a594 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_evapo_mh.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_evapo_mh.py + ------------- + Date : February 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import verifyRasterNum + + +def checkParameterValuesBeforeExecuting(alg): + if alg.getParameterValue('-h') and alg.getParameterValue('precipitation'): + return alg.tr('You can\'t use original Hargreaves flag and precipitation parameter together!') + if not alg.getParameterValue('-h') and not alg.getParameterValue('precipitation'): + return alg.tr('If you don\'t use original Hargreaves flag, you must set the precipitation raster parameter!') + return None diff --git a/python/plugins/processing/algs/grass7/ext/i_gensig.py b/python/plugins/processing/algs/grass7/ext/i_gensig.py new file mode 100644 index 000000000000..0179472eb64e --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_gensig.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_gensig.py + ----------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters, file2Output, moveFile +from os import path +from ..Grass7Utils import Grass7Utils + + +def processCommand(alg): + # Transform output files in string parameter + signatureFile = alg.getOutputFromName('signaturefile') + origSigFile = signatureFile.value + shortSigFile = path.basename(origSigFile) + alg.setOutputValue('signaturefile', shortSigFile) + + signatureFile = file2Output(alg, 'signaturefile') + + # Regroup rasters + group, subgroup = regroupRasters(alg, 'input', 'group', 'subgroup') + + # Re-add signature files + alg.addOutput(signatureFile) + + # Find Grass directory + interSig = path.join(Grass7Utils.grassMapsetFolder(), 'PERMANENT', 'group', group, 'subgroup', subgroup, 'sig', shortSigFile) + moveFile(alg, interSig, origSigFile) + alg.setOutputValue('signaturefile', origSigFile) diff --git a/python/plugins/processing/algs/grass7/ext/i_gensigset.py b/python/plugins/processing/algs/grass7/ext/i_gensigset.py new file mode 100644 index 000000000000..27a0e7c3ad1b --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_gensigset.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_gensigset.py + -------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters, file2Output, moveFile +from os import path +from ..Grass7Utils import Grass7Utils + + +def processCommand(alg): + # Transform output files in string parameter + signatureFile = alg.getOutputFromName('signaturefile') + origSigFile = signatureFile.value + shortSigFile = path.basename(origSigFile) + alg.setOutputValue('signaturefile', shortSigFile) + + signatureFile = file2Output(alg, 'signaturefile') + + # Regroup rasters + group, subgroup = regroupRasters(alg, 'input', 'group', 'subgroup') + + # Re-add signature files + alg.addOutput(signatureFile) + + # Find Grass directory + interSig = path.join(Grass7Utils.grassMapsetFolder(), 'PERMANENT', 'group', group, 'subgroup', subgroup, 'sigset', shortSigFile) + moveFile(alg, interSig, origSigFile) + alg.setOutputValue('signaturefile', origSigFile) diff --git a/python/plugins/processing/algs/grass7/ext/i_group.py b/python/plugins/processing/algs/grass7/ext/i_group.py new file mode 100644 index 000000000000..7bd2469a04ad --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_group.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_group.py + ---------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import verifyRasterNum + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'input', 2) diff --git a/python/plugins/processing/algs/grass7/ext/i_in_spotvgt.py b/python/plugins/processing/algs/grass7/ext/i_in_spotvgt.py new file mode 100644 index 000000000000..e3293d242536 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_in_spotvgt.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_in_spotvgt.py + --------------- + Date : April 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'April 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + + +def processInputs(alg): + # Here, we apply directly the algorithm + # So we just need to get the projection of the layer ! + layer = alg.getParameterValue('input') + alg.setSessionProjectionFromLayer(layer, alg.commands) diff --git a/python/plugins/processing/algs/grass7/ext/i_landsat_acca.py b/python/plugins/processing/algs/grass7/ext/i_landsat_acca.py new file mode 100644 index 000000000000..cef94b077a01 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_landsat_acca.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_landsat_acca.py + ----------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import verifyRasterNum, orderedInput + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'rasters', 5, 5) + + +def processInputs(alg): + orderedInput(alg, 'rasters', + "ParameterString|input|Base name of input raster bands|None|False|False", + [2, 3, 4, 5, 61]) + + +def processCommand(alg): + # Remove rasters parameter + rasters = alg.getParameterFromName('rasters') + alg.parameters.remove(rasters) + + alg.processCommand() + + # re-add rasters + alg.addParameter(rasters) diff --git a/python/plugins/processing/algs/grass7/ext/i_landsat_toar.py b/python/plugins/processing/algs/grass7/ext/i_landsat_toar.py new file mode 100644 index 000000000000..4e360cd7e52f --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_landsat_toar.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_landsat_toar.py + ----------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import multipleOutputDir, verifyRasterNum, regroupRasters, orderedInput +from processing.core.parameters import getParameterFromString + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'rasters', 5, 12) + + +def processInputs(alg): + orderedInput(alg, 'rasters', + "ParameterString|input|Base name of input raster bands|None|False|False", + [1, 2, 3, 4, 5, 61, 62, 7, 8]) + + +def processCommand(alg): + # Remove rasters parameter + rasters = alg.getParameterFromName('rasters') + alg.parameters.remove(rasters) + + # Remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Create output parameter + param = getParameterFromString("ParameterString|output|output basename|None|False|False") + param.value = '{}_'.format(alg.getTempFilename()) + alg.addParameter(param) + + alg.processCommand() + + # re-add output + alg.addOutput(output) + alg.addParameter(rasters) + + +def processOutputs(alg): + param = alg.getParameterFromName('output') + multipleOutputDir(alg, 'output', param.value) + + # Delete output parameter + alg.parameters.remove(param) diff --git a/python/plugins/processing/algs/grass7/ext/i_maxlik.py b/python/plugins/processing/algs/grass7/ext/i_maxlik.py new file mode 100644 index 000000000000..629a1dc829d7 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_maxlik.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_maxlik.py + ----------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters, file2Output + + +def processCommand(alg): + # Regroup rasters + regroupRasters(alg, 'input', 'group', 'subgroup', {'signaturefile': 'sig'}) diff --git a/python/plugins/processing/algs/grass7/ext/i_oif.py b/python/plugins/processing/algs/grass7/ext/i_oif.py new file mode 100644 index 000000000000..50caeefab9d2 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_oif.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_oif.py + -------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import file2Output, verifyRasterNum + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'input', 4) + + +def processCommand(alg): + # Transform output file in string parameter + oifFile = file2Output(alg, 'output') + + alg.processCommand() + + # Re-add output file + alg.addOutput(oifFile) diff --git a/python/plugins/processing/algs/grass7/ext/i_pansharpen.py b/python/plugins/processing/algs/grass7/ext/i_pansharpen.py new file mode 100644 index 000000000000..eeea0077403b --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_pansharpen.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_pansharpen.py + --------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import exportInputRasters +from processing.core.parameters import ParameterRaster, getParameterFromString + + +def processCommand(alg): + + # Temporary remove outputs: + outputs = [alg.getOutputFromName('{}output'.format(f)) for f in ['red', 'green', 'blue']] + for out in outputs: + alg.removeOutputFromName(out.name) + + # create a false output + base = getParameterFromString('ParameterString|output|Name for output basename raster map(s)|None|False|False') + base.value = alg.getTempFilename() + alg.addParameter(base) + alg.processCommand() + + # Re-add outputs + for output in outputs: + alg.addOutput(output) + + +def processOutputs(alg): + base = alg.getParameterValue('output') + for channel in ['red', 'green', 'blue']: + command = 'r.out.gdal -c -t -f --overwrite createopt="TFW=YES,COMPRESS=LZW" input={} output=\"{}\"'.format( + '{}_{}'.format(base, channel), + alg.getOutputValue('{}output'.format(channel)) + ) + alg.commands.append(command) + alg.outputCommands.append(command) diff --git a/python/plugins/processing/algs/grass7/ext/i_pca.py b/python/plugins/processing/algs/grass7/ext/i_pca.py new file mode 100644 index 000000000000..180da937e705 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_pca.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_pca.py + -------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import multipleOutputDir, verifyRasterNum +from processing.core.parameters import getParameterFromString + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'input', 2) + + +def processCommand(alg): + # Remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Create output parameter + param = getParameterFromString("ParameterString|output|output basename|None|False|False") + param.value = alg.getTempFilename() + alg.addParameter(param) + + alg.processCommand() + # re-add output + alg.addOutput(output) + + +def processOutputs(alg): + param = alg.getParameterFromName('output') + multipleOutputDir(alg, 'output', param.value) + + # Delete output parameter + alg.parameters.remove(param) diff --git a/python/plugins/processing/algs/grass7/ext/i_rectify.py b/python/plugins/processing/algs/grass7/ext/i_rectify.py new file mode 100644 index 000000000000..092d5816e412 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_rectify.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_rectify.py + ------------ + Date : April 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'April 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters, copyFile, multipleOutputDir +from qgis.core import QgsMessageLog +from qgis.core import QgsCoordinateReferenceSystem +from ..Grass7Utils import Grass7Utils +from processing.core.parameters import getParameterFromString +from os import path + + +def processCommand(alg): + # Creates a new location with the CRS + crsParam = alg.getParameterFromName('crs') + crsId = int(crsParam.value[5:]) + #QgsMessageLog.logMessage('crs = {}'.format(crs), 'DEBUG', QgsMessageLog.INFO) + crs = QgsCoordinateReferenceSystem() + crs.createFromId(crsId, QgsCoordinateReferenceSystem.EpsgCrsId) + command = "g.proj proj4=\"{}\" location=TARGET".format(crs.toProj4()) + alg.commands.append(command) + alg.parameters.remove(crsParam) + + # Regroup rasters + rasters = alg.getParameterFromName('rasters') + rastersList = rasters.value.split(';') + alg.parameters.remove(rasters) + + # Insert a i.group command + group = getParameterFromString("ParameterString|group|group of rasters|None|False|False") + group.value = alg.getTempFilename() + alg.addParameter(group) + + command = 'i.group group={} input={}'.format( + group.value, + ','.join([alg.exportedLayers[f] for f in rastersList]) + ) + alg.commands.append(command) + + # Handle POINT File + gcp = alg.getParameterFromName('gcp') + extFileName = gcp.value + destPath = path.join(Grass7Utils.grassMapsetFolder(), + 'PERMANENT', + 'group', group.value, + 'POINTS') + copyFile(alg, extFileName, destPath) + alg.parameters.remove(gcp) + + # Add a target destination for our group + command = "i.target group={} location=TARGET mapset=PERMANENT".format(group.value) + alg.commands.append(command) + + # remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Add an extension + #extension = getParameterFromString("ParameterString|extension|Output raster map(s) suffix|None|False|False") + #extension.value = "rectified" + #alg.addParameter(extension) + + # modify parameters values + alg.processCommand() + + # Re-add input rasters + alg.addParameter(rasters) + alg.addParameter(gcp) + alg.addParameter(crs) + + # Re-add output + alg.addOutput(output) + + +def processOutputs(alg): + # We need to export from the TARGET location + command = "g.mapset location=TARGET mapset=PERMANENT" + alg.commands.append(command) + multipleOutputDir(alg, 'output') diff --git a/python/plugins/processing/algs/grass7/ext/i_segment.py b/python/plugins/processing/algs/grass7/ext/i_segment.py new file mode 100644 index 000000000000..6fd217410e5b --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_segment.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_segment.py + ------------ + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters + + +def processCommand(alg): + # Regroup rasters + regroupRasters(alg, 'input', 'group') diff --git a/python/plugins/processing/algs/grass7/ext/i_smap.py b/python/plugins/processing/algs/grass7/ext/i_smap.py new file mode 100644 index 000000000000..8ba96ec32f8d --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_smap.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_smap.py + --------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import regroupRasters, file2Output + + +def processCommand(alg): + # Regroup rasters + regroupRasters(alg, 'input', 'group', 'subgroup', {'signaturefile': 'sigset'}) diff --git a/python/plugins/processing/algs/grass7/ext/i_tasscap.py b/python/plugins/processing/algs/grass7/ext/i_tasscap.py new file mode 100644 index 000000000000..e0f01a1575d9 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_tasscap.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_tasscap.py + ------------ + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import multipleOutputDir, verifyRasterNum +from processing.core.parameters import getParameterFromString + + +def checkParameterValuesBeforeExecuting(alg): + return verifyRasterNum(alg, 'input', 6, 8) + + +def processCommand(alg): + # Remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Create output parameter + param = getParameterFromString("ParameterString|output|output basename|None|False|False") + param.value = alg.getTempFilename() + alg.addParameter(param) + + alg.processCommand() + + # re-add output + alg.addOutput(output) + + +def processOutputs(alg): + param = alg.getParameterFromName('output') + multipleOutputDir(alg, 'output', param.value) + + # Delete output parameter + alg.parameters.remove(param) diff --git a/python/plugins/processing/algs/grass7/ext/i_topo_corr.py b/python/plugins/processing/algs/grass7/ext/i_topo_corr.py new file mode 100644 index 000000000000..62038f55a1e9 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_topo_corr.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_topo_corr.py + -------------- + Date : April 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'April 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import multipleOutputDir, verifyRasterNum +from processing.core.parameters import getParameterFromString + + +def processCommand(alg): + # Remove output + output = alg.getOutputFromName('output') + alg.removeOutputFromName('output') + + # Create output parameter + param = getParameterFromString("ParameterString|output|output basename|None|False|False") + param.value = alg.getTempFilename() + alg.addParameter(param) + + alg.processCommand() + # re-add output + alg.addOutput(output) + + +def processOutputs(alg): + param = alg.getParameterFromName('output') + multipleOutputDir(alg, 'output', param.value) + + # Delete output parameter + alg.parameters.remove(param) diff --git a/python/plugins/processing/gui/TestTools.py b/python/plugins/processing/gui/TestTools.py index 4bdacd903290..aae1ed2c579c 100644 --- a/python/plugins/processing/gui/TestTools.py +++ b/python/plugins/processing/gui/TestTools.py @@ -32,6 +32,8 @@ from osgeo import gdal from osgeo.gdalconst import GA_ReadOnly +from numpy import nan_to_num + from qgis.PyQt.QtCore import QCoreApplication, QMetaObject from qgis.PyQt.QtWidgets import QDialog, QVBoxLayout, QTextEdit @@ -47,7 +49,8 @@ from processing.core.parameters import ( ParameterRaster, ParameterVector, - ParameterMultipleInput + ParameterMultipleInput, + ParameterFile ) @@ -138,10 +141,18 @@ def createTest(text): elif isinstance(param, ParameterMultipleInput): multiparams = token[1:-1].split(';') newparam = [] + + # Handle datatype detection + dataType = param.dataType() + if dataType in ['points', 'lines', 'polygons', 'any vectors']: + dataType = 'vector' + else: + dataType = 'raster' + for mp in multiparams: schema, filepath = extractSchemaPath(mp) newparam.append({ - 'type': 'vector', + 'type': dataType, 'name': filepath }) p = { @@ -151,6 +162,17 @@ def createTest(text): if not schema: p['location'] = '[The source data is not in the testdata directory. Please use data in the processing/tests/testdata folder.]' + params[param.name] = p + elif isinstance(param, ParameterFile): + filename = token[1:-1] + schema, filepath = extractSchemaPath(filename) + p = { + 'type': 'file', + 'name': filepath + } + if not schema: + p['location'] = '[The source data is not in the testdata directory. Please use data in the processing/tests/testdata folder.]' + params[param.name] = p else: try: @@ -175,7 +197,8 @@ def createTest(text): elif isinstance(out, OutputRaster): filename = token[1:-1] dataset = gdal.Open(filename, GA_ReadOnly) - strhash = hashlib.sha224(dataset.ReadAsArray(0).data).hexdigest() + dataArray = nan_to_num(dataset.ReadAsArray(0)) + strhash = hashlib.sha224(dataArray.data).hexdigest() results[out.name] = { 'type': 'rasterhash', diff --git a/python/plugins/processing/tests/AlgorithmsTestBase.py b/python/plugins/processing/tests/AlgorithmsTestBase.py index c999aa057cd2..d7bc6625a5d7 100644 --- a/python/plugins/processing/tests/AlgorithmsTestBase.py +++ b/python/plugins/processing/tests/AlgorithmsTestBase.py @@ -34,6 +34,7 @@ import tempfile from osgeo.gdalconst import GA_ReadOnly +from numpy import nan_to_num import processing from processing.modeler.ModelerAlgorithmProvider import ModelerAlgorithmProvider @@ -103,20 +104,17 @@ def check_algorithm(self, name, defs): exec('\n'.join(defs['expectedFailure'][:-1])) in globals(), locals() expectFailure = eval(defs['expectedFailure'][-1]) - def doCheck(): - alg.execute() - - self.check_results(alg.getOutputValuesAsDictionary(), defs['results']) - if expectFailure: try: - doCheck() + alg.execute() + self.check_results(alg.getOutputValuesAsDictionary(), defs['results']) except Exception: pass else: raise _UnexpectedSuccess else: - doCheck() + alg.execute() + self.check_results(alg.getOutputValuesAsDictionary(), defs['results']) def load_params(self, params): """ @@ -137,8 +135,10 @@ def load_param(self, param): try: if param['type'] == 'vector' or param['type'] == 'raster': return self.load_layer(param) - if param['type'] == 'multi': + elif param['type'] == 'multi': return [self.load_param(p) for p in param['params']] + elif param['type'] == 'file': + return self.filepath_from_param(param) except TypeError: # No type specified, use whatever is there return param @@ -174,7 +174,7 @@ def load_layer(self, param): if param['type'] == 'vector': lyr = QgsVectorLayer(filepath, param['name'], 'ogr') elif param['type'] == 'raster': - lyr = QgsRasterLayer(filepath, param['name'], 'ogr') + lyr = QgsRasterLayer(filepath, param['name'], 'gdal') self.assertTrue(lyr.isValid(), 'Could not load layer "{}"'.format(filepath)) QgsMapLayerRegistry.instance().addMapLayer(lyr) @@ -210,7 +210,8 @@ def check_results(self, results, expected): elif 'rasterhash' == expected_result['type']: dataset = gdal.Open(results[id], GA_ReadOnly) - strhash = hashlib.sha224(dataset.ReadAsArray(0).data).hexdigest() + dataArray = nan_to_num(dataset.ReadAsArray(0)) + strhash = hashlib.sha224(dataArray.data).hexdigest() self.assertEqual(strhash, expected_result['hash']) elif 'file' == expected_result['type']: diff --git a/python/plugins/processing/tests/CMakeLists.txt b/python/plugins/processing/tests/CMakeLists.txt index 8a76fd217492..c3c482f7c9d1 100644 --- a/python/plugins/processing/tests/CMakeLists.txt +++ b/python/plugins/processing/tests/CMakeLists.txt @@ -9,4 +9,5 @@ IF(ENABLE_TESTS) ADD_PYTHON_TEST(ProcessingParametersTest ParametersTest.py) ADD_PYTHON_TEST(ProcessingQgisAlgorithmsTest QgisAlgorithmsTest.py) ADD_PYTHON_TEST(ProcessingGdalAlgorithmsTest GdalAlgorithmsTest.py) + ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsTest Grass7AlgorithmsTest.py) ENDIF(ENABLE_TESTS) diff --git a/python/plugins/processing/tests/Grass7AlgorithmsTest.py b/python/plugins/processing/tests/Grass7AlgorithmsTest.py new file mode 100644 index 000000000000..8bc7a88dc371 --- /dev/null +++ b/python/plugins/processing/tests/Grass7AlgorithmsTest.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + Grass7AlgorithmTests.py + ----------------------- + Date : May 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : mederic dot ribreux at medspx dot fr +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'May 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = ':%H$' + +import AlgorithmsTestBase + +import nose2 +import shutil + +from qgis.testing import ( + start_app, + unittest +) + + +class TestGrass7Algorithms(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest): + + @classmethod + def setUpClass(cls): + start_app() + from processing.core.Processing import Processing + Processing.initialize() + cls.cleanup_paths = [] + + @classmethod + def tearDownClass(cls): + for path in cls.cleanup_paths: + shutil.rmtree(path) + + def test_definition_file(self): + return 'grass7_algorithm_tests.yaml' + + +if __name__ == '__main__': + nose2.main() diff --git a/python/plugins/processing/tests/README.md b/python/plugins/processing/tests/README.md index e8940723f373..0bb8e91e6c99 100644 --- a/python/plugins/processing/tests/README.md +++ b/python/plugins/processing/tests/README.md @@ -98,6 +98,20 @@ params: OTHER: another param ``` +### File type parameters + +If you need an external file for the algorithm test, you need to specify the 'file' type and the (relative) path to the file in its 'name': + +```yaml +params: + PAR: 2 + STR: string + EXTFILE: + type: file + name: custom/grass7/extfile.txt + OTHER: another param +``` + ### Results Results are specified very similar. diff --git a/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif b/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif new file mode 100644 index 000000000000..de65085860d2 Binary files /dev/null and b/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif differ diff --git a/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml new file mode 100644 index 000000000000..1bc16ac0895b --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml @@ -0,0 +1,20 @@ + + + + + -310.575 + 14854.575 + 1000 + 0 + 0 + 8|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|15|15|15|16|15|15|8 + + + + 14847 + 7272 + -303 + 4373.7169547194 + + + diff --git a/python/plugins/processing/tests/testdata/custom/grass7/i.atcorr.txt b/python/plugins/processing/tests/testdata/custom/grass7/i.atcorr.txt new file mode 100644 index 000000000000..794cd76da541 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/i.atcorr.txt @@ -0,0 +1,8 @@ +8 +2 19 13.00 -47.410 -20.234 +1 +1 +15 +-0.600 +-1000 +64 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/i.cluster.txt b/python/plugins/processing/tests/testdata/custom/grass7/i.cluster.txt new file mode 100644 index 000000000000..014f2554a01e --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/i.cluster.txt @@ -0,0 +1,31 @@ +#produit par i.cluster +#Class 1 +1596 +1.83333 1.53759 3.31579 +0.823615 +-0.22884 0.584793 +0.0131661 0.015707 0.563537 +#Class 2 +3341 +2.11045 4.35498 3.32266 +0.790493 +-0.109278 0.472751 +0.0125567 -0.0124767 0.565921 +#Class 3 +3491 +5.32655 1.72558 3.32713 +0.671555 +0.189352 0.758483 +-0.00255721 -0.0248173 0.544533 +#Class 4 +3324 +4.34567 4.36522 3.30235 +0.22625 +0.0708273 0.484688 +0.00740409 0.00750866 0.56369 +#Class 5 +2991 +6 4.55734 3.30291 +0 +0 0.246795 +0 0.00235825 0.573099 diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif b/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif new file mode 100644 index 000000000000..29828d8ddafe Binary files /dev/null and b/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif differ diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml new file mode 100644 index 000000000000..9ada6028f3f2 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/raster_4class.tif.aux.xml @@ -0,0 +1,27 @@ + + + + + 0.625 + 4.375 + 4 + 0 + 0 + 300|1700|6000|7000 + + + + 5 + 1.000000e+00 1.600000e+00 255 255 0 0 255 0 + 1.600000e+00 2.200000e+00 0 255 0 0 255 255 + 2.200000e+00 2.800000e+00 0 255 255 0 0 255 + 2.800000e+00 3.400000e+00 0 0 255 255 0 255 + 3.400000e+00 4.000000e+00 255 0 255 255 0 0 + GRASS GIS 7.0.3 + 4 + 3.3133333333333 + 1 + 0.74954801195268 + + + diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif new file mode 100644 index 000000000000..61d5a425a30b Binary files /dev/null and b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif differ diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml new file mode 100644 index 000000000000..a5b37b9a743f --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/raster_5class.tif.aux.xml @@ -0,0 +1,27 @@ + + + + + 0.6 + 5.4 + 5 + 0 + 0 + 2999|921|2110|4010|5000 + + + + 5 + 1.000000e+00 1.800000e+00 255 255 0 0 255 0 + 1.800000e+00 2.600000e+00 0 255 0 0 255 255 + 2.600000e+00 3.400000e+00 0 255 255 0 0 255 + 3.400000e+00 4.200000e+00 0 0 255 255 0 255 + 4.200000e+00 5.000000e+00 255 0 255 255 0 0 + GRASS GIS 7.0.3 + 5 + 3.4714760638298 + 1 + 1.4943102023375 + + + diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif new file mode 100644 index 000000000000..984703074e8c Binary files /dev/null and b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif differ diff --git a/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml new file mode 100644 index 000000000000..40cd7dd73d73 --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/grass7/raster_6class.tif.aux.xml @@ -0,0 +1,27 @@ + + + + + 0.5833333333333333 + 6.416666666666667 + 6 + 0 + 0 + 1999|920|2110|3010|1960|5001 + + + + 5 + 1.000000e+00 2.000000e+00 255 255 0 0 255 0 + 2.000000e+00 3.000000e+00 0 255 0 0 255 255 + 3.000000e+00 4.000000e+00 0 255 255 0 0 255 + 4.000000e+00 5.000000e+00 0 0 255 255 0 255 + 5.000000e+00 6.000000e+00 255 0 255 255 0 0 + GRASS GIS 7.0.3 + 6 + 4.1343333333333 + 1 + 1.7411551401935 + + + diff --git a/python/plugins/processing/tests/testdata/expected/grass7/i.gensig.txt b/python/plugins/processing/tests/testdata/expected/grass7/i.gensig.txt new file mode 100644 index 000000000000..e69a1b880105 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/i.gensig.txt @@ -0,0 +1,17 @@ +# +# +300 +7043.06 +1.89772e+07 +# +1700 +7405.93 +2.01921e+07 +# +6000 +7287.21 +1.90221e+07 +# +7000 +7246.81 +1.90226e+07 diff --git a/python/plugins/processing/tests/testdata/expected/grass7/i.gensigset.txt b/python/plugins/processing/tests/testdata/expected/grass7/i.gensigset.txt new file mode 100644 index 000000000000..1f23b4d354aa --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/grass7/i.gensigset.txt @@ -0,0 +1,124 @@ +title: +nbands: 1 +class: + classnum: 1 + classtitle: + classtype: 1 + subclass: + pi: 0.22802 + means: 9764.5 + covar: + 3.02234e+06 + endsubclass: + subclass: + pi: 0.495197 + means: 5208.5 + covar: + 7.97435e+06 + endsubclass: + subclass: + pi: 0.118668 + means: 997.979 + covar: + 686411 + endsubclass: + subclass: + pi: 0.158115 + means: 13401 + covar: + 702077 + endsubclass: +endclass: +class: + classnum: 2 + classtitle: + classtype: 1 + subclass: + pi: 0.177696 + means: 13267.4 + covar: + 1.06971e+06 + endsubclass: + subclass: + pi: 0.172485 + means: 3861.81 + covar: + 2.35556e+06 + endsubclass: + subclass: + pi: 0.48383 + means: 8696.48 + covar: + 7.62681e+06 + endsubclass: + subclass: + pi: 0.165989 + means: 1052.05 + covar: + 692627 + endsubclass: +endclass: +class: + classnum: 3 + classtitle: + classtype: 1 + subclass: + pi: 0.135816 + means: 1158.36 + covar: + 934515 + endsubclass: + subclass: + pi: 0.187835 + means: 11847.9 + covar: + 1.74438e+06 + endsubclass: + subclass: + pi: 0.0829488 + means: 14066.2 + covar: + 268579 + endsubclass: + subclass: + pi: 0.5934 + means: 6298.74 + covar: + 8.66516e+06 + endsubclass: +endclass: +class: + classnum: 4 + classtitle: + classtype: 1 + subclass: + pi: 0.278456 + means: 3394.59 + covar: + 2.33337e+06 + endsubclass: + subclass: + pi: 0.0849227 + means: 13998.4 + covar: + 256746 + endsubclass: + subclass: + pi: 0.102818 + means: 686.099 + covar: + 379342 + endsubclass: + subclass: + pi: 0.222279 + means: 11683.6 + covar: + 1.75208e+06 + endsubclass: + subclass: + pi: 0.311523 + means: 7849.26 + covar: + 3.21781e+06 + endsubclass: +endclass: diff --git a/python/plugins/processing/tests/testdata/grass7_algorithm_tests.yaml b/python/plugins/processing/tests/testdata/grass7_algorithm_tests.yaml new file mode 100644 index 000000000000..e966121ad370 --- /dev/null +++ b/python/plugins/processing/tests/testdata/grass7_algorithm_tests.yaml @@ -0,0 +1,620 @@ +# See ../README.md for a description of the file format + +tests: +# i.* modules + - algorithm: grass7:i.emissivity + name: GRASS7 i.emissivity + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + type: raster + name: custom/grass7/raster_4class.tif + results: + output: + type: rasterhash + hash: cef69ed56f0b0f991ae2f7f2a54b8a29319eaf8b7d65653c75cbf985 + + - algorithm: grass7:i.biomass + name: GRASS7 i.biomass + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + dayofyear: + name: custom/grass7/raster_4class.tif + type: raster + fpar: + name: custom/grass7/raster_4class.tif + type: raster + latitude: + name: custom/grass7/raster_4class.tif + type: raster + lightuse_efficiency: + name: custom/grass7/raster_4class.tif + type: raster + transmissivity_singleway: + name: custom/grass7/raster_4class.tif + type: raster + water_availability: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 358c7745aaa5d7fbc56b34a21821fdfdc61f68e6ca79fb996a2241d8 + type: rasterhash + + - algorithm: grass7:i.eb.eta + name: GRASS7 i.eb.eta + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + evaporativefraction: + name: custom/grass7/raster_4class.tif + type: raster + netradiationdiurnal: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 23e65e4c5384b48d7151f781bab10e5caa398b36d363ff8c1049c917 + type: rasterhash + + - algorithm: grass7:i.eb.netrad + name: GRASS7 i.eb.netrad + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + albedo: + name: custom/grass7/raster_4class.tif + type: raster + dayofyear: + name: custom/grass7/raster_4class.tif + type: raster + emissivity: + name: custom/grass7/raster_4class.tif + type: raster + localutctime: + name: custom/grass7/raster_4class.tif + type: raster + ndvi: + name: custom/grass7/raster_4class.tif + type: raster + sunzenithangle: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + temperaturedifference2m: + name: custom/grass7/raster_4class.tif + type: raster + transmissivity_singleway: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 361d48c66d978d4844ae7c073c9e6d042fdc8c7739b889a1efce3c3f + type: rasterhash + + - algorithm: grass7:i.eb.soilheatflux + name: GRASS7 i.eb.soilheatflux + params: + -r: 'False' + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + albedo: + name: custom/grass7/raster_4class.tif + type: raster + localutctime: + name: custom/grass7/raster_4class.tif + type: raster + ndvi: + name: custom/grass7/raster_4class.tif + type: raster + netradiation: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: a25c4b750dd1f2f2124a117c80ac3f0e3d9b353618a86389eca794e8 + type: rasterhash + + - algorithm: grass7:i.evapo.mh + name: GRASS7 i.evapo.mh + params: + -h: 'True' + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + average_temperature: + name: custom/grass7/raster_4class.tif + type: raster + maximum_temperature: + name: custom/grass7/raster_4class.tif + type: raster + minimum_temperature: + name: custom/grass7/raster_4class.tif + type: raster + netradiation_diurnal: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.evapo.pm + name: GRASS7 i.evapo.pm + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + cropheight: + name: custom/grass7/raster_4class.tif + type: raster + elevation: + name: custom/grass7/raster_4class.tif + type: raster + netradiation: + name: custom/grass7/raster_4class.tif + type: raster + relativehumidity: + name: custom/grass7/raster_4class.tif + type: raster + temperature: + name: custom/grass7/raster_4class.tif + type: raster + windspeed: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: 419ae792b057d2324354ce76d971d01e36751cf1c45cf3d856634576 + type: rasterhash + + - algorithm: grass7:i.evapo.pt + name: GRASS7 i.evapo.pt + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + air_temperature: + name: custom/grass7/raster_4class.tif + type: raster + atmospheric_pressure: + name: custom/grass7/raster_4class.tif + type: raster + net_radiation: + name: custom/grass7/raster_4class.tif + type: raster + priestley_taylor_coeff: 1.26 + soil_heatflux: + name: custom/grass7/raster_4class.tif + type: raster + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.topo.coor.ill + name: GRASS7 i.topo.coor.ill + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + azimuth: 50 + basemap: + name: custom/grass7/raster_4class.tif + type: raster + zenith: 50 + results: + output: + hash: b08dc5b47f557ecadf0c125c99f249e49111c44e43f463c2444ab474 + type: rasterhash + + - algorithm: grass7:i.vi + name: GRASS7 i.vi + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + nir: + name: custom/grass7/raster_4class.tif + type: raster + red: + name: custom/grass7/raster_4class.tif + type: raster + storage_bit: 1 + viname: 10 + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.zc + name: GRASS7 i.zc + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + name: custom/grass7/raster_4class.tif + type: raster + orientations: 1 + threshold: 10 + width: 9 + results: + output: + hash: 270bbef9dd111af5df23a819cb0848e104e0cf4949e794a67fa0b3f2 + type: rasterhash + + - algorithm: grass7:i.group + name: GRASS7 i.group + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + type: multi + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + results: + group: + hash: e1a433546cc1fdf7061adc0d9b77676c9d66ee8e0773d471bdb39a37 + type: rasterhash + + - algorithm: grass7:i.cluster + name: GRASS7 i.cluster + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + classes: 5 + convergence: 98 + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + iterations: 30 + min_size: 17 + separation: 0 + results: + signaturefile: + type: regex + name: expected/grass7/i.cluster.sig.txt + rules: + - '#Class 1' + - '1.83333 1.53759 3.31579' + - '#Class 2' + - '2.11045 4.35498 3.32266' + - '#Class 3' + - '5.32655 1.72558 3.32713' + - '#Class 4' + - '4.34567 4.36522 3.30235' + - '#Class 5' + - '6 4.55734 3.30291' + + - algorithm: grass7:i.oif + name: GRASS7 i.oif + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + results: + output: + type: regex + name: expected/grass7/i.oif.txt + rules: + - '118773.1947' + - '4541.9055' + - '4369.2930' + - '128.6900' + +# this doesn't work in travis-ci environment (probably due to libfftw version). +# - algorithm: grass7:i.fft +# name: GRASS7 i.fft +# params: +# GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' +# input: +# name: custom/grass7/float_raster.tif +# type: raster +# results: +# imaginary: +# hash: 94249384dd8b6019f0024501bc9a093cba9dd025c183d3fb46d77027 +# type: rasterhash +# real: +# hash: 09ab93c65aa2dde4da422b62a5ed3e38208e2da072cec2b0eb837a47 +# type: rasterhash + + - algorithm: grass7:i.segment + name: GRASS7 i.segment + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + iterations: 20 + memory: 300 + method: 0 + minsize: 1 + similarity: 0 + threshold: 0.5 + results: + goodness: + hash: 4d7728e28734d2b67427a514bcd155d254d30b3424bf4e0ad8f0f0c6 + type: rasterhash + output: + hash: b65992a5d48b867d4a32a533f38e7a72cb1ba18f1e261c6be132baca + type: rasterhash + + - algorithm: grass7:i.gensig + name: GRASS7 i.gensig + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + type: multi + trainingmap: + name: custom/grass7/raster_4class.tif + type: raster + results: + signaturefile: + type: file + name: expected/grass7/i.gensig.txt + + - algorithm: grass7:i.gensigset + name: GRASS7 i.gensigset + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + type: multi + maxsig: 5 + trainingmap: + name: custom/grass7/raster_4class.tif + type: raster + results: + signaturefile: + type: file + name: expected/grass7/i.gensigset.txt + + - algorithm: grass7:i.rgb.his + name: GRASS7 i.rgb.his + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + blue: + name: custom/grass7/raster_6class.tif + type: raster + green: + name: custom/grass7/raster_5class.tif + type: raster + red: + name: custom/grass7/raster_4class.tif + type: raster + results: + hue: + hash: d82c717b0aca5c7bb49d6f2b086a188a6fbdc397c533734911261f74 + type: rasterhash + intensity: + hash: 6d75d7a40460611301a1f2c2b162d08ae20fb5527d80509f19748b3c + type: rasterhash + saturation: + hash: 07578ad38cf948473a519f040acb0235f60a592904ac8ef46aa607e1 + type: rasterhash + + - algorithm: grass7:i.pansharpen + name: GRASS7 i.pansharpen + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + blue: + name: custom/grass7/raster_4class.tif + type: raster + green: + name: custom/grass7/raster_5class.tif + type: raster + method: 2 + pan: + name: custom/grass7/float_raster.tif + type: raster + red: + name: custom/grass7/raster_6class.tif + type: raster + results: + blueoutput: + hash: 906de8be89e302057ed849d00eaf49332ecca73ffaba1374994f1a17 + type: rasterhash + greenoutput: + hash: 588ad1ef8360ce903fc2defb1a1728a1dc8335d737d5fa77797605ed + type: rasterhash + redoutput: + hash: ad80c0007faa1b0dc15c0b0c21ff4e0045ff5e67b454df0f65e68899 + type: rasterhash + + - algorithm: grass7:i.smap + name: GRASS7 i.smap + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + blocksize: 1024 + input: + params: + - name: custom/grass7/float_raster.tif + type: raster + type: multi + signaturefile: + type: file + name: expected/grass7/i.gensigset.txt + results: + goodness: + hash: 26c3f407312e8a9e03e91c32e526f71ea9cfa78037a90a5f78f0818e + type: rasterhash + output: + hash: f9e99ac3891b23c650add0478bb5225444183c61c6a4c321a7c2a16f + type: rasterhash + + - algorithm: grass7:i.maxlik + name: GRASS7 i.maxlik + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + signaturefile: + type: file + name: custom/grass7/i.cluster.txt + results: + output: + hash: a7b63bdda06fdcac715b8fe22e440238594a3dd0e189ca2328a3d694 + type: rasterhash + reject: + hash: 87b3d0be1315a040a61c4d4dec2bd5837881ad207a4140a89a28997a + type: rasterhash + +# - algorithm: grass7:i.evapo.time +# name: GRASS7 i.evapo.time +# params: +# GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' +# eta: +# params: +# - name: custom/grass7/raster_5class.tif +# type: raster +# - name: custom/grass7/raster_4class.tif +# type: raster +# type: multi +# eta_doy: +# params: +# - name: custom/grass7/raster_6class.tif +# type: raster +# - name: custom/grass7/raster_5class.tif +# type: raster +# type: multi +# eto: +# params: +# - name: custom/grass7/float_raster.tif +# type: raster +# - name: custom/grass7/raster_6class.tif +# type: raster +# type: multi +# results: +# output: +# hash: a361b729bf0b0628fa66822297dc57e71e0b2e56331f7145c3cfdce6 +# type: rasterhash + + - algorithm: grass7:i.eb.hsebal01 + name: GRASS7 i.eb.hsebal01 + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + aerodynresistance: + name: custom/grass7/raster_6class.tif + type: raster + frictionvelocitystar: 0.32407 + netradiation: + name: custom/grass7/raster_4class.tif + type: raster + soilheatflux: + name: custom/grass7/raster_5class.tif + type: raster + temperaturemeansealevel: + name: custom/grass7/float_raster.tif + type: raster + vapourpressureactual: 1.511 + results: + output: + hash: cac9e91f9b5182fbad336fd46ecebcf5185327e009ae8dc4cc0367fc + type: rasterhash + + - algorithm: grass7:i.modis.qc + name: GRASS7 i.modis.qc + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + name: custom/grass7/float_raster.tif + type: raster + productname: 8 + qcname: 5 + results: + output: + hash: 0439e59b8c142a7f58cdece674c058891b64aafb1273ed6ce5e3ecf9 + type: rasterhash + + - algorithm: grass7:i.image.mosaic + name: GRASS7 i.image.mosaic + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + params: + - name: custom/grass7/raster_6class.tif + type: raster + - name: custom/grass7/raster_5class.tif + type: raster + - name: custom/grass7/raster_4class.tif + type: raster + type: multi + results: + output: + hash: 651bde2da0f150c0dbe7790da98f371e56de20a3f1cbb13ef6a69657 + type: rasterhash + + - algorithm: grass7:i.eb.hsebal01.coords + name: GRASS7 i.eb.hsebal01.coords + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + aerodynresistance: + name: custom/grass7/float_raster.tif + type: raster + column_dry_pixel: '50' + column_wet_pixel: '10' + frictionvelocitystar: 0.32407 + netradiation: + name: custom/grass7/float_raster.tif + type: raster + row_dry_pixel: '50' + row_wet_pixel: '10' + soilheatflux: + name: custom/grass7/float_raster.tif + type: raster + temperaturemeansealevel: + name: custom/grass7/float_raster.tif + type: raster + vapourpressureactual: 1.511 + results: + output: + hash: b0211772fe8e2c3d8c713551137f014756eb63ccd12f95a322f63ce0 + type: rasterhash + + - algorithm: grass7:i.atcorr + name: GRASS7 i.atcorr + params: + GRASS_REGION_PARAMETER: '344500.0,358400.0,6682800.0,6693700.0' + input: + name: custom/grass7/raster_6class.tif + type: raster + visibility: + name: custom/grass7/raster_5class.tif + type: raster + parameters: + type: file + name: custom/grass7/i.atcorr.txt + results: + output: + hash: e5fada2ec43658e25a34d0486e810dec1cad289b626f6d1c4bbfea18 + type: rasterhash