<div dir="ltr"><div>Previously I sent some scripts and data files that I thought you could use as a basis for further work. You chose an alternative approach. I scanned the script you sent. In my opinion, it would take too much of my time to determine all the necessary changes to make it work.<br><br>----<br></div><div>So, again .....<br><br>[1]<br></div><div><br></div><div>As I noted previously, *none* of the source daily data files contain every day of the year. In fact, one year (2010) has only 9 daily values for the *entire year*. How do you expect to compute monthly means using only 9 values? Even if all 9 values were for the same month, a monthly mean based on 9 out of 28/30/31 possible numbers may *not* be appropriate.<br><br> yyyy days<br> 2005 - 266<br> 2006 - 270<br> 2007 - 300<br> 2008 - 216<br> 2009 - 178<br> 2010 - 9<br> 2011 - 89<br> 2012 - 249<br> 2023 - 124<br> 2014 - 156<br><br>[2]<br><br><div>The script 'AOT_txt2nc.ncl' reads the original yearly ascii (.txt)
files containing daily values and creates corresponding netCDF files.
Please run this script so you can see the resulting netCDF files.<br><br></div><div>%> ncl AOT_txt2nc.ncl<br><br></div><div>You should get<br><br><a href="http://AOT.2005.nc">AOT.2005.nc</a><br><a href="http://AOT.2006.nc">AOT.2006.nc</a><br><a href="http://AOT.2007.nc">AOT.2007.nc</a><br><a href="http://AOT.2008.nc">AOT.2008.nc</a><br><a href="http://AOT.2009.nc">AOT.2009.nc</a><br><a href="http://AOT.2010.nc">AOT.2010.nc</a><br><a href="http://AOT.2011.nc">AOT.2011.nc</a><br><a href="http://AOT.2012.nc">AOT.2012.nc</a><br><a href="http://AOT.2013.nc">AOT.2013.nc</a><br><a href="http://AOT.2014.nc">AOT.2014.nc</a><br></div><div><br></div><div>Please *look* at (say)<br><br></div><div>%> ncl_filedump -v time,yyyyddd,yyyymmdd <a href="http://AOT.2010.nc" target="_blank">AOT.2010.nc</a><br><br></div><div>[SNIP]<br> AOT_440 ( time ) <=== the daily values<br> AOT_500 ( time )<br> AOT_550 ( time )<br> AOT_675 ( time )<br> ALPHA ( time )<br> ANGSTROM ( time )<br></div><div>[SNIP]<br></div><div><br>Variable No. 0<br> time:<br> <br> 1831. 1838. 1858. 1859. 1888. 1889. <br> 1894. 1897. 1910. <br> <br>Variable No. 1<br> yyyyddd:<br> <br> 2010006 2010013 2010033 2010034 2010063 2010064 2010069 2010072<br> 2010085<br> <br>Variable No. 2<br> yyyymmdd:<br> <br> 20100106 20100113 20100202 20100203 20100304 20100305 20100310<br> 20100313 20100326<br><br></div><div>*Computing any monthly mean for year 2010 is not appropriate.* January
and February have 2 values each; March has 5 values. Yes, a mean could
be computed based on only 2 values BUT is that really a monthly
mean??? Just 'any old number' will not do!!! Please think about it!<br></div><br>[2]<br><br></div><div>The 'najiby_monthly.ncl' script calculates monthly values using the netCDF files created via [1]. It creates both netCDF and ascii files containing the computed monthly means. I required that at least 10 daily values be present before a mean is calculated.<br><br>%> gzip -d AOT.2005-2014.month*gz<br><br></div><div>Please carefully examine these monthly files [Look at your data]<br><br></div><div>%> less AOT.2005-2014.month.txt<br><br></div><div>%> ncl_filedump <a href="http://AOT.2005-2014.month.nc">AOT.2005-2014.month.nc</a> <br><br></div><div>or <br></div><div>%> ncdump -h <a href="http://AOT.2005-2014.month.nc">AOT.2005-2014.month.nc</a> <br></div><div><br><br></div><div>[3] Thetwo scripts [ najiby_plot_monthly_txt.ncl, najiby_plot_monthly_nc.ncl ] read the monthly files from [2] and plot a user specified variable. *Please examine the scripts carefully.* Read the documentation for any function being used. A simple sample plot is attached.<br><br><br></div><br><div><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 6:21 AM, <span dir="ltr"><<a href="mailto:najib.yusuf@carnasrda.com" target="_blank">najib.yusuf@carnasrda.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Dear all,<br>
<br>
I need assistance on how to compute monthly-mean from daily data (julian days)from ascii files. So that i can plot the means (All Jan, All Feb, .....All Dec means), obtaining 12 (mean) values and plot xy line on same plot.<br>
<br>
I tried, I got the plot of all the "Marker" points correct but I couldn't succeed to compute and draw the mean xy-line. I tried the NUG_manual but I couldn't get ascii file but .nc example and when i tried to work-around, ofcourse, it did not work. Pls see other way I tried attached. And below is the some-part of Printed output summary from the attached file with error. The more i tried the more i get different error. Pls direct me on how to achieve this. Thank you<br>
<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2006.txt<br>
warning:asciiread: End of file reached and only (271) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2007.txt<br>
warning:asciiread: End of file reached and only (301) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) N[440-675Angstrom]<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2008.txt<br>
warning:asciiread: End of file reached and only (217) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2009.txt<br>
warning:asciiread: End of file reached and only (179) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2010.txt<br>
warning:asciiread: End of file reached and only (10) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2011.txt<br>
warning:asciiread: End of file reached and only (90) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2012.txt<br>
warning:asciiread: End of file reached and only (250) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2013.txt<br>
warning:asciiread: End of file reached and only (125) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
<br>
Variable: files (subsection)<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2014.txt<br>
warning:asciiread: End of file reached and only (157) elements were read from the file, filling remaining elements with the default missing value for the requested type<br>
<br>
Variable: z1<br>
Type: string<br>
Total Size: 2928 bytes<br>
366 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [366]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
Variable: new_str<br>
Type: string<br>
Total Size: 20496 bytes<br>
2562 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [366] x [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
<br>
<br>
Variable: variables<br>
Type: string<br>
Total Size: 56 bytes<br>
7 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [7]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : missing<br>
(0) Day<br>
(1) AOT_675<br>
(2) AOT_500<br>
(3) AOT_440<br>
(4) 440-675Angstrom<br>
(5) α<br>
(6) AOT_550<br>
<br>
Variable: AOT_550_all<br>
Type: float<br>
Total Size: 14600 bytes<br>
3650 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [years | 10] x [days | 365]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : 9.96921e+36<br>
<br>
<br>
Variable: files<br>
Type: string<br>
Total Size: 80 bytes<br>
10 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [10]<br>
Coordinates:<br>
(0) /home/model-user/AOT_550_<wbr>2005.txt<br>
(1) /home/model-user/AOT_550_<wbr>2006.txt<br>
(2) /home/model-user/AOT_550_<wbr>2007.txt<br>
(3) /home/model-user/AOT_550_<wbr>2008.txt<br>
(4) /home/model-user/AOT_550_<wbr>2009.txt<br>
(5) /home/model-user/AOT_550_<wbr>2010.txt<br>
(6) /home/model-user/AOT_550_<wbr>2011.txt<br>
(7) /home/model-user/AOT_550_<wbr>2012.txt<br>
(8) /home/model-user/AOT_550_<wbr>2013.txt<br>
(9) /home/model-user/AOT_550_<wbr>2014.txt<br>
fatal:Undefined identifier: (years) is undefined, can't continue<br>
fatal:["Execute.c":8573]:Execu<wbr>te: Error occurred at or near line 66<br>
<br>
ncl 105><br>
<br>
<br>
<br>
Any assistance will really be appreciated.<br>
<br>
Thank you<br>
<br>
Najib<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>