<div dir="auto">Please ignore last mail.<div dir="auto"><br></div><div dir="auto">Soma</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 26, 2019, 22:44 Soma Roy <<a href="mailto:somaroy892@gmail.com">somaroy892@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hello,<div dir="auto">What will be the size of "x" in the below line when I have 135 lon. and 129 lat. as in the input dataset?</div><div dir="auto"><br></div><div dir="auto"><pre style="white-space:pre-wrap"><span style="font-family:'arial','helvetica',sans-serif"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/random_normal.shtml" style="text-decoration-line:none;color:rgb(66,133,244)" target="_blank" rel="noreferrer"><b> </b>x = <b>random_normal</b></a>( 10, 5, (/ntim,nlat,mlon/) )
xNew = new( <b>dimsizes</b>(x), "float")</span></pre><pre style="white-space:pre-wrap">Kindly inform me.</pre><pre style="white-space:pre-wrap">Soma</pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 25, 2019, 23:18 Soma Roy <<a href="mailto:somaroy892@gmail.com" target="_blank" rel="noreferrer">somaroy892@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">So if we use fft2df, spatial extent will be reduced in output matrix?<div dir="auto">I can save coef., split coef. into real and imaginary part..but that is not the issue I am looking for.</div><div dir="auto"><br></div><div dir="auto">Kindly inform me.</div><div dir="auto"><br></div><div dir="auto">Soma</div><div dir="auto"><br><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 25, 2019, 14:26 Soma Roy <<a href="mailto:somaroy892@gmail.com" rel="noreferrer noreferrer" target="_blank">somaroy892@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>As per the below;<div dir="auto"><pre style="white-space:pre-wrap"> <span style="font-family:'arial','helvetica',sans-serif">ntim = 8
nlat = 6
mlon = 8<br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/random_normal.shtml" style="text-decoration-line:none;color:rgb(66,133,244)" rel="noreferrer noreferrer noreferrer" target="_blank"><b> </b>x = <b>random_normal</b></a>( 10, 5, (/ntim,nlat,mlon/) )
xNew = new( <b>dimsizes</b>(x), "float")
<br> do nt=0,ntim-1 <br> ; </span>ANALYSIS</pre><pre style="white-space:pre-wrap"><span style="font-family:'arial','helvetica',sans-serif"> coef = <b>fft2df</b> (x(nt,:,:_) ; <b>coef: ; [2] x [6] x [5] ; [2] x [nlat] x [<span style="background-color:rgb(255,255,255)"><font color="#f44336">mlon/2+1</font>]</span></b><span style="background-color:rgb(255,255,255)">
</span>
; do something with coef <b><== *YOUR* responsibility</b>
xNew(nt,:,:) = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2db.shtml" style="text-decoration-line:none;color:rgb(66,133,244)" rel="noreferrer noreferrer noreferrer" target="_blank"><b>fft2db</b></a> (coef) ; SYNTHESIS<br></span></pre><pre style="white-space:pre-wrap"><span style="font-family:'arial','helvetica',sans-serif"> end do<br></span></pre><pre style="white-space:pre-wrap">We can see that longitude is reduced from 8 to 5..</pre><pre style="white-space:pre-wrap">Can we place time dimension on that place keeping latxlon as total grid points in the 2 nd dimension?</pre><pre style="white-space:pre-wrap">Otherwise at the time of spatial plot, no.of grids will be short due to the reduction along longitude.</pre><pre style="white-space:pre-wrap">Kindly inform me about the above issue.</pre><pre style="white-space:pre-wrap">Let me know if I am thinking wrong in it.</pre><pre style="white-space:pre-wrap"><br></pre><pre style="white-space:pre-wrap">Thanking you,</pre><pre style="white-space:pre-wrap">Soma</pre><pre style="white-space:pre-wrap"><br></pre></div><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Feb 23, 2019, 04:02 Gus Correa <<a href="mailto:gus@ldeo.columbia.edu" rel="noreferrer noreferrer noreferrer" target="_blank">gus@ldeo.columbia.edu</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Just follow the very clear script outline that Dennis sent to you.</div><div>And where he wrote:</div><div><pre><span style="font-family:arial,helvetica,sans-serif">>> ; do something with coef <b><== *YOUR* responsibility</b></span></pre></div><div>take responsibility and do it.</div><div>Maybe, create a 4D array of dimensions (time, 2, k_lon, k_lat), (or if you prefer (2,time,k_lon,k_lat) ),</div><div>where k_lon, k_lat are the corresponding wavenumber index dimension sizes, and for each time record,</div><div>save the output of fft2df in the corresponding (time, :, :, :) array section/slice.<br></div><div>You may want to read the fft2df documentation to understand what you're doing, and create the array</div><div>to store what the function returns (complex numbers, separated in real and imaginary parts) with the correct size:<br></div><div><br></div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2df.shtml" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2df.shtml</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 22, 2019 at 3:37 PM Soma Roy <<a href="mailto:somaroy892@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">somaroy892@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Then how can I proceed?<div dir="auto">Please give me a hint..</div><div dir="auto"><br></div><div dir="auto">Soma</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Feb 23, 2019, 00:47 Gus Correa <<a href="mailto:gus@ldeo.columbia.edu" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">gus@ldeo.columbia.edu</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>If what you want is the *spatial* 2D Fourier Transform <br></div><div>(" fourier decomposition ... over lat lon", as stated in your original email),</div><div>i.e., if you're interested in the 2D wavenmuber components (not in the time frequencies)<br></div><div>you have to do it separately for each time record, as Dennis explained.</div><div><br></div><div>You can apply the 2D Fourier Transform function to the 2D array formed by the reshaped</div><div>lat,lon coordinates (into a 1D array) concatenated over the time dimension,</div><div>because all you need to apply a 2D Fourier transform is a 2D numerical array, <br></div><div>regardless of the meaning of the array components.<br></div><div>However, the result won't be the " fourier decomposition ... over lat lon" that you said you want.</div><div><br></div><div>I hope this helps,<br></div><div>Gus Correa<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 22, 2019 at 1:24 PM Soma Roy <<a href="mailto:somaroy892@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">somaroy892@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Best idea will be use nlat*nlon as total grid points using reshape and reorder the data so that input to the fft2df will be 2 dimensional (ngrids, ntim).<div dir="auto"><br></div><div dir="auto">Coef will then give you output as 2 x ngrids x (ntim/2+1).</div><div dir="auto"><br></div><div dir="auto">Soma</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 22, 2019, 21:32 Soma Roy <<a href="mailto:somaroy892@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">somaroy892@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Glad to know.<div dir="auto">Many thanks Dennis.<br><div dir="auto"><br></div><div dir="auto">Soma</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 22, 2019, 21:09 Dennis Shea <<a href="mailto:shea@ucar.edu" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">shea@ucar.edu</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,255)"><b>Please do not send direct emails to people. Only to ncl-talk.</b></span></div><div><br></div><div>If "X" is the data then how can we use it?<div dir="auto"><br></div><div dir="auto">X (ntime, nlat, nlon).</div><div dir="auto"><br></div><div dir="auto">Output result matrix should be same as X.</div><div dir="auto">==============<br></div></div><div><br></div><div><b>As noted in the documentation, </b>the function is prototyped as 2-dimensional</div><div><br></div><div><pre><b>function fft2df ( x [*][*])</b></pre></div><div>As I said, you must use a do loop. It is user (your) responsibility to do any book keepind [savinh]<br></div><div><pre> <span style="font-family:arial,helvetica,sans-serif">ntim = 8
nlat = 6
mlon = 8<br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/random_normal.shtml" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank"><b> </b>x = <b>random_normal</b></a>( 10, 5, (/ntim,nlat,mlon/) )
xNew = new( <b>dimsizes</b>(x), "float")
<br> do nt=0,ntim-1 <br> ; ANALYSIS<br> coef = <b>fft2df</b> (x(nt,:,:_) ; <b>coef: [2] x [6] x [5] ; [2] x [nlat] x [mlon/2+1]</b>
; do something with coef <b><== *YOUR* responsibility</b>
xNew(nt,:,:) = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2db.shtml" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank"><b>fft2db</b></a> (coef) ; SYNTHESIS<br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif"> end do<br><br>Please do not use this if you do not know how to use 2D FFT output.<br>ncl-talk can not become your programmer.<br><br> Again, as noted in the function documentation, a readable introduction to 2D-FFT is at:<br> <a href="http://www.dspguide.com/pdfbook.htm" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank"><b>http://www.dspguide.com/pdfbook.htm</b></a>
</span><br>===
<span style="font-family:arial,helvetica,sans-serif">As noted in the documentation, NCL uses<b> <a href="https://www2.cisl.ucar.edu/resources/legacy/fft5" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank"> FFTPACK5</a> </b>developed by Paul Swarztrauber and Richard Valent. <b><br></b>The specific Fortran subroutines used are:</span><b><br> fft2df:
<a href="http://www2.cisl.ucar.edu/resources/legacy/fft5/documentation#rfft2f.html" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://www2.cisl.ucar.edu/resources/legacy/fft5/documentation#rfft2f.html</a>
fft2db:
<a href="http://www2.cisl.ucar.edu/resources/legacy/fft5/documentation#rfft2b.html" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://www2.cisl.ucar.edu/resources/legacy/fft5/documentation#rfft2b.html</a>
</b></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 22, 2019 at 8:06 AM Soma Roy <<a href="mailto:somaroy892@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">somaroy892@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">If "X" is the data then how can we use it?<div dir="auto"><br></div><div dir="auto">X (ntime, nlat, nlon).</div><div dir="auto"><br></div><div dir="auto">Output result matrix should be same as X.</div><div dir="auto"><br></div><div dir="auto">Soma</div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 22, 2019, 20:24 Dennis Shea <<a href="mailto:shea@ucar.edu" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">shea@ucar.edu</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Please look at NCL's function documentation</div><div><br></div><div><b><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2df.shtml" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2df.shtml</a><a href="http://goog_952811495" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank"><br></a></b></div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2db.shtml" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank"><b>http://www.ncl.ucar.edu/Document/Functions/Built-in/fft2db.shtml</b></a></div><div><br></div><div>You will have to loop over each time step. <br></div><div><br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 22, 2019 at 12:09 AM Soma Roy <<a href="mailto:somaroy892@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">somaroy892@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hello,<div dir="auto">I have a time series data (ntime, nlat, nlon) in spatial domain. I want to calculate fourier decomposition of the same over lat lon.</div><div dir="auto">How to do it using ncl? Is there any function available for the above?</div><div dir="auto"><br></div><div dir="auto">Kindly inform.</div><div dir="auto"><br></div><div dir="auto">Thank you,</div><div dir="auto">Soma</div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>