<div dir="ltr"><div>Not sure about the "band pass ... on a sphere" or the spherical harmonic code you included.</div><div>------------<br></div><div>The most common application would be performing  an FFT at each latitude.</div><div>Something like the following.   (Not tested)<br></div><div><br></div><div>   z      = f->Z_GDS0_ISBL     ;   z(time,level,lat,lon)  ->  z(ntim,klvl,nlat,mlon) <br>   dimz = dimsizes(z)<br>   print(dimz)<br><br>   zcf = ezfftf (z)       ; ==> zcf(2,ntim,klvl,nlat,mlon/2)                     <br>                               ; ==> zcf@xbar ==> contains the means<br>   printVarSummary(zcf)<br><br>; Reconstruct using only waves 2,3,4,5  <br><br>  zcf(:,:,:,:,0:0) = 0.0    ; wave   1 set to zero<br>  zcf(:,:,:,:,5:  ) = 0.0    ; waves    set to zero<br><br>  zcf@xbar = 0.0<br>  z_2345  = ezfftb (zcf, zcf@xbar)<br>  printVarSummary(z_2345)</div><div>---</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 28, 2022 at 8:49 PM Min-Woo Kim via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.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">Dear NCL experts,<div><br></div><div>I'm looking for a method of band-pass filtering on a shpere using NCL.</div><div>"<a href="https://mailman.ucar.edu/pipermail/ncl-talk/2019-May/014800.html" target="_blank">https://mailman.ucar.edu/pipermail/ncl-talk/2019-May/014800.html</a>"<br></div><div>The above URL is the advice of that in ncl-talk.</div><div>Following the advice, I'm trying as below.</div><div>***------- ncl scripts</div><div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Gp = f->Z_GDS0_ISBL ; geopotential in ERA5(GRIB)<br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";min-height:15px"><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">lon = tofloat(Gp&g0_lon_2)</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Gp_w1<span>  </span>= Gp</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Gp_w5<span>  </span>= Gp</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Gp_a <span>  </span>= Gp</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">spec_harmonics = shaeC(Gp) ; to spherical harmonics domain</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">spec_w1<span>  </span>= tri_trunC(spec_harmonics,1) ; truncate </p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">spec_w5<span>  </span>= tri_trunC(spec_harmonics,5) ; truncate</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">spec_a <span>  </span>= where(spec_w1.eq.spec_w5,0,spec_w5) ; band-pass filtering (1<n<=5)  </p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";min-height:15px"><br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";min-height:15px">Gp_w1<span>    </span>= shseC(spec_w1,dimsizes(lon)) ; return to physical domain<br></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Gp_w5<span>    </span>= shseC(spec_w5,dimsizes(lon)) ; return to physical domain</p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Gp_a <span>    </span>= shseC(spec_a ,dimsizes(lon))    ; return to physical domain</p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">***-------</span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">I want to remain only the wavenumber from 2 to 5 of geopotential(so consider about n=2,3,4,5). </span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">Is this the right process for band-pass filtering on a sphere?</p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><br></p></div><div>Thank you,</div><div>Minwoo Kim</div><div><div><div dir="ltr"><div dir="ltr"><div><p style="color:rgb(17,17,17);font-family:"line-height:1.5;position:relative;top:-3px;padding-bottom:8px;font-weight:bold;";font-size:inherit;margin:0px;padding:0px;word-break:break-all">---------------</p></div>김 민우<div><span style="color:rgb(136,136,136);font-family:"line-height:17px;";font-size:12px">연구원</span><span style="font-family:"line-height:17px;";font-size:12px;padding:0px 6px;color:rgb(215,215,215)">|</span><span style="color:rgb(136,136,136);font-family:"line-height:17px;";font-size:12px">공주대학교 종관기상연구실</span><br></div><div><table style="color:rgb(17,17,17);font-family:"Apple SD Gothic Neo","Malgun Gothic","\00b9d1\00c740  \00ace0\00b515",sans-serif;font-size:13.3333px;width:568px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="color:rgb(136,136,136);font-size:12px;font-family:"line-height:17px;";line-height:1.5"><p style="margin:0px;padding:0px"><span style="font-weight:bold;color:rgb(17,17,17)">m</span> 010-7708-9120<span style="padding:0px 6px;color:rgb(215,215,215)">|</span><span style="font-weight:bold;color:rgb(17,17,17)">e</span> <a href="mailto:minwookim.9120@gmail.com" target="_blank">minwookim.9120@gmail.com</a></p></td></tr><tr><td style="color:rgb(136,136,136);font-size:12px;font-family:"line-height:17px;";line-height:1.5"><table style="width:568px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="font-family:"line-height:17px;";line-height:1.5"><p style="margin:0px;padding:0px"><span style="font-weight:bold;color:rgb(17,17,17)">a</span> 충청남도 공주시 공주대학로 56, 자연과학대학 445호</p></td></tr></tbody></table><p style="margin:0px;padding:0px"><br style="color:rgb(17,17,17);font-family:"Apple SD Gothic Neo","Malgun Gothic","\00b9d1\00c740  \00ace0\00b515",sans-serif;font-size:13.3333px"></p></td></tr></tbody></table></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>