[Thread Prev][Thread Next][Index]

Re: irregular box from ij grid to xy grid ...



Hello,

I have found something interesting to solve the problem I submitted a few hours ago. I think I'm close to solve it, but still need some help!

I could extract the latitudes and longitudes "edges" of my model domain (i=1:87,j=1:87), with:

yes? let x1 = samplei(lon[d=1],1)
yes? let y1 = samplei(lat[d=1],1)
yes? let x2 = samplej(lon[d=1],87)
yes? let y2 = samplej(lat[d=1],87)
yes? let x3 = samplei(lon[d=1],87)
yes? let y3 = samplei(lat[d=1],87)
yes? let x4 = samplej(lon[d=1],1)
yes? let y4 = samplej(lat[d=1],1)

... and plot 4 polygons, with:

yes? polygon/line/over x1,y1
yes? polygon/line/over x2,y2
yes? polygon/line/over x3,y3
yes? polygon/line/over x4,y4

I get this:

TIFF image



How can I do to remove the "straight lines" coming from each of the 4 polygon commands, in order to get only this "muffin" domain shape?
I've tried all possible combinations of ( ), { }, xi, yi, " ", e.g. among others:
yes? polygon/line/over x1,x2,x3,x4,y1,y2,y3,y4
**ERROR: invalid command: POLYGON may use 2 args (xpts,ypts) with /LINE only, or 3 args (xpts,ypts,color_value)
yes? polygon/line/over x1,y1,x2,y2,x3,y3,x4,y4
**ERROR: invalid command: POLYGON may use 2 args (xpts,ypts) with /LINE only, or 3 args (xpts,ypts,color_value)
yes? polygon/line/over {x1,x2,x3,x4},{y1,y2,y3,y4}
**ERROR: command syntax: X1,X2,X3,X4}
yes? shade/d=2/l=10 lsp ; go land
yes? polygon/line/over x1,x2,x3,x4,y1,y2,y3,y4
**ERROR: invalid command: POLYGON may use 2 args (xpts,ypts) with /LINE only, or 3 args (xpts,ypts,color_value)
yes? polygon/line/over x1,y1,x2,y2,x3,y3,x4,y4
**ERROR: invalid command: POLYGON may use 2 args (xpts,ypts) with /LINE only, or 3 args (xpts,ypts,color_value)
yes? polygon/line/over {x1,x2,x3,x4},{y1,y2,y3,y4}
**ERROR: command syntax: X1,X2,X3,X4}
yes? polygon/line/over (x1,x2,x3,x4),(y1,y2,y3,y4)
**ERROR: command syntax: (x1,x2,x3,x4)
Definition contains multiple expressions
yes? polygon/line/over {(x1,x2,x3,x4)},{(y1,y2,y3,y4)}
**ERROR: command syntax: (X1,X2,X3,X4)}
yes? polygon/line/over {"x1","x2","x3","x4"},{"y1","y2","y3","y4"}
**ERROR: illegal data type (float,string,...) for operation: {"x1","x2","x3","x4"}
yes? polygon/line/over ("x1","x2","x3","x4"),("y1","y2","y3","y4")
**ERROR: command syntax: ("x1","x2","x3","x4")
Definition contains multiple expressions
yes?


If anyone can help me on this... I don't know how to define my xi and yi variables so that they contain all needed values.
Thanks!

Emilie

Le 10 sept. 2004, à 11:39, Emilie Vanvyve a écrit :

Hello,

I was wondering the same as Wendy Wang, but for an irregular region and over an irregular grid... I tried your solutions, but it didn't work.

My challenge is the following (I joint 2 graphs to illustrate this):
"initialgrid.tiff" : I plot model data on their own grid which is cartesian. I use "shade var,lon,lat" to plot them on a curvilinear grid. But, I have in my data file all longitute and latitude values of the domain:
1> hiver-1994/mar/MAR.a20.1993.09.01-30.nc
name title I J K L
LON Longitude 1:87 1:87 ... ...
LAT Latitude 1:87 1:87 ... ...

"finalgrid.tiff" : I plot ERA data on their own grid. I'd like to restrict them to the model domain, or at least overlay a kind of "curved quadrilatere" to show where is exactly the model domain.

The problem is that I have to put up with 2 different grids and 2 different spatial resolutions.
Is there anyway to do that 'easily', without writing in/reading a ascii file? I was thinking to define a kind of "mask" variable, looking as stretched and curved trapeze, mask that I coud either plot over the data as a simple line, or use to restrict data to the model domain.

If anyone has any idea...!
Thanks in advance for any answer!

Emilie

<initialgrid.tiff>
<finalgrid.tiff>



____________________________________________________________
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
____________________________________________________________
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