[Thread Prev][Thread Next][Index]

Re: [ferret_users] let/like='z' --- use of quoted names



Hi Ryo,

I have found and fixed the cause of this.  Ferret has forever tried to be case-insensitive, letting users ignore the upper- or lower-case spelling of variables.  Here there was a tangle in some of our logic for this because when the names are in quotes they should be handled in a case-sensitive way.  (If your file had happened to use an upper-case Z, this would all work!)

Thank you for reporting this.    The fix will be in our upcoming release.

Ansley

On 3/24/2020 9:43 AM, Ansley C. Manke wrote:

Hi Ryo,

Thanks for narrowing this down.  This is definitely a bug.  As you say the solution should be renaming the variable.  It seems the attribute-access code isn't doing its job for these renamed variables.  We'll look into that.

If you don't need attributes other than the ones Ferret has always automatically kept, the rename would work:

yes? use input_data.nc
yes? set variable/name=rose 'z'

yes? shade/x=100:112/y=0:8 rose


would be labeled with the correct units and title. And SAVE etc would keep the units and title.  But the attributes GMT_version, node_offset, and Conventions would not be on the variable "rose".



On 3/24/2020 7:33 AM, Ryo Furue wrote:
Hi Saurabh,

set var/name=newname 'problematic_name'

should be the best solution. And it almost works:

yes? set data ETOPO1_Ice_c_gmt4.grd
yes? set var/name=rose 'z'
yes? show attributes rose
 **ERROR: variable unknown or not in data set: rose
yes? let/like=rose zzz = rose
yes? show attributes zzz
     attributes for user-defined variables
 zzz.missing_value = -1.E+34
 zzz.Conventions = COARDS/CF-1.0
 zzz.title = ETOPO1_Ice_c_gmt4.grd
 zzz.GMT_version = 4.4.0
 zzz.node_offset = 1
yes?

As you can see, one more level of indirection (zzz == rose == 'z') gives the desired results.  This seems to be the best workaround.

Cheers,
Ryo

-- 
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.
-- 
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.

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

Privacy Policy | Disclaimer | Accessibility Statement