<div dir="ltr"><div>Ehsan, the Wikipedia page that you indicated for SYNOP mentions several open source decoders.  You might consider trying one of these, instead of writing your own decoder.  Metaf2xml looks promising and is based on Perl.  It has some command line utilities that might be relevant.<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 26, 2022 at 8:03 AM Ehsan Taghizadeh via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"bookman old style","new york",times,serif;font-size:16px"><div><div dir="ltr">Dear Dennis,</div><div dir="ltr">Thank you so much for your kind contribution, as always.</div><div dir="ltr"><br></div><div dir="ltr">Dear Cathy,</div><div dir="ltr">I'll try to do the preprocessor with Perl, as you suggested. Thank you so much for your helpful reply.</div><div dir="ltr"><br></div><div><div dir="ltr" style="font-family:"old times",serif;font-size:16px"><div><div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">-----------------------------------------------------------------------------</font></i></div><div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Sincerely,</font></i></div><div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Ehsan Taghizadeh</font></i></div><div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><br></div></div></div></div></div><div><br></div>
        
        </div><div id="gmail-m_52432057665960063yahoo_quoted_1560520999">
            <div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
                
                <div>
                    On Tuesday, April 26, 2022, 06:06:09 PM GMT+4:30, Cathy Smith <<a href="mailto:cathy.smith@noaa.gov" target="_blank">cathy.smith@noaa.gov</a>> wrote:
                </div>
                <div><br></div>
                <div>Hi<br></div><div><div id="gmail-m_52432057665960063yiv0256048078"><div>
    <p>I don't have such a script. But, I have read similar data in odd
      formats. What was helpful in the absence of NCL code (which IS
      tedious for weird text) is to preprocess the data in a scripting
      language, sed/awk, Perl etc. Perl I am most familar with and it is
      very flexible when reading values, spaces, etc. It was made for
      text processing! :) But other langauges also can do this. <br clear="none">
    </p>
    <p>You then write it out in a way that NCL can read more easily.</p>
    <p>Cathy Smith</p>
    <p><br clear="none">
    </p>
    <div>On 4/25/22 7:29 PM, Dennis Shea via
      ncl-talk wrote:<br clear="none">
    </div>
    <blockquote type="cite">
      </blockquote></div><div><div dir="ltr">
        <div>Not sure what to say.</div>
        <div><br clear="none">
        </div>
        <div>[1] To my knowledge, no one has written a function to
          decode a SYNOP message. <br clear="none">
        </div>
        <div><br clear="none">
        </div>
        <div>[2] asciiread and  parsing sequences (checking for spaces, 
          / and =  etc) is tedious programming. <br clear="none">
        </div>
        <div><br clear="none">
        </div>
        <div>Maybe someone in the NCL world has their own script thay
          could share.</div>
        <div><br clear="none">
        </div>
        <div>Sorry</div>
        <div>D<br clear="none">
        </div>
        <div><br clear="none">
        </div>
      </div>
      <br clear="none">
      <div>
        <div dir="ltr">On Mon, Apr 25, 2022 at 1:57
          PM Ehsan Taghizadeh via ncl-talk <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>>
          wrote:<br clear="none">
        </div>
        <blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
          <div>
            <div style="font-family:"bookman old style","new york",times,serif;font-size:16px">
              <div>
                <div dir="ltr">Hi</div>
                <div dir="ltr">I'd sent the following reply to <a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk-bounces@mailman.ucar.edu" target="_blank">ncl-talk-bounces@mailman.ucar.edu</a>,
                  by mistake.</div>
                <div><br clear="none">
                </div>
                <div>
                  <div dir="ltr" style="font-family:"old times",serif;font-size:16px">
                    <div>
                      <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">-----------------------------------------------------------------------------</font></i></div>
                      <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Sincerely,</font></i></div>
                      <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Ehsan
                            Taghizadeh</font></i></div>
                      <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><br clear="none">
                      </div>
                    </div>
                    </div></div></div><div><br></div>
            </div>
            <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyahoo_quoted_1282105720">
              <div style="font-family:Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
                <div>----- Forwarded Message -----</div>
                <div><b>From:</b> Ehsan Taghizadeh <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></div>
                <div><b>To:</b> Ncl-talk <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk-bounces@mailman.ucar.edu" target="_blank">ncl-talk-bounces@mailman.ucar.edu</a>></div>
                <div><b>Sent:</b> Friday, April 22, 2022, 01:42:21 AM
                  GMT+4:30</div>
                <div><b>Subject:</b> Re: [ncl-talk] Skew-T</div>
                <div><br clear="none">
                </div>
                <div>
                  <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024">
                    <div>
                      <div style="font-family:"bookman old style","new york",times,serif;font-size:16px">
                        <div>
                          <div dir="ltr">Dear Dennis,</div>
                          <div dir="ltr">Thank you so much for your nice
                            reply.</div>
                          <div dir="ltr">The software related to the
                            brand of radiosonde, save sounded data in
                            TEMP format. I found below link showing an
                            example of TEMP data for
                            OIII/40754/Tehran-Mehrabad (Iran) station.</div>
                          <div dir="ltr"><a rel="nofollow noopener noreferrer" shape="rect" href="https://www.ogimet.com/display_sond.php?lang=en&lugar=40754&tipo=ALL&ord=DIR&nil=SI&fmt=html&ano=2022&mes=04&day=19&hora=20&anof=2022&mesf=04&dayf=20&horaf=20&send=send" target="_blank">Display sond</a><br clear="none">
                          </div>
                          <div><br clear="none">
                          </div>
                          <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024ydp6ab9635benhancr_card_0883333011" style="max-width:400px;font-family:YahooSans,"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif"><a rel="nofollow noopener noreferrer" shape="rect" href="https://www.ogimet.com/display_sond.php?lang=en&lugar=40754&tipo=ALL&ord=DIR&nil=SI&fmt=html&ano=2022&mes=04&day=19&hora=20&anof=2022&mesf=04&dayf=20&horaf=20&send=send" style="text-decoration:none;color:rgb(0,0,0)" target="_blank">
                              <table style="max-width:400px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400">
                                      <table style="max-width:400px;border:1px solid rgb(224,228,233);border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1">
                                              <table style="background-image:none;background-color:rgb(255,255,255);width:100%;max-width:400px;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(224,228,233);background-position:0% 0%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:rgb(255,255,255);padding:16px 0px 16px 12px;vertical-align:top;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:2px"><br clear="none">
                                                    </td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:YahooSans,"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:2px;border-bottom-left-radius:0px">
                                                      <h2 style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:YahooSans,"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif;color:rgb(29,34,40);max-width:314px">Display
                                                        sond</h2>
                                                    </td></tr></tbody></table>
                                            </td></tr></tbody></table>
                                    </td></tr></tbody></table>
                            </a></div>
                          <div><br></div>
                          <div dir="ltr">If I remember correctly, TTAA
                            and TTCC are related to mandatory levels
                            data (1000, 925, 850, 700, 500, 400, 300,
                            250, 200, 150, 100 mb), and TTBB and TTDD
                            are related to significant levels data (70,
                            50, 30, 20, 10 mb). Sounded data
                            (temperature, wind and humidity) for each
                            level are coded in these files. I'm not much
                            familiar with these codes, however, each
                            TTXX (TTAA, ..., TTDD) has different
                            sections. For example one section starts
                            with 99, another one starts with 88, ...,
                            44. Also 31313, 41414, 51515 are related to
                            different sections.</div>
                          <div dir="ltr">However, TEMP format is a
                            standard format, like synop ( <a rel="nofollow noopener noreferrer" shape="rect" href="https://en.wikipedia.org/wiki/SYNOP#:~:text=SYNOP%20(surface%20synoptic%20observations)%20is,and%20low%20frequency%20using%20RTTY." target="_blank">SYNOP - Wikipedia</a>), </div>
                          <div><br clear="none">
                          </div>
                          <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024ydp9c0fc27denhancr_card_1550056531" style="max-width:400px;font-family:YahooSans,"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif"><a rel="nofollow noopener noreferrer" shape="rect" href="https://en.wikipedia.org/wiki/SYNOP#:~:text=SYNOP%20(surface%20synoptic%20observations)%20is,and%20low%20frequency%20using%20RTTY." style="text-decoration:none;color:rgb(0,0,0)" target="_blank">
                              <table style="max-width:400px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400">
                                      <table style="max-width:400px;border:1px solid rgb(224,228,233);border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1">
                                              <table style="background-image:none;background-color:rgb(255,255,255);width:100%;max-width:400px;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(224,228,233);background-position:0% 0%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:rgb(255,255,255);padding:16px 0px 16px 12px;vertical-align:top;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:2px"><br clear="none">
                                                    </td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:YahooSans,"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:2px;border-bottom-left-radius:0px">
                                                      <h2 style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:YahooSans,"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif;color:rgb(29,34,40);max-width:314px">SYNOP
                                                        - Wikipedia</h2>
                                                      <p style="font-size:12px;line-height:16px;margin:0px;color:rgb(151,158,168)">SYNOP
                                                        information is
                                                        collected by
                                                        more than 7600
                                                        manned and
                                                        unmanned
                                                        meteorological
                                                        stations and
                                                        more than 2500
                                                        ...</p>
                                                    </td></tr></tbody></table>
                                            </td></tr></tbody></table>
                                    </td></tr></tbody></table>
                            </a></div>
                          <div dir="ltr">to report observed data in GTS
                            (Global Telecommunication System).</div>
                          <div dir="ltr">Pardon me for any ambiguity in
                            my sentences.</div>
                          <div>
                            <div dir="ltr" style="font-family:"old times",serif;font-size:16px">
                              <div>
                                <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">-----------------------------------------------------------------------------</font></i></div>
                                <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Sincerely,</font></i></div>
                                <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Ehsan Taghizadeh</font></i></div>
                                <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><br clear="none">
                                </div>
                              </div>
                              </div></div></div><div><br></div>
                      </div>
                      <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024yqt60067">
                        <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024yahoo_quoted_0756316891">
                          <div style="font-family:Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
                            <div> On Thursday, April 21, 2022, 11:48:32
                              PM GMT+4:30, Dennis Shea <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>>
                              wrote: </div>
                            <div><br></div>
                            <div>
                              <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024">
                                <div>
                                  <div dir="ltr">
                                    <div>re: "decode TEMP data"</div>
                                    <div><br clear="none">
                                    </div>
                                    <div>This is VERY ambiguous.</div>
                                    <div><br clear="none">
                                    </div>
                                    <div>Well what format is it?  Text? 
                                      Some meteorological code?  <br clear="none">
                                    </div>
                                  </div>
                                  <br clear="none">
                                  <div>
                                    <div id="gmail-m_52432057665960063yiv0256048078gmail-m_9104859029848226091ydp4965f48dyiv6427185024yqt37572">
                                      <div dir="ltr">On Thu, Apr 21,
                                        2022 at 12:50 PM Ehsan
                                        Taghizadeh via ncl-talk <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>>
                                        wrote:<br clear="none">
                                      </div>
                                      <blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
                                        <div>
                                          <div style="font-family:"bookman old style","new york",times,serif;font-size:16px">
                                            <div>
                                              <div dir="ltr">Hope you
                                                are doing well.</div>
                                              <div dir="ltr">I would
                                                like to decode TEMP data
                                                (sounding data), then
                                                plot skew-t. I found <a rel="nofollow noopener noreferrer" shape="rect" href="https://www.ncl.ucar.edu/Applications/Scripts/skewt_2.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/skewt_2.ncl</a>,
                                                but what about decoding
                                                TEMP data. It could be a
                                                PyNGL or python script.</div>
                                              <div dir="ltr">I'll be
                                                thankful for any help.</div>
                                              <div>
                                                <div dir="ltr" style="font-family:"old times",serif;font-size:16px">
                                                  <div>
                                                    <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">-----------------------------------------------------------------------------</font></i></div>
                                                    <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Sincerely,</font></i></div>
                                                    <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Ehsan Taghizadeh</font></i></div>
                                                    <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Ph.D. of Meteorology</font></i></div>
                                                    <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">Institute of Geophysics,
                                                          University of
                                                          Tehran, Iran</font></i></div>
                                                    <div dir="ltr" style="color:rgb(0,0,0);font-family:"old times",serif;font-size:16px"><i><font size="2">I.R. of Iran
                                                          Meteorological
                                                          Organization
                                                          (IRIMO)</font></i></div></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></div></blockquote></div></div>