Re: [GRASS-user] Error while exporting

2011-05-22 Thread Markus Metz
On Wed, May 18, 2011 at 10:29 AM, Glynn Clements
gl...@gclements.plus.com wrote:

 Markus Metz wrote:

  The NULL value of the reclass map is not recognized as NULL value, but
  instead treated as a valid number.
 
  This seems to be a bug in the GRASS library, specifically in
  G_get_null_value_row() and has probably been around since GRASS 6.3.
 
  AFAICT, it has been around as long as G_get_null_value_row() has
  existed. G_get_null_value_row() returns the raw data, without any
  reclass applied.
 
  As it stands, this function probably isn't of much use.

 Remove?

 No, fix (as per r46323).

Done in r46345, r46346.

 If you only care about whether a cell is null or non-null, reading and
 decoding the actual data is needless overhead.

 If you need to read the data anyhow, then use that rather than reading
 the null data a second time (the raw data is cached, but conversion
 and masking will be re-done).

 r.out.gdal was the latter case, so it shouldn't have been using that
 function. OGSF is also the latter case, and should be fixed.

OGSF fixed in r46347 for trunk. This is an enhancement, no bug because
[Rast|G]_get_null_value_row is fixed, so the OGSF change does not need
to be backported.

Markus M
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] mediawiki: recorded desktop sessions

2011-05-22 Thread Martin Landa
Hi all,

2011/4/26 Hamish hamis...@yahoo.com:
 Aren wrote:
 embed Youtube videos on appropriate Mediawiki pages.

 this looks promising:
  http://www.mediawikiwidgets.org/YouTube

I have installed mediawiki widget extension and create special
template for including youtube videos [1]. See also wxGUI Modeler page
for the usage [2].

Martin

[1] http://grass.osgeo.org/wiki/Template:YouTube
[2] http://grass.osgeo.org/wiki/WxGUI_Modeler#HowTo

-- 
Martin Landa landa.martin gmail.com * http://geo.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


RE: [GRASS-user] Convert Floating Point Raster to Integer Raster

2011-05-22 Thread jctor...@ugr.es
Si.
Os mande un correo ayer.


Enviado desde mi Nokia
-Mensaje original-
De: Michael Morin
Enviado:  19/05/2011 01:04:49
Para: grass-user@lists.osgeo.org
Asunto:  [GRASS-user] Convert Floating Point Raster to Integer Raster

Techies,

In ArcInfo I used to write .aml code to covert Floating Point Grids to Integer 
Grids.  Doing this produced a .vat table in the new Integer grid thereby giving 
me elevation data which i could then used to develop painted DEMS.  

Question...?  Would r.mapcalc or r.reclass be the tools I would use?..could 
someone share some example code how I would make this conversion?

I will sum.

Bonjour.

Michael D. Morin
mmo...@cassblue.com





___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Possible to model exatmospheric radiation with r.sun?

2011-05-22 Thread Dylan Beaudette
On Monday, May 16, 2011, Jonathan Greenberg wrote:
 Folks:
 
 I was wondering if there is a way to turn the atmosphere off in
 r.sun, and model a top of atmosphere radiation?
 
 --j

Hi Jonathan,

If you check out the metadata associated with the output from r.sun, you will 
find the following: (note the Extraterrestrial irradiance entry)

r.info rad_beam.187
 ++
 | Layer:rad_beam.187   Date: Thu Mar 24 17:17:43 2011
|
 | Mapset:   PERMANENT  Login of Creator: dylan   
|
 | Location: ca630
|
 | DataBase: /home/dylan/grass
|
 | Title: ( rad_beam.187 )
|
 | Timestamp: none
|
 ||
 |
|
 |   Type of Map:  raster   Number of Categories: 255 
|
 |   Data Type:FCELL  
|
 |   Rows: 1396   
|
 |   Columns:  553
|
 |   Total Cells:  771988 
|
 |Projection: UTM (zone 10)   
|
 |N:4235950S:4221990   Res:10 
|
 |E: 697230W: 691700   Res:10 
|
 |   Range of data:min = 4492.042  max = 7758.583 
|
 |
|
 |   Data Description:
|
 |generated by r.sun  
|
 |
|
 |   Comments:
|
 |    
|
 | Day [1-365]:  187  
|
 | Solar constant (W/m^2):   1367 
|
 | Extraterrestrial irradiance (W/m^2):  1321.303439  
|
 | Declination (rad):0.396193 
|
 | Latitude min-max(deg):38.1250 - 38.2500
|
 | Sunrise time min-max (hr.):   4.72 - 4.72  
|
 | Sunset time min-max (hr.):19.28 - 19.28
|
 | Time step (hr.):  0.5000   
|
 | Linke turbidity factor:   3.0  
|
 | Ground albedo:0.200
|
 | -  
|
 |
|
 |r.sun -s elevin=ned10m aspin=aspect10m aspect=270 slopein=slope\   
|
 |10m slope=0.0 lin=3.0 alb=0.2 beam_rad=rad_beam.187 day=187 step=\   
|
 |0.5 dist=1.0 numpartitions=1
|



 -- 
 Jonathan A. Greenberg, PhD
 Assistant Project Scientist
 Center for Spatial Technologies and Remote Sensing (CSTARS)
 Department of Land, Air and Water Resources
 University of California, Davis
 One Shields Avenue
 Davis, CA 95616
 Phone: 415-763-5476
 AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
 


-- 
Dylan E. Beaudette
USDA-NRCS Soil Scientist
California Soil Resource Lab
http://casoilresource.lawr.ucdavis.edu/
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


RE: [GRASS-user] Re: i.atcorr returns all NULL values

2011-05-22 Thread Chemin, Yann (IWMI)
p192 r030 image of July 2003 of Italy (L5TM) successfully corrected for
band 1 and 2. 
The following script works well in GRASS GIS Trunk SVN.
Please try.

#!/bin/bash

echo Part 0 (Import in GRASS GIS)
echo RUN from the MTL.txt directory and within the GRASS environment
echo ---
echo It will create for *.[1-7] images from r.in.gdal
echo image=DN

# DEM file name
dem=dem
r.mapcalc expression=dem=5.0
# r.in.gdal input=$dem output=$dem


for file in L5*.TIF
do
   out=$(echo $file | sed
's/\(.*\)_\(.*\)_B\(.*\)0.TIF/\1\_\2\.\3/g')
   echo $out
   r.in.gdal --overwrite input=$file output=$out
done

echo Part 1 (After DN)
echo ---
echo It will create for *.toar.* images from i.landsat.toar
echo image=top of atmosphere reflectance

for L5_MTL_file in L5*_MTL.txt
do
   L5_prefix=$(echo $L5_MTL_file | sed 's/\(.*\)_MTL.txt/\1/')
   i.landsat.toar -t input_prefix=$L5_prefix\.
output_prefix=$L5_prefix\.toar.  metfile=$L5_MTL_file sensor=tm5
done


echo Part 2 (After TOAR)
echo ---
echo It will create for *.surf.* images from i.atcorr
echo Atmospherically corrected image=surface reflectance
#-
# For i.atcorr scripting
#-
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7 6
15)
vis_len=${#vis_list[*]}
echo $vis_len
i=0

# Location of parameter file
root=~/
# Basic script for i.atcorr for L 5 TM
#Geometrical conditions (L5TM)
geom=7
#Sensor height (satellite is -1000)
sens_height=-1000
#Atmospheric mode
atm_mode=6 #us standard 62 (for lack of more precise model)
#Aerosol model
aerosol_mode=1 #continental
#satellite band number (L5TM [25,26,27,28,29,30])
satbandno=25 #Band 1 of L5TM is first to undergo atmospheric correction

for file in $(g.mlist type=rast pattern=*.toar.1)
do
 #Here we suppose you have altitude (DEM) and Visibility (VIS) maps
ready
 
#---
 r.mapcalc expression=visibility=${vis_list[$i]} --overwrite
 # Dummy visibility value for atcorr param file
 vis=12
 #Increment i
 i=$(echo $i + 1 | bc)
 #Altitude dummy value (in Km should be negative in this param file)
 #(overwritten by DEM raster input)
 alt=-1.200
 # L5 basename as stored in GRASS GIS and used by i.landsat.toar
 L5basename=$(echo $file | sed 's/\(.*\)\.\(.*\)\.\(.*\)/\1/')
 echo $L5basename

 #---
 # Please change as you need
 #---

 #datetime of satellite overpass (month, day, GMT decimal hour)
 echo Input: GMT (i.e. 6.30)
 read gmt
 #mdh=6 03 6.30
 monthday=$(echo $L5basename | sed 's/\(.*\)_...\(.*\)/\2/')
 day=$(echo $L5basename | sed 's/\(.*\)_.\(.*\)/\2/')
 month=$(echo ($monthday - $day) / 100 | bc)
 mdh=$month $day $gmt
 echo $mdh

 # Central Lat/Long
 north=$(g.region -p | grep north | sed 's/north:\ \(.*\)/\1/' | bc)
 south=$(g.region -p | grep south | sed 's/south:\ \(.*\)/\1/' | bc)
 east=$(g.region -p | grep east | sed 's/east:\ \(.*\)/\1/' | bc)
 west=$(g.region -p | grep west | sed 's/west:\ \(.*\)/\1/' | bc)
 Lat_nonproj=$(echo (($north - $south)/2.0) + $south | bc )
 Long_nonproj=$(echo (($east - $west)/2.0) + $west | bc )
 echo $Long_nonproj $Lat_nonproj  tempfile.txt
 Long=$(m.proj -o -d input=tempfile.txt | sed
's/\(.*\)|\(.*\)|\(.*\)/\1/')
 Lat=$(m.proj -o -d input=tempfile.txt | sed
's/\(.*\)|\(.*\)|\(.*\)/\2/')
 echo $Long_nonproj $Lat_nonproj
 echo $Long $Lat

 for bandno in 1 2 3 4 5 7
 do # Generate the parameterization file
 echo $geom- geometrical
conditions=Landsat 5 TM  $root/param_L5.txt
 echo $mdh $Long $Lat   - month day hh.ddd longitude latitude
(\hh.ddd\ is in decimal hours GMT)   $root/param_L5.txt
 echo $atm_mode- atmospheric
mode=tropical  $root/param_L5.txt
 echo $aerosol_mode- aerosols
model=continental  $root/param_L5.txt
 echo $vis   - visibility [km] (aerosol
model concentration), not used as there is raster input 
$root/param_L5.txt
 echo $alt   - mean target elevation above sea
level [km] (here 600m asl), not used as there is raster input 
$root/param_L5.txt
 echo $sens_height- sensor height (here,
sensor on board a satellite)  $root/param_L5.txt
 echo $satbandno   - 'i'th band of TM
Landsat 5  $root/param_L5.txt
 # Process band-wise atmospheric correction with 6s
 cat $root/param_L5.txt
 echo i.atcorr -r input=$L5basename.toar.$bandno elevation=$dem
visibility=visibility parameters=$root/param_L5.txt
output=$L5basename.surf.$bandno range=0,1 rescale=0,1 --overwrite
 i.atcorr -r input=$L5basename.toar.$bandno elevation=$dem
visibility=visibility parameters=$root/param_L5.txt
output=$L5basename.surf.$bandno range=0,1 rescale=0,1 --overwrite
 satbandno=$((satbandno+1))
 

Re: [GRASS-user] Possible to model exatmospheric radiation with r.sun?

2011-05-22 Thread Hamish
Jonathan Greenberg wrote:
 I was wondering if there is a way to turn the
 atmosphere off in r.sun, and model a top of
 atmosphere radiation?

I wonder if it enough to keep the cloud coefficients (i.e. coefbh, coefdh
r.rescale'd GRIB files) at the default clear-sky conditions, and set
the Linke coefficient at lin=1.00.

then compare how well the direct beam result matches the solar constant?
(aka the see what happens experimental approach)


Hamish

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Classifying single landcover

2011-05-22 Thread Chethan S.
Hi all!

For my work I am interested in identifying a single kind of vegetation from
LANDSAT Images. If I use signature file with just one signature class(I take
many training sites all over the area), the classified image with i.maxlik
appears full pink. On the other hand if I randomly pick training sites for
one more class(water) and have two classes in the signature file this does
not happen. So I am wondering will it not be possible to use a single
class's signature sites for supervised classification.

Thanks and regards,

Chethan S.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Synchronizing two displays

2011-05-22 Thread Pierre Roudier
Hi list,

I'm using the latest GRASS 7 svn update, and I wonder if it there is
an option to synchronize two displays?

Indeed, I can open as many displays as I want (FileMap display New)
but what would be great, to compare layers, would be to force each
display window to show the same spatial extent.

Cheers,

Pierre

-- 
Scientist
Landcare Research, New Zealand
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user