How does one specify direction of scans in r.in.ascii?

Michael Shapiro shapiro at zorro.cecer.army.mil
Tue Feb 4 11:41:25 EST 1992


(1) If the raster file is displaying upside down, then the data must be
stored liked that. GRASS doesn't flip data based on the header
coordinates. It just uses them to figure out how many rows and columns
are in the datafile. So this means you either must rotate (m.rot90) or
flip (m.flip) your datafile. Since you have an ascii file, import it
using r.in.ascii as you did, then uncompress the raster file. Then run
either m.rot90 and/or m.flip directly on the cell file (under cell/).

(2) There is some confusion in your description of the data. If the
data is really 90N to 90s in 1 degree increments, then there should be
180 rows of data. 1.125 implies:
	160 rows: (90 - -90)/1.125 = 180/1.125 = 160
and
     320 columns: (180 - -180)/1.125 = 360/1.125 = 320.

Can you specify how many rows and columns there are in the data?  Are
the coordinates you give for the "edges" true edges or do they go thru
the center of the edge rows and columns, or are they some other logic
(eg, upper left hand corner of the NW and SE corner cells).

|
|I am trying to do the following data import:
|
|I have a global surface albedo file which starts at -180 lon , -90 lat
|and ends at 180 lon, 90 lat, in 1 degree increments.
|
|In grass, I have defined a region North 90, South -90, East 360, West
|0, and Resolution 1.125 deg by 1.125 deg.  When I do the r.in.ascii,
|and display the data, I get a rasterfile with East and West and North
|and South reversed (a mirror image of an upside down world).
|
|Question: Is there a way to specify in the ASCII file which way the
|data is stored in it?  E.g.: as positive or negative
|latitude/longitude increments?
|Or do I have to always prepare the ASCII data to run from North-East
|to South-West?  Which to me is counter intuitive.
|
|-- 
|Tschuess ...rick...
|_______________________________________________________________________________
|Richard Wagener				| 
|Bldg. 426, rm. 43			| IP: wagener at bnl.gov
|Environmental Chemistry Division	| DEC: 44048::rwagener
|Brookhaven National Laboratory		| phone: 1-516-282-5886
|Upton, New York 11973, U.S.A.		| fax:   1-516-282-2887
|_______________________________________________________________________________
|
|



More information about the grass-user mailing list