Re: Do functions always strip their results from any attributes?

From: wxtofly <wxtofly_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 14 2011 - 11:35:04 MST
There is a trick you can use though...
Example 1:

myvar = a float variable with attribute @description defined.
mynewvar=myvar ; this transfers all the attributes and descriptions
                               ; then change the values
 
mynewvar = round(myvar,3) => mynewvar is an integer variable with no @description.

Caveat is that you must want/expect dimensions to match.

TJ Olney


On 01/12/2011 02:36 PM, Emilie Vanvyve wrote:
Hello,

I have noticed that when I use functions (at least some of them), the end result has lost all traces of attributes.

Example 1:
myvar = a float variable with attribute @description defined.
mynewvar = round(myvar,3) => mynewvar is an integer variable with no @description.

Example 2:
myvar = a variable with attribute @units defined.
mynewvar = ndtooned(myvar) => mynewvar doesn't have any @units attribute.

The second case is a bit more annoying when it comes down to handling date/time variables. Most time handling functions require the @units attribute to be defined in order to function correctly (e.g. ut_string). One needs to redefine each time the @units attribute before using the function.

I was wondering why this is happening. Is any function intrinsically a "value-only" assignment as explained here http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#Assignment?

Emilie

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



--

TJ's Blanchard Page    My Wx Widget  Ft Ebey (Whidbey) NWS Seattle ASP  
: MAPS/RUC2 | Lo Alt | MM5 Bham Obs Fire Winds Rasp Soundings
Winds Aloft   R♥sp    Visible Satellite  Fcst Discussion   Fraser Valley  Windgrams text
Blanchard Digital | ♥Meteogram ♦UW Satellite   | Loop ♥ Discussion With Images Windcast Blipspots
  Quick Radar NWS Radar 9 Meso-stations   Pressure gradients WA Meso Stations map Time/hght/wind
MesoW GoogleMaps aprs current Personal Wx Stations Wind Map now, sfc winds  |  bl winds


  RASP Regional Atmospheric Soaring Predictions for PNW      || Average BL wind loop Blanchard   
       Surface wind forecast Loops: | Animated Radar   |  | loop Blanchard | loop PNW | loop FtEbey | loop Tiger | loop FraserValley

       Layered by altitude Sea Level to 850mb (approx 5000 ft) looped by time wind forecasts:
Blanchard Pressure Level Loop | Tiger Pressure Level Loop | Fraser Valley Pressure Level Loop
All day hour-by-hour text RUC2/MAPS soundings
These have no graphics and are designed to be printed to take with you to the site.
After sunclipse there will be one run for the next day but it only has MAPS soundings.
  Woodside/Sumas/Bridal     Black Mt     Big Johnson     Stewart same as Blanchard     Ft Ebey     Skagit Valley     Tiger  
Blipsp⊕ts: | Baldy | BJ | Black | BlackLZ | Blanchard | Chelan | Iron | Saddle | Stewart | Tiger | FtEbey | Woodside | Bridal Falls
| Current Rapid Update Soundings for flying sites | Winds aloft Seatac & Vancouver | Visible Satellite zoomed | NWS forecasts |
Abbreviated pages for mobile devices. | Blanchard | Tiger | Ft Ebey | East Side
The Seattle Forecast Discussion "translated" or with maps or original form without maps (available sooner) Learn to read the maps. Soundings Tutorial
Cloud Forecast -- RUC based Meteogram for KBLI Bellingham    |   RUC based Meteogram for CYXX Abbotsford -- Cloud Forecast

TJ Olney Weather: Site Map

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

raspicon16.png llapse1.png fireSky.gif discuss.jpg windgramico.png wbarb3.png
Received on Fri Jan 14 11:35:15 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:16 MST