[ncl-talk] aeronet data

Dennis Shea shea at ucar.edu
Thu Oct 2 11:28:40 MDT 2014


[1] *Please* check NCL documentation and examples.

      From the NCL home page

      Click "Examples".... "File IO" ... "Read ascii" .... There are
numerous examples.
      Note the function list. These can be used to parse text files. The
type conversion
      functions toint/tofloat/to...   can be used to convert strings to
whatever.


     Click "Functions" .... You can search via Alphabeitical listing or
(better) Category:
                                      Look at "Date". There are many
functions including

*greg2jul*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/greg2jul.shtml>,
*day_of_year*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_year.shtml>,
*days_in_month*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/days_in_month.shtml>,
*day_of_week*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/day_of_week.shtml>,
*monthday*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/monthday.shtml>,
*isleapyear*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/isleapyear.shtml>,
*cd_calendar*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml>,
*cd_inv_calendar*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml>
                                       Please look/read these so you know
what is available.

     Search for "Julian" ... Two functions: jul2greg & greg2jul. These
expect the 'classic' Julian day.
                                        The aeronet file 'Julian Day' is
actually the day of the year ... not the classic Julian day.
                                        Look at the 'day_of_year' function

                                        As noted in the previous post by
KH:  jd = day_of_year(2014,9,1)  ===> 244
                                        To get the fractional part of the
day, you would have to convert hh:mn:ss
                                         to seconds and divide by 86400.
or, ?better? 86400d0. You should create
                                         a function to do this.

[2]

  diri = "./"
  fili = "140901_140930_Sioux_Falls.lev15"

  a    = asciiread(diri+fili, -1, "string")
  line0 = a(0)      ; Level 1.5. Real Time Cloud Screened data .....
  line1 = a(1)      ; Version 2 Direct Sun Algorithm
  line3 = a(2)      ;
Location=Sioux_Falls,long=-96.626,lat=43.736,elev=500,Nmeas=16,PI=Gregory_Stensaas,Email=
stensaas at usgs.gov
  line4 = a(3)      ; AOD Level 1.5,All Points,UNITS can be found at,,,
http://aeronet.gsfc.nasa.gov/data_menu.html
  line5 = a(4)      ; Date(dd-mm-yy),Time(hh:mm:ss),Julian_Day,.....

; http://www.ncl.ucar.edu/Document/Functions/Built-in/str_fields_count.shtml

  delim = ","
  nfld  = str_fields_count(a(5), delim)   ; use one line to determine # of
fields
  print("nfld="+nfld)

  DELIM = ",:"
  NFLD  = str_fields_count(a(5), DELIM)
  print("NFLD="+NFLD)

; http://www.ncl.ucar.edu/Document/Functions/Built-in/str_get_field.shtml

  sza   = tofloat( str_get_field( a(5:), 45, delim) )
  sza at long_name = "Solar Zenith Angle"

  SZA   = tofloat( str_get_field( a(5:), 49, DELIM) )
  SZA at long_name = "Solar Zenith Angle"
  print(sza+"   "+SZA)

======
Respond only to ncl-talk; please no salutation



On Thu, Oct 2, 2014 at 10:25 AM, HAVENER, KEVIN F GS-12 USAF AFWA 14
WS/WXED <kevin.havener at us.af.mil> wrote:

> 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).
>
>
> -----Original Message-----
> From: ncl-talk-bounces at ucar.edu [mailto:ncl-talk-bounces at ucar.edu] On
> Behalf Of Partha Bhattacharjee
> Sent: Thursday, October 02, 2014 12:12 PM
> To: ncl-talk at ucar.edu
> Subject: [ncl-talk] ncl: aeronet data
>
> 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 ?
>
> Many thanks .
>
>
>
>
>
>  Partha
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141002/e485eb19/attachment.html 


More information about the ncl-talk mailing list