Re: map of temperature trends

From: Mira Berdahl <mberdahl_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 07 2013 - 12:43:46 MDT

Hi Alan,
Great - that solves my problem!
Best,
Mira

> onedtond doesn't retain metadata so you have to set the metadata for
> slope2d.
>
> quick way to do this:
> slope2d!0 = "lat"
> slope2d!1 = "lon"
> slope2d&lat = data&lat
> slope2d&lon = data&lon
>
> Alan.
>
>
>
> ##############################
> Alan Brammer,
> PhD Student,
>
> Department of Atmospheric and Environmental Sciences,
> University at Albany, State University of New York, Albany, NY, 12222
> abrammer@albany.edu
> ##############################
>
> On Jun 7, 2013, at 12:40 PM, Alan Brammer <abrammer@albany.edu> wrote:
>
>>> slope2d =
>>> onedtond(temp@slope,(/dimsizes(data@lat),dimsizes(data@lon)/))
>>
>>
>> Quick guess but i think the above should be
>>
>> slope2d = onedtond(temp@slope,(/dimsizes(data&lat),dimsizes(data&lon)/))
>>
>> note the change of @ to &.
>>
>>
>> Alan.
>>
>> ##############################
>> Alan Brammer,
>> PhD Student,
>>
>> Department of Atmospheric and Environmental Sciences,
>> University at Albany, State University of New York, Albany, NY, 12222
>> abrammer@albany.edu
>> ##############################
>>
>> On Jun 7, 2013, at 12:00 PM, Mira Berdahl <mberdahl@envsci.rutgers.edu>
>> wrote:
>>
>>> Hi Everyone,
>>>
>>> I am trying to generate a map of annual temperature trends from a file
>>> with Dimensions and sizes: [time | 1140] x [lat | 64] x [lon | 128].
>>>
>>> I cannot seem to retain the [lat] and [lon] attributes of the original
>>> data file in my calculated slope, and thus can't plot my map.
>>>
>>> I've copied my code here:
>>>
>>> in = addfile("tas_Amon_BNU-ESM_rcp45_r1i1p1_200601-210012.nc","r")
>>>
>>> data= in->tas
>>> temp = dtrend_msg(data&time,data(lat|:,lon|:,time|:),True,True)
>>> slope2d =
>>> onedtond(temp@slope,(/dimsizes(data@lat),dimsizes(data@lon)/))
>>>
>>> end
>>>
>>> I receive the following error message when I run this:
>>> fatal:Dimension (0) of (slope2d) is not named and therefore doesn't
>>> have
>>> an associated coordinate variable
>>>
>>> If I use
>>> slope2d = onedtond(temp@slope(/64,128/)
>>> instead, the script runs, but I cannot plot it on a map because lat and
>>> lon are not attributes.
>>>
>>> Does anyone see what I am doing wrong here?
>>>
>>> Thanks very much!
>>> MB
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 7 12:43:53 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 11 2013 - 12:03:58 MDT