[Thread Prev][Thread Next][Index]

Re: [ferret_users] quicker detection of dimensions improperly specified



Hi Ryo,
I understand the point, and that would be nice, but it's not simple. As you know, there are lots of operations that affect the shape of the result of an expression. For those who may not have thought about the issue, you might average over one dimension reducing the number of dimensions in the result; and many Ferret functions and operations can alter the dimensions and grid of the arguments of the function. Until the expression has been loaded into memory, we don't have a good idea of its true shape. Grid-changing functions, transformations over one or more dimensions, etc. can all affect the final "shape" of the variable.

One could imagine a sort of ghost operation that would go through the command stack and figure out the final shape without loading data, but there's nothing that actually gives us that. We'll have to think whether there's a reasonable way to add such a thing. The "SHOW GRID" command gives us the final grid of an expression but just lists the axes, not the extent that he expression has along those axes.

As things stand now, you could do something like execute a "stat" command on the expression, and see what the end shape is, but of course the point is you'd like to get the information before loading data into memory.

There are some points in the code where Ferret checks for an interrupt, and returns to the command line, so the whole load-a-variable sequence isn't necessarily processed before a Ctrl-C is acted upon, but something like a data read is done by a single call to the NetCDF library and that can't be easily interrupted. You could kill the Ferret process of course, but you don't necessarily want to do that.

-Ansley

On 10/16/2012 1:55 PM, Ryo Furue wrote:
Ferret users and developers,

I'm wondering if it's possible to detect an improper dimension
specification, such as

   yes? fill  some_3D_variable

UP FRONT . . .  It sometimes takes quite a bit of time before we
see the error message

   **ERROR: dimensions improperly specified: must be a 2D region

especially when the dataset is accessed across the network.

I make this mistake very often and then hit Ctrl-C frantically,
which it still takes Ferret quite a bit of time to respond to.

Regards,
Ryo



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement