[GRASS-dev] Linke turbidity in r.sun.daily

Nikos Alexandris nik at nikosalexandris.net
Fri May 15 13:18:18 PDT 2015


* Nikos Alexandris <nik at nikosalexandris.net> [2015-05-15 16:34:38 +0300]:

> * Vaclav Petras <wenzeslaus at gmail.com> [2015-05-15 08:41:17 -0400]:
> 
> > On Fri, May 15, 2015 at 8:10 AM, Nikos Alexandris <nik at nikosalexandris.net>
> > wrote:
> > 
> > > I have another use-case, hence another update to the script.  Does
> > > anyone care to have a look at the proposed diff (really a quick hack, no
> > > extensive testing done but it works for me).
> > >
> > 
> > Looks good except for computing the slope and aspect on the fly.
> > r.slope.aspect runs twice once for slope, once for aspect. With current
> > code, it actually looks that there might be some override issues. Try
> > harder to preserve current mechanism where one r.slope.aspect call is build
> > according to missing inputs. You need to change the if conditions somehow.
> > (Only reading the diff.)
> 
> Known issue, thanks for reading Vaclav.  Will rework another day on it.

I am not getting easily away from this script.

I want to check whether a strds already exists, and if it does, don't
re-create it (overwrite it). Rather, register follow-up maps in the existing strds.

Makes sense?  This need rose from the attempt to loop r.sun.daily over
different monthly Linke Turbitidy values. Something like the following:

--%<---
for LINE in `cat monthly_linke_map_start_day_end_day.csv` ;do set --
$(echo ${LINE} |tr "|" " ") && r.sun.daily elevation=srtm4 at PERMANENT
aspect_value=0 slope_value=0.0 albedo=albedo at albedo linke=$1
start_day=$2 end_day=$3 glob_rad_basename=global_rad_zero_$4
insol_time_basename=insol_time_$4 beam_rad_basename=beam_rad_zero_$4
diff_rad_basename=diff_rad_zero_$4 --o -t ;done
--->%--

Currently, each subsequent call of creating a strds, will overwrite if
it exists. Hence, only the maps involved in the last run of the above
loop will appear in the strds.

I would like to add support for multiple linke maps (linke_map=), and then,
necessarily, multiple start_day= and end_day= inputs. I don't have the
time to try it now, so I just want to add a check if a strds exists.


To do so, is something like the `check_stds` [0] exposed to the
scripter/appropriate?

Thanks, Nikos

[0]
<http://grass.osgeo.org/grass71/manuals/libpython/_modules/temporal/temporal_algebra.html#TemporalAlgebraParser.check_stds>




More information about the grass-dev mailing list