Re: Contour data with two different lon/lat grids onto the same map projection [message #71239 is a reply to message #71223] |
Thu, 03 June 2010 19:22   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Tess writes:
> However, if I load the variables from netcdf to idl variables, then
> run this script; it plots fine. If I immediately rerun the same script
> in the same idl session, I get the error:
> "CONTOUR: X,Y, or Z array dimensions are incompatible."
> The first couple of times I ran this script I was adding to it in
> stages, and running it to see what the results were; the error was a
> bit misleading in that way, as I thought it was the result of adding
> the pv grids to the rainfall grids I already had working on the plot.
> Hence my appeal to David and others for "ideas"! If I exit the IDL
> session and reload the variables in a new session to rerun the script,
> it plots fine first time. But only once per session!
>
> Not sure why this happens, but unless it's immediately obvious to
> anyone it's probably not worth pursuing...
Well, I take it by "script" you mean an IDL main
program (that is, not a procedure or function).
There is plenty in just this small code sample
to cause me to well believe such a script might
cause you trouble.
In fact, in spite of Mike Galloy proclaiming here the
other day that he often uses main programs, I rarely
do. And for exactly this reason. They can get you
in a world of strange hurt. You would probably find
out in a minute or two why you can't run the program
more than once if you made a procedure out of it.
I'm mostly confused by statements like this, though:
"if I load the variables from netcdf to idl variables..."
When you read the netCDF variables out of the file they ARE
IDL variables. No need to load anything. Any why is the
graphic being drawn over and over again in the same window
in a loop!?
I'm just not sure what to make of all this. Especially when
I see the limits on the MAP_SET command, which have no logical
connection to the latitude and longitude coordinates discussed
in your previous communications.
Perhaps this is just too small a code fragment to visualize the
rest of it. But, I would say, if it works at least once, I'd be
tempted to let it go as a good show. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|