# 3D coordinate system

From: Kyle Wilcox <Kyle.Wilcox_at_nyahnyahspammersnyahnyah>
Date: Thu, 27 Jul 2006 12:35:51 -0400

Hello again all! My problem of the week is:

I have been tasked with converting old legacy data into an OpenDAP
compatible file type (netCDF). The old files are flat ascii files
consisting of lat/lon in UTM, depth, and water temp. The first two
numbers are lat and lon in UTM. The second number is how many readings
from that coordinate were taken. Following the third number are the

354450,4304200,5,6.0,6.0,6.0,6.0,5.9
354400,4304150,4,6.0,6.0,6.0,6.0
354450,4304150,2,6.0,6.0
354350,4304100,5,6.0,6.0,6.0,6.0,5.9

So I now have x,y, and z as 1D arrays. I also store the water temp in a
2D array as (IndexOfLatandLonInXandY, depth).

Ex:
wtmp
(0,0) 6
(0,1) 6
(0,2) 6
(0,3) 6
(0,4) 5.9
(0,5) 0
...

x
(0) 354450
(1) 354400
(2) 354450
(3) 354350
(4) 354400
(5) 354250
...

y
(0) 4304200
(1) 4304150
(2) 4304150
(3) 4304100
(4) 4304100
(5) 4304050
...

z
(0) 0
(1) 1
(2) 2
(3) 3
(4) 4
(5) 5
...

My question is, how do I create a 3D array as (lat,lon,depth) =
the_water_temp? I have tried the following: (variables = max number of
depths, nrow2 = number of lat and lon pairs)

watertemp=new((/nrow2,nrow2,variables/),"float")
watertemp!0 = "lat"
watertemp!1 = "lon"
watertemp!2 = "depth"
watertemp&lat = x
watertemp&lon = y
watertemp&depth = z

do u=0, nrow2
do j=0, variables
watertemp(x(u),y(u),j) = wdata(u,j)
end do
end do

But that will generate a lot more pairs of lat and lon than I need, and
I get the 'Subscripts must be integer when not using coordinate
indexing' error, which I thought I was using.

Been working on this on and off for awhile, any help would be great!
Thanks.

```--
Kyle Wilcox
NOAA Chesapeake Bay Office
410 Severn Avenue
Suite 107A
Annapolis, MD 21403
office: (410) 295-3151
Kyle.Wilcox_at_noaa.gov
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
```
Received on Thu Jul 27 2006 - 10:35:51 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 28 2006 - 16:18:18 MDT