<div dir="ltr"><div><div><div><div>[1] *Please* check NCL documentation and examples.<br><br></div><div>      From the NCL home page<br></div><div><br></div><div>      Click &quot;Examples&quot;.... &quot;File IO&quot; ... &quot;Read ascii&quot; .... There are numerous examples.<br></div><div>      Note the function list. These can be used to parse text files. The type conversion<br></div><div>      functions toint/tofloat/to...   can be used to convert strings to whatever.<br></div><div><br><br></div>     Click &quot;Functions&quot; .... You can search via Alphabeitical listing or (better) Category: <br>                                      Look at &quot;Date&quot;. There are many functions including<br><p>
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/greg2jul.shtml"><strong>greg2jul</strong></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_year.shtml"><strong>day_of_year</strong></a>, <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/days_in_month.shtml"><strong>days_in_month</strong></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_week.shtml"><strong>day_of_week</strong></a>, 
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/monthday.shtml"><strong>monthday</strong></a>, <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/isleapyear.shtml"><strong>isleapyear</strong></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml"><strong>cd_calendar</strong></a>, <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml"><strong>cd_inv_calendar</strong></a>
</p>                                       Please look/read these so you know what is available.<br><br></div>     Search for &quot;Julian&quot; ... Two functions: jul2greg &amp; greg2jul. These expect the &#39;classic&#39; Julian day.<br></div><div>                                        The aeronet file &#39;Julian Day&#39; is actually the day of the year ... not the classic Julian day.<br></div><div>                                        Look at the &#39;day_of_year&#39; function<br><br></div><div>                                        As noted in the previous post by KH:  jd = day_of_year(2014,9,1)  ===&gt; 244<br></div><div>                                        To get the fractional part of the day, you would have to convert hh:mn:ss<br></div><div>                                         to seconds and divide by 86400. or, ?better? 86400d0. You should create <br></div><div>                                         a function to do this.<br></div><div><br></div><div>[2] <br>  <br>  diri = &quot;./&quot;<br>  fili = &quot;140901_140930_Sioux_Falls.lev15&quot;<br><br>  a    = asciiread(diri+fili, -1, &quot;string&quot;)<br>  line0 = a(0)      ; Level 1.5. Real Time Cloud Screened data .....<br>  line1 = a(1)      ; Version 2 Direct Sun Algorithm<br>  line3 = a(2)      ; Location=Sioux_Falls,long=-96.626,lat=43.736,elev=500,Nmeas=16,PI=Gregory_Stensaas,Email=<a href="mailto:stensaas@usgs.gov">stensaas@usgs.gov</a><br>  line4 = a(3)      ; AOD Level 1.5,All Points,UNITS can be found at,,, <a href="http://aeronet.gsfc.nasa.gov/data_menu.html">http://aeronet.gsfc.nasa.gov/data_menu.html</a><br>  line5 = a(4)      ; Date(dd-mm-yy),Time(hh:mm:ss),Julian_Day,.....<br><br>; <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/str_fields_count.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/str_fields_count.shtml</a><br><br>  delim = &quot;,&quot;<br>  nfld  = str_fields_count(a(5), delim)   ; use one line to determine # of fields<br>  print(&quot;nfld=&quot;+nfld)<br><br>  DELIM = &quot;,:&quot;<br>  NFLD  = str_fields_count(a(5), DELIM)<br>  print(&quot;NFLD=&quot;+NFLD)<br><br>; <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/str_get_field.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/str_get_field.shtml</a><br><br>  sza   = tofloat( str_get_field( a(5:), 45, delim) )<br>  sza@long_name = &quot;Solar Zenith Angle&quot;<br><br>  SZA   = tofloat( str_get_field( a(5:), 49, DELIM) )<br>  SZA@long_name = &quot;Solar Zenith Angle&quot;<br>  print(sza+&quot;   &quot;+SZA)<br><br>======<br></div><div>Respond only to ncl-talk; please no salutation<br><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 2, 2014 at 10:25 AM, HAVENER, KEVIN F GS-12 USAF AFWA 14 WS/WXED <span dir="ltr">&lt;<a href="mailto:kevin.havener@us.af.mil" target="_blank">kevin.havener@us.af.mil</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe I&#39;m missing something but column one is dd-mm-yy and column two is hh:mm:ss.  Generally though Julian Day is day of the year.  In your attached file it is day 244 (Sep 1, which matches with column 1).<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a>] On Behalf Of Partha Bhattacharjee<br>
Sent: Thursday, October 02, 2014 12:12 PM<br>
To: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
Subject: [ncl-talk] ncl: aeronet data<br>
<br>
I was trying to read aeronet ascii data (attached) using NCL.  Any idea on how to convert &quot;Julian day&quot; time units in that file (column 3) to &quot;mmddhh&quot; format ? Also, is there any ncl code available to read aeronet files ?<br>
<br>
Many thanks .<br>
<br>
<br>
<br>
<br>
<br>
 Partha<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>