Re: Mismatch of data with global map outline

From: <Freddie.Mpelasoka_at_nyahnyahspammersnyahnyah>
Date: Wed May 21 2014 - 17:29:57 MDT

Hi Mary,

Many thanks for your prompt help.

Regards, Freddie

From: Mary Haley [mailto:haley@ucar.edu]
Sent: Thursday, 22 May 2014 3:28 AM
To: Mpelasoka, Freddie (CLW, Black Mountain)
Cc: ncl-talk@ucar.edu
Subject: Re: Mismatch of data with global map outline

Hi Freddie,

The problem is that all of the metadata gets stripped off the variable when you do a calculation like this:

data1 = 100*(data21-data11)/data11

So while data21, data11, and data11 may all have attributes and coordinate arrays, "data1" will not. This is partly because NCL can't make any assumptions that the metadata for the new variable is based on the metadata of one or more of your arrays used in the calculation.

To get around this, you can use the "copy_VarMeta" procedure to copy metadata:

copy_VarMeta(data21,data1)
copy_VarMeta(data22,data2)
copy_VarMeta(data23,data3)
copy_VarMeta(data41,data4)
copy_VarMeta(data42,data5)
copy_VarMeta(data43,data6)

You will also want to set:

  res@gsnAddCyclic = True
so that you don't get a white seam in your plots.

Please see the attached plot.

--Mary

[cid:image001.png@01CF75A0.6524EE50]
On May 21, 2014, at 8:21 AM, Freddie.Mpelasoka@csiro.au<mailto:Freddie.Mpelasoka@csiro.au> wrote:

Dear All,

I managed to produce a plot of some global data but having a mismatch with the global map outline (please see the posted output). I get a warning to do with latitude longitude units. However, I have units (attributes) in my netcdf files.

- check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all. However, I do have these units (attributes) in the input netcdf files. I have posted the input files (file1.nc, file2.nc, file3.nc, file4.nc) script file: plot_freddie.ncl and an output file: Output.pdf at ftp.cgd.ucar.edu<http://ftp.cgd.ucar.edu> in incoming.

I will be very grateful for your help.

Cheers, Freddie
_______________________________________________
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

image001.png
Received on Wed May 21 17:30:25 2014

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