[re-posted to the list as it may be of wider interest, maybe
someone knows?]
Glynn, all,
I have discovered a pressing problem (for me) in
r.mapcalc as far as I see. I am doing time series
processing of satellite data to find frost periods. As
far as I see the if() doesn't behave as it should:
# input data, look reasonable:
GRASS 6.1.cvs (pat):~ > r.info -r modis_t_a_lst1km20040102.daily_min
min=-24.290000
max=-16.510000
GRASS 6.1.cvs (pat):~ > r.info -r startday_previous
min=1
max=1
GRASS 6.1.cvs (pat):~ > r.info -r condition_previous
min=1
max=1
GRASS 6.1.cvs (pat):~ > r.info -r duration
min=1
max=1
# filter command to check if a new frost period starts or
# an existing one continues:
GRASS 6.1.cvs (pat):~ > r.mapcalc 'startday=if(modis_t_a_lst1km20040102.daily_min < -2.0 && (startday_previous == 0 || condition_previous == 0), 2, startday_previous)'
100%
GRASS 6.1.cvs (pat):~ > r.info -r startday
min=-2147483648
max=-2147483648
GRASS 6.1.cvs (pat):~ > r.univar startday
...
total null and non-null cells: 1136163
total null cells: 1136163
Of the non-null cells:
----------------------
n: 0
minimum: nan
maximum: nan
range: nan
mean: nan
standard deviation: nan
variance: nan
variation coefficient: nan %
sum: 0
#### ...apparently no output at all.
# settings:
g.region -p
projection: 99 (Transverse Mercator)
zone: 0
datum: rome40
ellipsoid: international
north: 5233880.40466952
south: 5050480.40466952
west: 1573324.58937663
east: 1821124.58937663
nsres: 200
ewres: 200
rows: 917
cols: 1239
# Redhat Enterprise RHEL4
uname -a
Linux eden 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64 x86_64 x86_64 GNU/Linux
##############################
# configuration:
XEON="-mcpu=nocona -mtune=nocona -m64 -minline-all-stringops"
# some flags to catch all possible problems:
MYCFLAGS="-g -Wall -Werror-implicit-function-declaration -fno-common $XEON"
MYCXXFLAGS="-g -Wall"
# RHEL 4/64bit:
CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCXXFLAGS" ./configure \
--enable-64bit \
--with-libs=/usr/lib64 \
--with-cxx \
--with-gdal=/usr/local/bin/gdal-config \
--with-postgres-includes=/usr/include/pgsql --with-postgres-libs=/usr/lib \
--without-mysql \
--without-odbc \
--with-nls \
--with-fftw \
--with-freetype --with-freetype-includes=/usr/include/freetype2 \
--disable-largefile \
--without-opendwg \
2>&1 | tee config_log.txt
# compiled: Mar 27 2006
Do you have any idea why this fails? Some tests with other data on a
32bit box didn't show this problem.
I am lost here, cry for help
thanks
Markus