<div dir="ltr"><div><div><div><div><div><div><div><div><div>The dimension name change was done to avoid confusion <br><br></div> x(time,lat,lon) ... time coordinates has 'monthly' values<br><br><br></div> xAnnual(time,lat,lon) ; here 'time' is a yearly value<br></div>or<br></div> xAnnual(year,lat,lon) ; 'year' was used to emphasize the difference.<br><br></div>The user can assign 'year' coordinates<br><br></div> yrStrt = ....<br></div> yrLast = ....<br> <br></div> xAnnual&year = ispan(yrStrt,yrLast,1) ; assign appropriate values<br><br></div> printVarSummary(xAnnual)<br><br><br><div><div> <br><div><div><div><br><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 22, 2018 at 2:00 PM, Rick Brownrigg via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br></div>It appears that month_to_annua() has changed the temporal dimension to "year". I don't know enough about what you are doing, but is it appropriate to simply change "time" to "year" in the dimension reordering in the call to equiv_sample_size()?<br><br></div>Hope that helps...<br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jan 22, 2018 at 1:49 PM, Sri Nandini via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>Hello<br><br>I am trying to make estimates the number of independent values of a series of correlated
observations using equiv_sample_size based on annual values of my temperature which is below in part of script. However, i keep getting the error:(time) is not a dimension name in variable (t44), could not determine dimension number<br><br>My simple script is below:<br><br><br><br><br>; ==============================<wbr>==============================<wbr>==<br>; Open the file: Read only the user specified period <br>; ==============================<wbr>==============================<wbr>==<br>f= addfile("T2M_Cam5.nc", "r") ;Model Control<br>TIME = f->time<br>;YYYY = cd_calendar(TIME,-1)/100 <wbr> ; entire file<br>;iYYYY = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)<br>T41 = f->TREFHT(:,:,:)<br>printVarSummary(T41) <wbr> ; (time, lat,lon)<br>T4 = lonFlip(T41)<br>;printVarSummary(T4) <wbr> ; (time, lat,lon)<br>T4@_FillValue = -9.96921e+36<br>t44 = month_to_annual(T4, 0) ;; average over the 0th dim<br>printVarSummary(t44) <wbr> ; (lat,lon)<br>aveX = dim_avg_n_Wrap(t44, 0) ;; average over the 0th dim<br>printVarSummary(aveX) <wbr> ; (lat,lon)<br>varX = dim_variance_n_Wrap(t44,0) ; compute variance<br>printVarSummary(varX) <wbr> ; (lat,lon) <br>;=============================<wbr>==============================<wbr>=====================<br>;equiv_sample_size: Estimates the number of independent values of a series of correlated observations. Specify a critical significance level to test the lag-one auto-correlation coefficient <br>;=============================<wbr>==============================<wbr>======================<br> sigr = 0.05 ; critical sig lvl for r<br><br> xEqv = new(dimsizes(aveX),typeof(aveX<wbr>),aveX@_FillValue)<br>printVarSummary(xEqv) <wbr> ; (lat,lon)<br> xEqv = equiv_sample_size (t44(lat|:,lon|:,time|:), sigr,0) <br> copy_VarMeta(aveX,xEqv)<br>printVarSummary(xEqv) <wbr> ; (lat,lon)<br><br>;=============================<wbr>==============================<wbr>======<br>The output of running that is here:<br><br>Variable: T41<br>Type: float<br>Total Size: 403439616 bytes<br> 100859904 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [time | 1824] x [lat | 192] x [lon | 288]<br>Coordinates: <br> time: [ 31..55480]<br> lat: [ -90.. 90]<br> lon: [ 0..358.75]<br>Number Of Attributes: 3<br> units : K<br> long_name : Reference height temperature<br> cell_methods : time: mean<br><br>Variable: t44<br>Type: float<br>Total Size: 33619968 bytes<br> 8404992 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [year | 152] x [lat | 192] x [lon | 288]<br>Coordinates: <br> lat: [ -90.. 90]<br> lon: [-180..178.75]<br>Number Of Attributes: 6<br> _FillValue : -9.96921e+36<br> units : K<br> long_name : Reference height temperature<br> cell_methods : time: mean<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br> NCL : month_to_annual<br><br>Variable: aveX<br>Type: float<br>Total Size: 221184 bytes<br> 55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [lat | 192] x [lon | 288]<br>Coordinates: <br> lat: [ -90.. 90]<br> lon: [-180..178.75]<br>Number Of Attributes: 7<br> _FillValue : -9.96921e+36<br> units : K<br> long_name : Reference height temperature<br> cell_methods : time: mean<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br> NCL : month_to_annual<br> average_op_ncl : dim_avg_n over dimension(s): year<br><br>Variable: varX<br>Type: float<br>Total Size: 221184 bytes<br> 55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [lat | 192] x [lon | 288]<br>Coordinates: <br> lat: [ -90.. 90]<br> lon: [-180..178.75]<br>Number Of Attributes: 7<br> _FillValue : -9.96921e+36<br> units : K<br> long_name : Reference height temperature<br> cell_methods : time: mean<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br> NCL : month_to_annual<br> variance_op_ncl : dim_variance_n over dimension(s): year<br><br>Variable: xEqv<br>Type: float<br>Total Size: 221184 bytes<br> 55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [192] x [288]<br>Coordinates: <br>Number Of Attributes: 1<br> _FillValue : -9.96921e+36<br>fatal:(time) is not a dimension name in variable (t44), could not determine dimension number<br>fatal:["Execute.c":8575]:Execu<wbr>te: Error occurred at or near line 35 in file testing_T2M.ncl<br><br><br>Variable: xEqv<br>Type: float<br>Total Size: 221184 bytes<br> 55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [lat | 192] x [lon | 288]<br>Coordinates: <br> lat: [ -90.. 90]<br> lon: [-180..178.75]<br>Number Of Attributes: 7<br> average_op_ncl : dim_avg_n over dimension(s): year<br> NCL : month_to_annual<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br> cell_methods : time: mean<br> long_name : Reference height temperature<br> units : K<br> _FillValue : -9.96921e+36<br><br>;=============================<wbr>============================<br>Because, upon using month_to_annual i dont get time dimension nor attributes i cannot perform further analysis as it says i havnt defined time dimension. I have tried to use several methods by defining new varible, as well as VarMeta, VarCoords etc, but it doesnt change the outcome.<br><br>Can someone please advice on how to workaround this issue?<br>The bottom line being i need to use equiv_sample_size on my annual values and i cannot due to time dimension not being defined.<br>Much appreciated <br><br></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" 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" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>