<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Atul,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your 14 MB file was too large for ncl-talk, but it still came to me because I'm one of the administrators.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The averaging would still work close to the same way, but I'm not exactly clear on what kind of average you want.</div><div class="gmail_default" style="font-size:small"><br class="gmail-Apple-interchange-newline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">You have 40 years of data, so averaging for every 5 years is going to give you 8 x 251 x 263:</span></div><div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"> temp_5year_avg = dim_avg_n(reshape(temp,(/ntim5,5,nlat,nlon/)),1) ; 8 x 251 x 263</div><div><div class="gmail_default" style="font-size:small">
<div class="gmail_default" style="font-size:small"><br></div></div></div><div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I'm not exactly sure what you mean by a composite plot. </span>I think a "raster fill" plot is similar to what you want, but again, I don't know how you want to "composite" across the 8 sets of lat/lon data, so this is something you will need to figure out.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I suggest looking through some of our examples at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/">http://www.ncl.ucar.edu/Applications/</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">In particular, here are some samples of raster plots:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/raster.shtml">http://www.ncl.ucar.edu/Applications/raster.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">There are many other places where raster plots are used:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/classification.shtml">http://www.ncl.ucar.edu/Applications/classification.shtml</a><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/gfed.shtml">http://www.ncl.ucar.edu/Applications/gfed.shtml</a><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/HiResPrc.shtml">http://www.ncl.ucar.edu/Applications/HiResPrc.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">For even more examples, go to our tips page:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/concepts_list.shtml">http://www.ncl.ucar.edu/Applications/concepts_list.shtml</a><br></div><div class="gmail_default"><br></div>and use your browser search to look fo<span class="gmail_default" style="font-size:small">r "D</span>rawing raster contours"<span class="gmail_default" style="font-size:small">.</span></div><div dir="ltr"><span class="gmail_default" style="font-size:small"><br></span></div><div><div class="gmail_default" style="font-size:small">To help you get started, I've created a script that creates a "panel" plot of each of your 8 averaged lat/lon grids. In order to get better outlines of the map, since you have a small regional area, I used a shapefile of India downloaded from:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="https://gadm.org/download_country_v3.html">https://gadm.org/download_country_v3.html</a><br></div><div class="gmail_default"><br></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Please look at this code and try understand it before posting another question. For documentation on dim_avg_n, or any of the NCL functions, go to:</span></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="http://www.ncl.ucar.edu/Document/Functions/list_alpha.shtml">http://www.ncl.ucar.edu/Document/Functions/list_alpha.shtml</a><br></span></div><div class="gmail_default"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Here's the direct link to dim_avg_n and reshape:</span></div><div class="gmail_default"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_avg_n.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_avg_n.shtml</a><br></span></div><div class="gmail_default"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml</a><br></span></div><div class="gmail_default"><br></div><div class="gmail_default">If you do have a follow-up question, post it back to ncl-talk and not to me individually.<br></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Good luck,</span></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">--Mary</span></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><br></div></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 12, 2018 at 9:32 AM, Atul Saini <span dir="ltr"><<a href="mailto:atulsainimail@gmail.com" target="_blank">atulsainimail@gmail.com</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">Thanks for guidance ma'am. Actually ma'am my query was related to the composite map and not xy plot. I am sorry to say ma'am that mistakenly attached the wrong file (i.e. file containing fieldmean) with the earlier mail. Now, I am attaching the correct one (i.e. each grid point has some value) with this mail. Ma'am, the procedure to be followed to draw the filled in contour map/choropleth map (i.e. composite map of 5 years). Will the process will remain same as suggested by you or does it require some changes?<br clear="all"><div><div><div dir="ltr" class="m_4034670939823446072gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>Regards,</div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1-FxdNiTGH6ODiAbx9rORqe-MEqsUbdbp&revid=0Byj9ykpbAx3oTmhuRDNKVk9yUm9Pbmh1RDhtc3p0VzlVWHlNPQ" width="248" height="94"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 12, 2018 at 9:08 PM Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.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 dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Atul Saini,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you are new to NCL, I suggest looking at the NCL User Guide which has an excellent step-by-step guide for NCL, with a focus on creating graphics:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Manuals/NCL_User_<wbr>Guide/</a><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">One way to do this is to first reshape the temperature array to an NTIM x 5 x NLAT x NLON array, where NTIM is the total number of years divided by five. Once you do this, you can use dim_avg_n to average across the rightmost three dimensions of the new array, effectively giving you the average for every 5 years:</div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"> filename = "<a href="http://chamba_tmean_fldmean.nc" target="_blank">chamba_tmean_fldmean.nc</a>"</font></div><div class="gmail_default"><font face="monospace, monospace"> a = addfile(filename,"r")</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"> temp = a->t</font></div><div class="gmail_default"><font face="monospace, monospace"> dims = dimsizes(temp)</font></div><div class="gmail_default"><font face="monospace, monospace"> ntim = dims(0)</font></div><div class="gmail_default"><font face="monospace, monospace"> nlat = dims(1)</font></div><div class="gmail_default"><font face="monospace, monospace"> nlon = dims(1)</font></div><div class="gmail_default"><font face="monospace, monospace"> ntim5 = ntim/5</font></div><div class="gmail_default"><font face="monospace, monospace">; </font></div><div class="gmail_default"><font face="monospace, monospace">; Reshape temperature array so we can easily average groupings of </font></div><div class="gmail_default"><font face="monospace, monospace">; five years at a time. </font></div><div class="gmail_default"><font face="monospace, monospace">; </font></div><div class="gmail_default"><font face="monospace, monospace"> temp_5year_avg = dim_avg_n(reshape(temp,(/<wbr>ntim5,5,nlat,nlon/)),(/1,2,3/)<wbr>)</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">The temp_5year_avg array will be a one-dimensional array of ntim5 (8) elements that you can easily plot. See attached script and image.</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">Note that your "t" variable on the file has no units, and it appears to have a funny character as part of the long_name. You probably should try to fix these when creating the plot.</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">--Mary</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 10, 2018 at 2:10 AM, Atul Saini <span dir="ltr"><<a href="mailto:atulsainimail@gmail.com" target="_blank">atulsainimail@gmail.com</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>Sir/Ma'am,</div><div> I have the mean temperature
file containing the data for MAMJJA season. This file contains the
seasonal average (MAMJJA) data of each year from 1975 to 2014. I can
easily plot the XY plot using it but the problem is how to make the
average of 1975 to 1979, 1980 to 1985 and so on. I want to make the
pentad map as explained in the previous sentence.</div><div><br></div><div> Please help in making the average of five years to plot the map, which will represent the composite of five years.<br></div><div><br></div><div>The data file is attached herewith this mail.</div><div><br></div><div><div dir="ltr" class="m_4034670939823446072m_1841139520591539553m_-8969425237301311780gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>Regards,</div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1-FxdNiTGH6ODiAbx9rORqe-MEqsUbdbp&revid=0Byj9ykpbAx3oTmhuRDNKVk9yUm9Pbmh1RDhtc3p0VzlVWHlNPQ" width="248" height="94"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div>