Re: plotting correct depth/lat - not points

From: Michael Hemming <michael.hemming_at_nyahnyahspammersnyahnyah>
Date: Tue May 27 2014 - 08:16:33 MDT

*Netcdf information (it's from MPIOM) *

File format: netCDF
     -1 : Institut Source Ttype Levels Num Gridsize Num Dtype :
Parameter name
      1 : unknown unknown constant 21 1 180 1 F64 : AMOC3
    Grid coordinates :
      1 : lonlat > size : dim = 180 nx = 0 ny = 180
                         LAT_2 : first = -89.5 last = 89.5 inc = 1
degrees_north
    Vertical coordinates :
      1 : depth_below_sea m : 0 14 26 41 59 80 105 135 175 235
315 415 535 685
                                     865 1075 1315 1585 1885 2235 2635
                            bounds : -7-7 7-20 20-33.5 33.5-50 50-69.5
69.5-92.5 92.5-120
                                     120-155 155-205 205-275 275-365
365-475 475-610
                                     610-775 775-970 970-1195 1195-1450
1450-1735 1735-2060
                                     2060-2435 2435-2835
cdo sinfon: Processed 1 variable ( 0.00s )

*My script:

*
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

amoc8 = addfile ("/directory/amoc_08.nc", "r")
amoc = amoc8->AMOC3

a = (amoc*(1E-6))/1025

wks = gsn_open_wks("x11", "AMOC_plot")
gsn_define_colormap(wks,"B1WhRe")

res = True
res@tiMainString = "Atlantic Ocean Meridional
Overturning Streamfunction [Sv]"
res@gsnSpreadColors = True
res@cnFillOn = True
res@cnLinesOn = False
res@trYReverse = True
;printVarSummary(amoc8)

plot = gsn_csm_contour(wks,a,res)

I have also tried using 'lat2d','getfilevaratts' and '@long_name'
commands but they didn't seem to work...

thanks!
Michael

On 27/05/2014 16:07, Karin Meier-Fleischer wrote:
> Hi Michael,
>
> could you be more specific and send a 'ncdump -h' output from your
> data file (if it is not to long)
> and your NCL script. It is impossible to say something which we don't
> know and can't see.
>
> Bye,
> Karin
>
> Am 27.05.2014 um 15:40 schrieb Michael Hemming
> <michael.hemming@mpimet.mpg.de <mailto:michael.hemming@mpimet.mpg.de>>:
>
>> Is it an attribute problem? (i.e. the fill value is missing?) I tried
>> to use:
>>
>> a = getfilevaratts(data,"slp")
>>
>> but it gave:
>>
>> Variable: amoca
>> Type: string
>> Total Size: 8 bytes
>> 1 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [1]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : missing
>> (0) missing
>>
>>
>>
>> -------- Original Message --------
>> Subject: Re: [ncl-talk] plotting correct depth/lat - not points
>> Date: Mon, 26 May 2014 15:19:24 +0200
>> From: Michael Hemming <michael.hemming@mpimet.mpg.de>
>> To: ncl-talk@ucar.edu Talk <ncl-talk@ucar.edu>
>>
>>
>>
>> *I printed the variable:*
>> /
>> //Number of global attributes: 2//
>> //Number of Dimension: 3//
>> //Number of variables: 4/
>>
>> *res looks like:*
>>
>> /res = True//
>> //res@tiMainString = "Sea water potential temperature
>> (Deg C) with depth"//
>> ////
>> //res@gsnSpreadColors = True//
>> //res@cnFillOn = True//
>> //res@cnLinesOn = False//
>> //res@trYReverse = True/
>>
>> thanks,
>> Michael
>>
>>
>> On 26/05/2014 14:34, Dennis Shea wrote:
>>> ferret must be getting information from somewhere.
>>> There is too little information in your post to
>>> provide an answer.
>>>
>>> ---
>>>
>>> What meta data is associated with the variable 'a' ?
>>>
>>> printVarSummary(a)
>>>
>>> What does 'res' look like?
>>>
>>> ---
>>>
>>>
>>> On 5/26/14, 4:30 AM, Michael Hemming wrote:
>>>> Hey everyone,
>>>>
>>>> I have a netcdf file that looks like this:
>>>>
>>>> AMOC: j x k = 180 x 21 = lat x depth (curvilinear grid)
>>>>
>>>> I want to create a contour plot that shows AMOC values with depth,
>>>> however, when I try to do this, it plots lat as 1:180 and depth as
>>>> 1:21.
>>>> When using Ferret, I get the correct lat and depth values
>>>> automatically
>>>> shown.
>>>>
>>>> So my question is: how can I make ncl do what ferret does?
>>>>
>>>> after loading in the data and assigning the variable etc... I use:
>>>>
>>>>
>>>> /wks = gsn_open_wks("x11", "AMOC_plot")//
>>>> //gsn_define_colormap(wks,"B1WhRe")//
>>>> ////
>>>> //plot = gsn_csm_contour(wks,a,res)/
>>>>
>>>>
>>>>
>>>> thanks,
>>>> Michael
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>
> _______________________________________________________________________
> Dipl. Geophys. Karin Meier-Fleischer
> Application Support, Visualization
>
> Deutsches Klimarechenzentrum GmbH E-Mail:
> meier-fleischer@dkrz.de <mailto:meier-fleischer@dkrz.de>
>
> Bundesstrasse 45a Internet: http://www.dkrz.de/
> 20146 Hamburg Phone: +49 (0)40 460094 126
> Germany Fax: +49 (0)40 460094 270
>
> Geschäftsführer: Prof. Dr. Thomas Ludwig
> Sitz der Gesellschaft: Hamburg
> Amtsgericht Hamburg HRB 39784
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 27 08:16:52 2014

This archive was generated by hypermail 2.1.8 : Tue May 27 2014 - 15:45:08 MDT