[ncl-talk] Panel Plot

Dennis Shea shea at ucar.edu
Wed Jun 3 11:33:33 MDT 2015


Looking at scripts can be a tedious and time consuming task.
--

Your code

  infile = addfile("/home/amadou/NCL/all_new.nc", "r")
  temp = infile->air_temperature
  Temp = temp(256392:258575,7)                                ; for 5 years
(2012_JFMAMJ)
  time = infile->time
  Time = time(256392:258575)

  index = ind(Temp(:) .ne. Temp at _FillValue)                   ; indices of
Temp without missing values
  printVarSummary(index)
  Time0 = time(256444:258575)
  Temp1 = new((/2132/), float)
  Temp1 = Temp(index)

[snip]

[1] You can **not** use the following to check for missing values. These
can *only* be checked via the 'ismissing' function.

     index = ind(Temp(:) .ne. Temp at _FillValue)                   ; indices
of Temp without missing values

     Use

     index = ind(.not.ismissing(Temp))   ; indices of Temp without missing
values

     https://www.ncl.ucar.edu/Document/Functions/Built-in/ismissing.shtml
     https://www.ncl.ucar.edu/Document/Functions/Built-in/ind.shtml

[2]
As I mentioned to you in a previous ncl-talk response, you can not just
eliminate missing values and perform a wavelet analysis on the 'good'
values. Omitting values will result in 'numbers' but they are not the
'correct numbers'. Omitting values results in spectral gaps. If you have
(say) hourly values and very short spans with missing values you could
perform a linear interpolation. This will affect the spectra but likely not
in any substantive manner.

[3]
You have two different sets of index values: 256392:258575 and
256444:258575 ... this is likely the source of your plotting issue.

Good programming practice suggest that you use variables rather than hard
wired constants.

  tStrt  = 256392
  tLast = 258575

and use these

  temp = infile->air_temperature
  Temp = temp(tStrt:tLast,7)                                ; for 5 years
(2012_JFMAMJ)
  time = infile->time
  Time = time(tStrt:tLast)

Actually .... better

  Temp = infile->air_temperature(tStrt:tLast,7)
   printVarSummary(Temp)









On Wed, Jun 3, 2015 at 6:00 AM, Amadou Coulibaly <mpapin24 at gmail.com> wrote:

> Dear NCL users,
>
> I tried to do a panel plot between "Wavelet Power Spectrum" and "Timesires"
> from hourly temperature data of April-May-June. But this data contained 61
> hours of missing values that I cancelled. When I plotted my data, I
> remarked that the x-axis on the wavelet power spectrum does not match the
> timeserie one.
>
> What is wrong with my script?
>
> Please find attached my script and my plot.
>
> Best
> --
> * COULIBALY   AMADOU   *
> PhD  Student  on  West  African  Climate  System (WACS)
> FUTA - Federal  University  of  Technology of Akure, Nigeria
>
> *Visiting Student - *
> *University of Cologne, Germany**Institute of Geophysics and Meteorology*
> Pohligstr. 3 / Office 3.102
> D-50969 Köln
>
> *Project*: WASCAL (West African Science Service Centre on Climate Change
> and Adapted Land Use)
> Phone:(+234) 810 795 2836 /(+223) 65 67 27 57 /(+226) 64 57 37 27 /+49
> 15218352574
>
> E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com
>
> "*The time is always right to do right": Nelson Mandela*
>
> *"Character is like a tree and reputation like a shadow.  The shadow is
> what we think of it; the tree is the real thing" : Abraham Lincoln*
>
> *"Do what you can, with what you have, where you are" Theodore Roosevelt*
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150603/2ea068de/attachment.html 


More information about the ncl-talk mailing list