Skip to content

Commit de0544c

Browse files
authoredMay 25, 2019
Merge pull request #25793 from alexbruy/backport-r-sun
[processing] split GRASS r.sun algorithm into two (fix #21637)
2 parents a9d6460 + d8b50ed commit de0544c

File tree

3 files changed

+94
-18
lines changed

3 files changed

+94
-18
lines changed
 

‎python/plugins/processing/algs/grass7/description/r.sun.txt renamed to ‎python/plugins/processing/algs/grass7/description/r.sun.incidout.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r.sun
2-
Solar irradiance and irradiation model.
2+
r.sun.incidout - Solar irradiance and irradiation model ( for the set local time).
33
Raster (r.*)
44
QgsProcessingParameterRasterLayer|elevation|Elevation layer [meters]|None|False
55
QgsProcessingParameterRasterLayer|aspect|Aspect layer [decimal degrees]|None|False
@@ -21,11 +21,11 @@ QgsProcessingParameterNumber|day|No. of day of the year (1-365)|QgsProcessingPar
2121
*QgsProcessingParameterNumber|distance_step|Sampling distance step coefficient (0.5-1.5)|QgsProcessingParameterNumber.Double|1.0|True|0.5|1.5
2222
*QgsProcessingParameterNumber|npartitions|Read the input files in this number of chunks|QgsProcessingParameterNumber.Integer|1|True|1|None
2323
*QgsProcessingParameterNumber|civil_time|Civil time zone value, if none, the time will be local solar time|QgsProcessingParameterNumber.Double|None|True|0.0|None
24+
QgsProcessingParameterNumber|time|Local (solar) time (decimal hours)|QgsProcessingParameterNumber.Double|None|False|0.0|24.0
2425
QgsProcessingParameterBoolean|-p|Do not incorporate the shadowing effect of terrain|False
2526
*QgsProcessingParameterBoolean|-m|Use the low-memory version of the program|False
26-
QgsProcessingParameterRasterDestination|incidout|incidence angle raster map|None|True
27-
QgsProcessingParameterRasterDestination|beam_rad|Irradiation [Wh.m-2.day-1]|None|True
28-
QgsProcessingParameterRasterDestination|insol_time|Insolation time [h] |None|True
29-
QgsProcessingParameterRasterDestination|diff_rad|Diffuse irradiation [Wh.m-2.day-1]|None|True
30-
QgsProcessingParameterRasterDestination|refl_rad|Ground reflected irradiation [Wh.m-2.day-1]|None|True
31-
QgsProcessingParameterRasterDestination|glob_rad|Global (total) irradiance/irradiation [Wh.m-2.day-1]|None|True
27+
QgsProcessingParameterRasterDestination|incidout|incidence angle raster map|None|True
28+
QgsProcessingParameterRasterDestination|beam_rad|Beam irradiance [W.m-2]|None|True
29+
QgsProcessingParameterRasterDestination|diff_rad|Diffuse irradiance [W.m-2]|None|True
30+
QgsProcessingParameterRasterDestination|refl_rad|Ground reflected irradiance [W.m-2]|None|True
31+
QgsProcessingParameterRasterDestination|glob_rad|Global (total) irradiance/irradiation [W.m-2]|None|True
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
r.sun
2+
r.sun.insoltime - Solar irradiance and irradiation model (daily sums).
3+
Raster (r.*)
4+
QgsProcessingParameterRasterLayer|elevation|Elevation layer [meters]|None|False
5+
QgsProcessingParameterRasterLayer|aspect|Aspect layer [decimal degrees]|None|False
6+
QgsProcessingParameterNumber|aspect_value|A single value of the orientation (aspect), 270 is south|QgsProcessingParameterNumber.Double|270.0|True|0.0|360.0
7+
QgsProcessingParameterRasterLayer|slope|Name of the input slope raster map (terrain slope or solar panel inclination) [decimal degrees]|None|False
8+
QgsProcessingParameterNumber|slope_value|A single value of inclination (slope)|QgsProcessingParameterNumber.Double|0.0|True|0.0|360.0
9+
QgsProcessingParameterRasterLayer|linke|Name of the Linke atmospheric turbidity coefficient input raster map|None|True
10+
QgsProcessingParameterRasterLayer|albedo|Name of the ground albedo coefficient input raster map|None|True
11+
QgsProcessingParameterNumber|albedo_value|A single value of the ground albedo coefficient|QgsProcessingParameterNumber.Double|0.2|True|0.0|360.0
12+
QgsProcessingParameterRasterLayer|lat|Name of input raster map containing latitudes [decimal degrees]|None|True
13+
QgsProcessingParameterRasterLayer|long|Name of input raster map containing longitudes [decimal degrees]|None|True
14+
QgsProcessingParameterRasterLayer|coeff_bh|Name of real-sky beam radiation coefficient input raster map|None|True
15+
QgsProcessingParameterRasterLayer|coeff_dh|Name of real-sky diffuse radiation coefficient input raster map|None|True
16+
QgsProcessingParameterRasterLayer|horizon_basemap|The horizon information input map basename|None|True
17+
QgsProcessingParameterNumber|horizon_step|Angle step size for multidirectional horizon [degrees]|QgsProcessingParameterNumber.Double|None|True|0.0|360.0
18+
QgsProcessingParameterNumber|day|No. of day of the year (1-365)|QgsProcessingParameterNumber.Integer|1|False|1|365
19+
*QgsProcessingParameterNumber|step|Time step when computing all-day radiation sums [decimal hours]|QgsProcessingParameterNumber.Double|0.5|True|0
20+
*QgsProcessingParameterNumber|declination|Declination value (overriding the internally computed value) [radians]|QgsProcessingParameterNumber.Double|None|True|None|None
21+
*QgsProcessingParameterNumber|distance_step|Sampling distance step coefficient (0.5-1.5)|QgsProcessingParameterNumber.Double|1.0|True|0.5|1.5
22+
*QgsProcessingParameterNumber|npartitions|Read the input files in this number of chunks|QgsProcessingParameterNumber.Integer|1|True|1|None
23+
*QgsProcessingParameterNumber|civil_time|Civil time zone value, if none, the time will be local solar time|QgsProcessingParameterNumber.Double|None|True|0.0|None
24+
QgsProcessingParameterBoolean|-p|Do not incorporate the shadowing effect of terrain|False
25+
*QgsProcessingParameterBoolean|-m|Use the low-memory version of the program|False
26+
QgsProcessingParameterRasterDestination|insol_time|Insolation time [h] |None|True
27+
QgsProcessingParameterRasterDestination|beam_rad|Irradiation raster map [Wh.m-2.day-1]|None|True
28+
QgsProcessingParameterRasterDestination|diff_rad|Irradiation raster map [Wh.m-2.day-1]|None|True
29+
QgsProcessingParameterRasterDestination|refl_rad|Irradiation raster map [Wh.m-2.day-1]|None|True
30+
QgsProcessingParameterRasterDestination|glob_rad|Irradiance/irradiation raster map [Wh.m-2.day-1]|None|True

‎python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -461,41 +461,87 @@ tests:
461461
hash: 95e064f05759606bc60f1dfa88931f545c066629c1f07919156ac03b
462462
type: rasterhash
463463

464-
- algorithm: grass7:r.sun
465-
name: GRASS7 r.sun
464+
- algorithm: grass7:r.sun.insoltime
465+
name: GRASS7 r.sun (insoltime)
466466
params:
467467
-m: false
468468
-p: false
469+
GRASS_RASTER_FORMAT_META: ''
470+
GRASS_RASTER_FORMAT_OPT: ''
469471
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
470-
GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
472+
albedo_value: 0.2
471473
aspect:
472-
name: custom/grass7/float_raster.tif
474+
name: custom/grass7/raster_6class.tif
473475
type: raster
476+
aspect_value: 270.0
474477
day: 1
475-
declination: 0.0
476478
distance_step: 1.0
477479
elevation:
478-
name: custom/grass7/raster_6class.tif
480+
name: custom/grass7/float_raster.tif
479481
type: raster
482+
npartitions: 1
480483
slope:
481484
name: custom/grass7/float_raster.tif
482485
type: raster
486+
slope_value: 0.0
483487
step: 0.5
484488
results:
485489
beam_rad:
486-
hash: c43a64c35cd5999888b1dc7099249a54f37df8658cbe9c30b92627e5
490+
hash: 4428e6601576375c17cb0d37f74e3317db218b9660d3e9483f444279
487491
type: rasterhash
488492
diff_rad:
489-
hash: ecaa83578ab6eaf24a48f2fc265e8f1deff743c145af9c85cd39bceb
493+
hash: a05bb9e71f3a539b74a07235b5873738d3049960c8b2b5fd37cc7826
490494
type: rasterhash
491495
glob_rad:
492-
hash: 3917bc5633ce2225c864055d4b3c952b87461cbe48093b8fd9738215
496+
hash: 511d713ab666e171167a9a137ea246eefc90042e149ded73281362fa
493497
type: rasterhash
494498
insol_time:
495-
hash: 64851f59edafe67d007da78f33b7491b949d5be3eca83ef513e2b11f
499+
hash: 45954c661088e55d7740f7b9b89e21217a34d25868f751e8d0a67d31
500+
type: rasterhash
501+
refl_rad:
502+
hash: 278011afa98bcdfd87a2c476bc4abac96266a2a13ac9d20696733941
503+
type: rasterhash
504+
505+
- algorithm: grass7:r.sun.incidout
506+
name: GRASS7 r.sun (incidout)
507+
params:
508+
-m: false
509+
-p: false
510+
GRASS_RASTER_FORMAT_META: ''
511+
GRASS_RASTER_FORMAT_OPT: ''
512+
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
513+
albedo_value: 0.2
514+
aspect:
515+
name: custom/grass7/raster_6class.tif
516+
type: raster
517+
aspect_value: 270.0
518+
day: 1
519+
distance_step: 1.0
520+
elevation:
521+
name: custom/grass7/float_raster.tif
522+
type: raster
523+
npartitions: 1
524+
slope:
525+
name: custom/grass7/float_raster.tif
526+
type: raster
527+
slope_value: 0.0
528+
step: 0.5
529+
time: 8.0
530+
results:
531+
beam_rad:
532+
hash: b2459789ef2f04adc13a02d016f314594eaaf6f89e42fdf35d06e46b
533+
type: rasterhash
534+
diff_rad:
535+
hash: 7dbe38013812f372389f1ce1b60eae6755e005326e2373472ec65443
536+
type: rasterhash
537+
glob_rad:
538+
hash: 41e68104b039b794efb580a52c79e61af84261f9fad8b2aaedce0316
539+
type: rasterhash
540+
incidout:
541+
hash: 5cd5e5a410da7593d2e0d3ad3cb01818cebddfb73d0439fcf8b30d05
496542
type: rasterhash
497543
refl_rad:
498-
hash: cd2002486c5117db9c493e365ff6983faf1ea92b1bbea87569d3ebdd
544+
hash: 5ac2d870ae11d726a16809cda2915b248f0180f3eedc0c7a4c8d8de5
499545
type: rasterhash
500546

501547
# - algorithm: grass7:r.stats.quantile.out

0 commit comments

Comments
 (0)
Please sign in to comment.