[Thread Prev][Thread Next][Index]

Latitude axis read from a ASCII file



Dear Ferret users,

I need some help to understand and solve the problem explained hereafter... The point is that Ferret always reads upside down my latitude axis. North Pole becomes South Pole, and South Pole North one.

I read an ASCII file (GPCC-pre-199309.dat) containing 3 columns of data (longitude, latitude, precipitation) :

Data : GPCC 1.0 degree | mean precipitation
Period : September 1993
Area : global (-180./+180.) (Lon: -180.00 <-> 180.00 Lat: -90.00 <-> 90.00)
Output-Id : 15072004135347_GPCC_VISUALIZER
Columns : Lon Lat Value (at grid center)
Missing-Value: -99999.99

-179.50 89.50 -99999.99
-178.50 89.50 -99999.99
-177.50 89.50 -99999.99
-176.50 89.50 -99999.99
-175.50 89.50 -99999.99
... ... ...
175.50 -89.50 0.12
176.50 -89.50 0.12
177.50 -89.50 0.12
178.50 -89.50 0.12
179.50 -89.50 0.12

I have made a script in Ferret to read those values (in order to save them into a NetCDF file). Here is "easy-readable" version of it :

!spatial and temporal grid

define axis/X=179.5W:179.5E:1/units=longitude x_axis
define axis/Y=89.5N:89.5S:1/units=latidude y_axis
define axis/CALENDAR=360_DAY/t="30-SEP-1993":"30-SEP-1993":30/units=days t_axis

define grid/x=x_axis/y=y_axis/t=t_axis g_grid

!read variable(s) in ASCII file

file/grid=g_grid/skip=7/var="lon,lat,PP" "../ascii/GPCC-pre-199309.txt"

show data

list PP[j=1,i=355:360]
list PP[j=180,i=1:5]

exit

Here is what Ferret tells me when executing my script :

yes? go gpcc2nc

!spatial and temporal grid


define axis/X=179.5W:179.5E:1/units=longitude x_axis
define axis/Y=89.5N:89.5S:1/units=latidude y_axis
define axis/CALENDAR=360_DAY/t="30-sep-1993":"30-sep-1993":30/units=days t_axis


define grid/x=x_axis/y=y_axis/t=t_axis g_grid


!read variable(s) in ASCII file


file/grid=g_grid/skip=7/var="lon,lat,PP" "../ascii/GPCC-pre-199309.txt"
!-> SET DATA/EZ/grid=g_grid/skip=7/var="lon,lat,PP" "../ascii/GPCC-pre-199309.txt"


show data
currently SET data sets:
1> ../ascii/GPCC-pre-199309.txt (default)
name title I J K L
LON LON 1:360 1:180 ... 1:1
LAT LAT 1:360 1:180 ... 1:1
PP PP 1:360 1:180 ... 1:1




list PP[j=1,i=355:360]
VARIABLE : PP
FILENAME : GPCC-pre-199309.txt
SUBSET : 6 points (LONGITUDE)
LATITUDE : 89.5S
TIME : 30-SEP-1993 00:00
89.5S
1
174.5E / 355: -100000.
175.5E / 356: -100000.
176.5E / 357: -100000.
177.5E / 358: -100000.
178.5E / 359: -100000.
179.5E / 360: -100000.
list PP[j=180,i=1:5]
VARIABLE : PP
FILENAME : GPCC-pre-199309.txt
SUBSET : 5 points (LONGITUDE)
LATITUDE : 89.5N
TIME : 30-SEP-1993 00:00
89.5N
180
179.5W / 1: 0.1600
178.5W / 2: 0.1200
177.5W / 3: 0.1200
176.5W / 4: 0.1200
175.5W / 5: 0.1200


exit
yes?

So, values of North Pole shifted to South Pole and ones of South Pole to North Pole! (And I don't know where the 0.1600 does come from.)
I assume I'm wrong somewhere, but where? It's not the first time that I get that problem. I tried to inverse the definition of the x-axis, to use the /order instruction when reading the data, it does not work. The fact that the longitude axis (1st column) varies more rapidly that the latitude one (2nd column) might be a (the) problem?

Does anyone have any idea?

Thanks in advance for any answer!

Emilie


____________________________________________________________
Emilie VANVYVE
Physicist, PhD student

Université catholique de Louvain (UCL)
Institut d'astronomie et de géophysique G. Lemaître (ASTR)
Chemin du Cyclotron, 2
1348 Louvain-la-Neuve (Belgium)
Phone : +32-(0)10-473300
Fax : +32-(0)10-474722
E-mail : vanvyve@astr.ucl.ac.be
Web : www.astr.ucl.ac.be

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement