|
Hi Billy z10 does have only a 2-D grid. What's getting us here is thinking about "once it's evaluated". Ferret doesn't fix in memory the array on its first evaluation, so if you ask for Z10[k=1], now that's a different _expression_. Another thing we could do here is to nail down the context to work on in Z as part of the original definition, for instance, yes? let z10 = temp[z=0:1000@LOC:10]and then you could work with z10 [k=1] or z10[k=800]. (And those are identical, since z10 does not now depend on K.) -Ansley On 12/1/2015 10:57 AM, William S.
Kessler wrote:
Hi Andrew, Ryo - I don't think that was Ryo's question. What he wants is for a field defined by @loc (once it is evaluated from a 3-d field) to have the grid of a 2-d field. Of course Ferret understands it as 2-d (thus it can be plotted with SHADE), but the variable Z10 retains its 3-d grid. He would like it to be 2-d so he can refer to Z10[k=1], and get the single-z-level field. But I understand a definition like TEMP[Z=@LOC:10] to be comparable to TEMP[Z=400], namely it describes a 2-d field that can be SHADEd, but it remains part of a 3-d grid. I think it can be converted to 2-d with RESHAPE: LET Z102D = RESHAPE(Z10,X[GX=TEMP]+Y[GX=TEMP]) (No time to test this!) BillyOn Dec 1, 2015, at 9:58 AM, Andrew Wittenberg - NOAA Federal <andrew.wittenberg@xxxxxxxx> wrote: Hi Ryo, Thanks for the clearly-stated question. [All: this is a good example of how to ask a question so that it gets answered quickly. In particular, Ryo provided a working example using one of Ferret's built-in datasets, e.g. levitus_climatology, coads_climatology, or monthly_navy_winds; and also pasted in the Ferret header, which shows what Ferret version he was using, just in case it turned out to be a bug.] Note that Z=@LOC doesn't mean "search from top to bottom for 10 degC." Instead it means "search within the future evaluation context for 10 degC." So when you later specify z10[k=1], @LOC dutifully searches only over k=1; and since 10degC isn't found in the top level, it evaluates to "missing." To insulate @LOC from future contexts, specify explicit z-limits: NOAA/PMEL TMAP FERRET v6.951 (10/29/2015) Linux 2.6.32-573.7.1.el6.x86_64 64-bit - 10/30/15 1-Dec-15 12:40 yes? use levitus_climatology yes? let z10 = temp[z=0:6000@LOC:10] yes? let below_z10 = z[g=temp] LT z10 yes? shade/x=180 below_z10 yes? shade/z=400 below_z10 The relevant documentation is: ../../documentation/users-guide/variables-xpressions/XPRESSIONS#_VPINDEXENTRY_528 See also the following answer in the Ferret email archives: ../fu_2006/msg00098.html which was found by searching the email archives for "missing context". Andrew On Tue, Dec 1, 2015 at 6:06 AM, Ryo Furue <furue@xxxxxxxxxx> wrote: |