<div dir="ltr">Sorry, To my knowledge, the short answer is &quot;no&quot;.   Sorry.  D</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 15, 2016 at 2:28 PM, Sourav Chatterjee <span dir="ltr">&lt;<a href="mailto:srvsxc@outlook.com" target="_blank">srvsxc@outlook.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div>
<div style="font-family:Calibri,sans-serif;font-size:11pt">Thanks alot Dennis<br>
<br>
<br>
Is there any way to average this variable only with latitude? I have done after regriding using ESMF_regrid function, but is it possible without regriding this temperature variable?<br>
<br>
I want to plot a depth vs longitude contour plot averaged over time and latitude.<br>
<br>
Regards<br>
Sourav</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">From:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:shea@ucar.edu" target="_blank">Dennis Shea</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Sent:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt">‎13-‎09-‎2016 17:11</span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">To:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:srvsxc@outlook.com" target="_blank">Sourav Chatterjee</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Cc:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>;
<a href="mailto:guidocioni@gmail.com" target="_blank">Guido Cioni</a></span><div><div class="h5"><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Subject:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt">Re: [ncl-talk] Assign lat lon cordinates to polar stereographic coordinate</span><br>
<br>
</div></div></div><div><div class="h5">
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>See:<br>
<br>
<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/<wbr>Contributed/getind_latlon2d.<wbr>shtml</a><br>
</div>
         and/or<br>
<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/<wbr>Contributed/region_ind.shtml</a><br>
<br>
</div>
Then<br>
<br>
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave2.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>wgt_areaave2.shtml</a><br>
<br>
</div>
Ideally, the weights (areas represented by each grid point) would be available in &#39;some file.&#39; Or, perhaps you could construct them<br>
<br>
</div>
or, perhaps, just use <br>
<br>
</div>
   wgt2d = cos(rsd*lat2d)   ; rad converts degrees to radians<br>
<br>
</div>
Good luck<br>
<div>
<div><br>
<br>
<div>
<div><br>
<br>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Sep 13, 2016 at 2:19 AM, Guido Cioni <span dir="ltr">
&lt;<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Also make sure to perform the short to float conversion before working with your data!!!
<div><br>
</div>
<div><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Contributed/<wbr>short2flt.shtml</a><span><font color="#888888"><br>
<div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br>
Guido Cioni</div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<a href="http://guidocioni.altervista" target="_blank">http://guidocioni.altervista</a>.o<wbr>rg</div>
</div>
</font></span>
<div>
<div><br>
<div>
<blockquote type="cite">
<div>On 13 Sep 2016, at 10:15, Guido Cioni &lt;<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>&gt; wrote:</div>
<br>
<div>
<div style="word-wrap:break-word">
<div>Assuming from your filedump you do have coordinate variables associated, so the following should easily work.</div>
<div><br>
</div>
<div><font face="Menlo">temp_avg=dim_avg_n_Wrap(temp(:<wbr>,:,{40:50},{-30:-10}),(/2,3/))</font></div>
<div><br>
</div>
<div>Otherwise you would have to convert the latitude/longitude variables from 2D to 1D, use the ind function to find all the indices that map into your box, convert again into 2D indices with ind_resolve, subset temp with these indices, do the average. </div>
<div>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br>
Guido Cioni</div>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<a href="http://guidocioni.altervista/" target="_blank">http://guidocioni.altervista</a>.o<wbr>rg</div>
</div>
<br>
<div>
<blockquote type="cite">
<div>On 13 Sep 2016, at 09:10, Sourav Chatterjee &lt;<a href="mailto:srvsxc@outlook.com" target="_blank">srvsxc@outlook.com</a>&gt; wrote:</div>
<br>
<div>
<div>
<div>
<div style="font-family:Calibri,sans-serif;font-size:11pt">Thanks alot Mary for the explanation.<br>
<br>
Actually I need to do some area averaging for which I have the lat lon information e.g say, surface temperature averaged over 40-50N and -30:-10E. How to perform this spatial averaging with this temperature(time,depth,y,x) variable?<br>
<br>
Thanks<br>
Sourav<br>
</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">From:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:haley@ucar.edu" target="_blank">Mary Haley</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Sent:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt">‎12-‎09-‎2016 23:38</span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">To:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:srvsxc@outlook.com" target="_blank">Sourav Chatterjee</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Cc:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Subject:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt">Re: [ncl-talk] Assign lat lon cordinates to polar stereographic coordinate</span><br>
<br>
</div>
<div>
<div dir="ltr">
<div class="gmail_default"><font face="arial, helvetica, sans-serif">Sourav,</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif">I&#39;m not sure what you mean by &quot;converting my variable&quot;.</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif">Since your latitude and longitude arrays are two-dimensional, you cannot associate them with &quot;temperature&quot; in the same way that &quot;y&quot; and &quot;x&quot; are currently associated with &quot;temperature&quot; as coordinate
 variables. This is a NetCDF limitation that requires that coordinate variables be one-dimensional and the same length as the dimension they represent.</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif">You already have a &quot;coordinates&quot; *attribute* associated with &quot;temperature&quot;, that indicates which variables represent the lat/lon arrays for your data:</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"><span>        temperature:coordinates = &quot;longitude latitude&quot; ;</span><br>
</font></div>
<div class="gmail_default"><span><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail_default"><span><font face="arial, helvetica, sans-serif">This is how we would normally suggest that you &quot;associate&quot; 2D lat/lon arrays with a variable on a NetCDF file, so really, your &quot;temperature&quot; variable looks pretty good as it is.</font></span></div>
<div class="gmail_default"><span><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail_default"><span><font face="arial, helvetica, sans-serif">--Mary</font></span></div>
<div class="gmail_default"><span><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Sep 9, 2016 at 4:19 AM, Sourav Chatterjee <span dir="ltr">
&lt;<a href="mailto:srvsxc@outlook.com" target="_blank">srvsxc@outlook.com</a>&gt;</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 style="font-size:12pt;background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi all</p>
<p><br>
</p>
<p>I want convert my variable (temperature) to temperature (time,depth,lat,lon) from temperature(time,depth,x,y)
<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>here is how it looks like now.</p>
<p><br>
</p>
<p>Any help!</p>
<p><br>
</p>
<p>Thanks<br>
</p>
<p><br>
</p>
<div><span></span><br>
</div>
<div>dimensions:<br>
    depth = 12 ;<br>
    time = UNLIMITED ; // (288 currently)<br>
    x = 428 ;<br>
    y = 403 ;<br>
variables:<br>
    int stereographic ;<br>
        stereographic:grid_mapping_na<wbr>me = &quot;polar_stereographic&quot; ;<br>
        stereographic:latitude_of_pro<wbr>jection_origin = 90. ;<br>
        stereographic:longitude_of_pr<wbr>ojection_origin = -45. ;<br>
        stereographic:scale_factor_at<wbr>_projection_origin = 1. ;<br>
        stereographic:straight_vertic<wbr>al_longitude_from_pole = -45. ;<br>
        stereographic:false_easting = 0. ;<br>
        stereographic:false_northing = 0. ;<br>
    float x(x) ;<br>
        x:axis = &quot;X&quot; ;<br>
        x:standard_name = &quot;projection_x_coordinate&quot; ;<br>
        x:units = &quot;100  km&quot; ;<br>
    float y(y) ;<br>
        y:standard_name = &quot;projection_y_coordinate&quot; ;<br>
        y:axis = &quot;Y&quot; ;<br>
        y:units = &quot;100  km&quot; ;<br>
    float depth(depth) ;<br>
        depth:long_name = &quot;depth&quot; ;<br>
        depth:units = &quot;m&quot; ;<br>
        depth:standard_name = &quot;depth&quot; ;<br>
        depth:positive = &quot;down&quot; ;<br>
        depth:axis = &quot;Z&quot; ;<br>
    double time(time) ;<br>
        time:units = &quot;hour since 1950-1-1T00:00:00Z&quot; ;<br>
        time:long_name = &quot;forecast time&quot; ;<br>
    float longitude(y, x) ;<br>
        longitude:standard_name = &quot;longitude&quot; ;<br>
        longitude:units = &quot;degrees_east&quot; ;<br>
    float latitude(y, x) ;<br>
        latitude:standard_name = &quot;latitude&quot; ;<br>
        latitude:units = &quot;degrees_north&quot; ;<br>
    short temperature(time, depth, y, x) ;<br>
        temperature:_FillValue = -32767s ;<br>
        temperature:missing_value = -32767s ;<br>
        temperature:add_offset = 23.5 ;<br>
        temperature:scale_factor = 0.000808839239385893 ;<br>
        temperature:units = &quot;Celsius&quot; ;<br>
        temperature:standard_name = &quot;sea_water_potential_temperatu<wbr>re&quot; ;<br>
        temperature:grid_mapping = &quot;stereographic&quot; ;<br>
        temperature:coordinates = &quot;longitude latitude&quot; ;<br>
        temperature:cell_methods = &quot;area: mean&quot; ;<br>
<br>
// global attributes:<br>
        :title = &quot;Arctic Ocean Physics Reanalysis (1991-2014), 12.5km monthly mean (dataset-ran-arc-myoceanv2-be)<wbr>&quot; ;<br>
        :institution = &quot;NERSC, Thormoehlens gate 47, N-5006 Bergen, Norway&quot; ;<br>
        :history = &quot;20160112:Created by program hyc2proj, version V0.3&quot; ;<br>
        :source = &quot;NERSC-HYCOM model fields&quot; ;<br>
        :references = &quot;<a href="http://topaz.nersc.no/" target="_blank">http://topaz.nersc.no</a>&quot; ;<br>
        :field_type = &quot;Files based on file type nersc_weekly&quot; ;<br>
        :Conventions = &quot;CF-1.4&quot; ;<br>
        :field_date = &quot;2014-11-15&quot; ;<br>
        :bulletin_date = &quot;2014-11-15&quot; ;<br>
}<br>
</div>
<br>
<div><br>
</div>
</div>
</div>
<br>
______________________________<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>
</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" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
<br>
______________________________<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>
</div>
</div></div></div>

</blockquote></div><br></div>