Skip to content

r.sun.daily

Runs r.sun for multiple days in loop (mode 2)

r.sun.daily [-tpm] elevation=name [aspect=string] [slope=string] [linke=name] [linke_value=float] [albedo=name] [albedo_value=float] [lat=name] [long=name] [horizon_basename=basename] [horizon_step=stepsize] start_day=integer end_day=integer [day_step=integer] [step=float] [civil_time=float] [beam_rad=string] [diff_rad=string] [refl_rad=string] [glob_rad=string] [insol_time=string] [beam_rad_basename=string] [diff_rad_basename=string] [refl_rad_basename=string] [glob_rad_basename=string] [insol_time_basename=string] [solar_constant=float] [method=string] [nprocs=integer] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.sun.daily elevation=name start_day=0 end_day=0

grass.script.run_command("r.sun.daily", elevation, aspect=None, slope=None, linke=None, linke_value=3.0, albedo=None, albedo_value=0.2, lat=None, long=None, horizon_basename=None, horizon_step=None, start_day, end_day, day_step=1, step=0.5, civil_time=None, beam_rad=None, diff_rad=None, refl_rad=None, glob_rad=None, insol_time=None, beam_rad_basename=None, diff_rad_basename=None, refl_rad_basename=None, glob_rad_basename=None, insol_time_basename=None, solar_constant=None, method="sum", nprocs=1, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.run_command("r.sun.daily", elevation="name", start_day=0, end_day=0)

grass.tools.Tools.r_sun_daily(elevation, aspect=None, slope=None, linke=None, linke_value=3.0, albedo=None, albedo_value=0.2, lat=None, long=None, horizon_basename=None, horizon_step=None, start_day, end_day, day_step=1, step=0.5, civil_time=None, beam_rad=None, diff_rad=None, refl_rad=None, glob_rad=None, insol_time=None, beam_rad_basename=None, diff_rad_basename=None, refl_rad_basename=None, glob_rad_basename=None, insol_time_basename=None, solar_constant=None, method="sum", nprocs=1, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.r_sun_daily(elevation="name", start_day=0, end_day=0)

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

Parameters

elevation=name [required]
    Name of the input elevation raster map [meters]
aspect=string
    Name of the input aspect map (terrain aspect or azimuth of the solar panel) [decimal degrees]
slope=string
    Name of the input slope raster map (terrain slope or solar panel inclination) [decimal degrees]
linke=name
    Name of the Linke atmospheric turbidity coefficient input raster map [-]
linke_value=float
    A single value of the Linke atmospheric turbidity coefficient [-]
    Allowed values: 0.0-
    Default: 3.0
albedo=name
    Name of the ground albedo coefficient input raster map [-]
albedo_value=float
    A single value of the ground albedo coefficient [-]
    Allowed values: 0.0-1.0
    Default: 0.2
lat=name
    Name of input raster map containing latitudes (if projection undefined) [decimal degrees]
long=name
    Name of input raster map containing longitudes (if projection undefined) [decimal degrees]
horizon_basename=basename
    The horizon information input map basename
horizon_step=stepsize
    Angle step size for multidirectional horizon [degrees]
start_day=integer [required]
    Start day (of year) of interval
    Allowed values: 1-365
end_day=integer [required]
    End day (of year) of interval
    Allowed values: 1-365
day_step=integer
    Run r.sun for every n-th day [days]
    Allowed values: 1-365
    Default: 1
step=float
    Time step when computing all-day radiation [decimal hours]
    Default: 0.5
civil_time=float
    Civil time zone value, if none, the time will be local solar time
beam_rad=string
    Output beam irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
diff_rad=string
    Output diffuse irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
refl_rad=string
    Output ground reflected irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
glob_rad=string
    Output global (total) irradiance/irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
insol_time=string
    Output insolation time raster map aggregated for the whole period of time [h]
beam_rad_basename=string
    Base name for output beam irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
diff_rad_basename=string
    Base name for output diffuse irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
refl_rad_basename=string
    Base name for output ground reflected irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
glob_rad_basename=string
    Base name for output global (total) irradiance/irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
insol_time_basename=string
    Base name for output insolation time raster map aggregated for the whole period of time [h]
    Underscore and day number are added to the base name for daily maps
solar_constant=float
    Solar constant [W/m^2]
    If not specified, r.sun default will be used.
method=string
    Method for daily maps aggregation
    Allowed values: sum, average
    Default: sum
nprocs=integer
    Number of r.sun processes to run in parallel
    Allowed values: 1-
    Default: 1
-t
    Register created series of output maps into temporal dataset
    Dataset name is the same as the base name for the output series of maps
-p
    Do not incorporate the shadowing effect of terrain
-m
    Use the low-memory version of the program
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

elevation : str, required
    Name of the input elevation raster map [meters]
    Used as: input, raster, name
aspect : str, optional
    Name of the input aspect map (terrain aspect or azimuth of the solar panel) [decimal degrees]
    Used as: input, raster
slope : str, optional
    Name of the input slope raster map (terrain slope or solar panel inclination) [decimal degrees]
    Used as: input, raster
linke : str, optional
    Name of the Linke atmospheric turbidity coefficient input raster map [-]
    Used as: input, raster, name
linke_value : float, optional
    A single value of the Linke atmospheric turbidity coefficient [-]
    Used as: float
    Allowed values: 0.0-
    Default: 3.0
albedo : str, optional
    Name of the ground albedo coefficient input raster map [-]
    Used as: input, raster, name
albedo_value : float, optional
    A single value of the ground albedo coefficient [-]
    Used as: float
    Allowed values: 0.0-1.0
    Default: 0.2
lat : str, optional
    Name of input raster map containing latitudes (if projection undefined) [decimal degrees]
    Used as: input, raster, name
long : str, optional
    Name of input raster map containing longitudes (if projection undefined) [decimal degrees]
    Used as: input, raster, name
horizon_basename : str, optional
    The horizon information input map basename
    Used as: input, raster, basename
horizon_step : str, optional
    Angle step size for multidirectional horizon [degrees]
    Used as: input, raster, stepsize
start_day : int, required
    Start day (of year) of interval
    Allowed values: 1-365
end_day : int, required
    End day (of year) of interval
    Allowed values: 1-365
day_step : int, optional
    Run r.sun for every n-th day [days]
    Allowed values: 1-365
    Default: 1
step : float, optional
    Time step when computing all-day radiation [decimal hours]
    Default: 0.5
civil_time : float, optional
    Civil time zone value, if none, the time will be local solar time
beam_rad : str, optional
    Output beam irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
diff_rad : str, optional
    Output diffuse irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
refl_rad : str, optional
    Output ground reflected irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
glob_rad : str, optional
    Output global (total) irradiance/irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
insol_time : str, optional
    Output insolation time raster map aggregated for the whole period of time [h]
    Used as: output, raster
beam_rad_basename : str, optional
    Base name for output beam irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
diff_rad_basename : str, optional
    Base name for output diffuse irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
refl_rad_basename : str, optional
    Base name for output ground reflected irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
glob_rad_basename : str, optional
    Base name for output global (total) irradiance/irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
insol_time_basename : str, optional
    Base name for output insolation time raster map aggregated for the whole period of time [h]
    Underscore and day number are added to the base name for daily maps
solar_constant : float, optional
    Solar constant [W/m^2]
    If not specified, r.sun default will be used.
method : str, optional
    Method for daily maps aggregation
    Allowed values: sum, average
    Default: sum
nprocs : int, optional
    Number of r.sun processes to run in parallel
    Allowed values: 1-
    Default: 1
flags : str, optional
    Allowed values: t, p, m
    t
        Register created series of output maps into temporal dataset
        Dataset name is the same as the base name for the output series of maps
    p
        Do not incorporate the shadowing effect of terrain
    m
        Use the low-memory version of the program
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

elevation : str | np.ndarray, required
    Name of the input elevation raster map [meters]
    Used as: input, raster, name
aspect : str | np.ndarray, optional
    Name of the input aspect map (terrain aspect or azimuth of the solar panel) [decimal degrees]
    Used as: input, raster
slope : str | np.ndarray, optional
    Name of the input slope raster map (terrain slope or solar panel inclination) [decimal degrees]
    Used as: input, raster
linke : str | np.ndarray, optional
    Name of the Linke atmospheric turbidity coefficient input raster map [-]
    Used as: input, raster, name
linke_value : float, optional
    A single value of the Linke atmospheric turbidity coefficient [-]
    Used as: float
    Allowed values: 0.0-
    Default: 3.0
albedo : str | np.ndarray, optional
    Name of the ground albedo coefficient input raster map [-]
    Used as: input, raster, name
albedo_value : float, optional
    A single value of the ground albedo coefficient [-]
    Used as: float
    Allowed values: 0.0-1.0
    Default: 0.2
lat : str | np.ndarray, optional
    Name of input raster map containing latitudes (if projection undefined) [decimal degrees]
    Used as: input, raster, name
long : str | np.ndarray, optional
    Name of input raster map containing longitudes (if projection undefined) [decimal degrees]
    Used as: input, raster, name
horizon_basename : str | np.ndarray, optional
    The horizon information input map basename
    Used as: input, raster, basename
horizon_step : str | np.ndarray, optional
    Angle step size for multidirectional horizon [degrees]
    Used as: input, raster, stepsize
start_day : int, required
    Start day (of year) of interval
    Allowed values: 1-365
end_day : int, required
    End day (of year) of interval
    Allowed values: 1-365
day_step : int, optional
    Run r.sun for every n-th day [days]
    Allowed values: 1-365
    Default: 1
step : float, optional
    Time step when computing all-day radiation [decimal hours]
    Default: 0.5
civil_time : float, optional
    Civil time zone value, if none, the time will be local solar time
beam_rad : str | type(np.ndarray) | type(np.array) | type(gs.array.array), optional
    Output beam irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
diff_rad : str | type(np.ndarray) | type(np.array) | type(gs.array.array), optional
    Output diffuse irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
refl_rad : str | type(np.ndarray) | type(np.array) | type(gs.array.array), optional
    Output ground reflected irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
glob_rad : str | type(np.ndarray) | type(np.array) | type(gs.array.array), optional
    Output global (total) irradiance/irradiation raster map aggregated for the whole period of time [Wh.m-2.day-1]
    Used as: output, raster
insol_time : str | type(np.ndarray) | type(np.array) | type(gs.array.array), optional
    Output insolation time raster map aggregated for the whole period of time [h]
    Used as: output, raster
beam_rad_basename : str, optional
    Base name for output beam irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
diff_rad_basename : str, optional
    Base name for output diffuse irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
refl_rad_basename : str, optional
    Base name for output ground reflected irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
glob_rad_basename : str, optional
    Base name for output global (total) irradiance/irradiation raster maps [Wh.m-2.day-1]
    Underscore and day number are added to the base name for daily maps
insol_time_basename : str, optional
    Base name for output insolation time raster map aggregated for the whole period of time [h]
    Underscore and day number are added to the base name for daily maps
solar_constant : float, optional
    Solar constant [W/m^2]
    If not specified, r.sun default will be used.
method : str, optional
    Method for daily maps aggregation
    Allowed values: sum, average
    Default: sum
nprocs : int, optional
    Number of r.sun processes to run in parallel
    Allowed values: 1-
    Default: 1
flags : str, optional
    Allowed values: t, p, m
    t
        Register created series of output maps into temporal dataset
        Dataset name is the same as the base name for the output series of maps
    p
        Do not incorporate the shadowing effect of terrain
    m
        Use the low-memory version of the program
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | np.ndarray | tuple[np.ndarray] | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned. If an array type (e.g., np.ndarray) is used for one of the raster outputs, the result will be an array and will have the shape corresponding to the computational region. If an array type is used for more than one raster output, the result will be a tuple of arrays.

DESCRIPTION

r.sun.daily is a convenient script for running r.sun for multiple days in a loop. It corresponds to mode 2 (aggregation mode, see r.sun manual page).

Output parameters explanation

There are two basic options:

  • output series of maps (one for each day): options containing basename in their name
  • output one map which is an aggregation of the intermediate maps

You can choose any combination of parameters: e.g. total map of diffuse radiance and series of beam radiance maps. Series of maps are (if flag t is checked) registered to space time raster dataset with relative time and point time (not interval time). For GRASS 6, only timestamp is assigned.

EXAMPLE

g.region raster=elevation -p
r.sun.daily elevation=elevation start_day=30 end_day=40 \
            beam_rad_basename=beam beam_rad=beam_sum nprocs=4 -t
# show information about newly created space time dataset
t.info beam

# show information about newly created beam_sum raster map
r.info beam

SEE ALSO

r.sun
r.sun.hourly in Addons

AUTHORS

Vaclav Petras, NCSU GeoForAll Lab,
Anna Petrasova, NCSU GeoForAll Lab

SOURCE CODE

Available at: r.sun.daily source code (history)
Latest change: Friday Feb 21 10:10:05 2025 in commit 7d78fe3