How to read a variable with "\(" in name?

From: Strada, Susanna <susanna.strada_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 03 2014 - 16:39:39 MST

Dear all,

I'm trying to read from a NetCDF file a variable named "cos\(SZA\)".
I obtained the name from the header of the file; the variable refers to the cosine of the Solar Zenith Angle.

Using ncdump -v cos\(SZA\) and the Panoply software, I checked that the variable contains data and that these values are consistent (positive, lower than 1).

I tried using the $…$ syntax since I saw that you use this method for variable names that contain "-" symbols. (from the NCL-Talk Archives, message: "Re: Read variable with parenthesis in name?").

    varname = "cos\(SZA\)"
    cos_SZA = f->$varname$

Unfortunately, it didn't work for my case and I got the following error message (same as without the $…$ syntax):

fatal:["Execute.c":5900]:variable (cos\(SZA\)) is not in file (f)

Does anyone have a suggestion to figure out this issue?

Many thanks for your help!

Best,
Susanna

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 3 16:39:51 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT