<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 "Examples".... "File IO" ... "Read ascii" .... 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 "Functions" .... You can search via Alphabeitical listing or (better) Category: <br> Look at "Date". 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 "Julian" ... Two functions: jul2greg & greg2jul. These expect the 'classic' Julian day.<br></div><div> The aeronet file 'Julian Day' is actually the day of the year ... not the classic Julian day.<br></div><div> Look at the 'day_of_year' function<br><br></div><div> As noted in the previous post by KH: jd = day_of_year(2014,9,1) ===> 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 = "./"<br> fili = "140901_140930_Sioux_Falls.lev15"<br><br> a = asciiread(diri+fili, -1, "string")<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 = ","<br> nfld = str_fields_count(a(5), delim) ; use one line to determine # of fields<br> print("nfld="+nfld)<br><br> DELIM = ",:"<br> NFLD = str_fields_count(a(5), DELIM)<br> print("NFLD="+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 = "Solar Zenith Angle"<br><br> SZA = tofloat( str_get_field( a(5:), 49, DELIM) )<br> SZA@long_name = "Solar Zenith Angle"<br> print(sza+" "+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"><<a href="mailto:kevin.havener@us.af.mil" target="_blank">kevin.havener@us.af.mil</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe I'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 "Julian day" time units in that file (column 3) to "mmddhh" 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>