<p>From what I see, for some reason the GSD has split the 't/td' column into two separate columns, and has multiplied the temperatures by 10. Why? Maybe to get rid of the decimal point... So when you see a value &lt; -500 it's actually &lt; -50 °C.</p>

<p><a href="https://i.sstatic.net/HWgMo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HWgMo.png" alt="Comparison between GSD and &#39;get text&#39;"></a></p>

<p>Other changes:<br>
- Pressure and altitude have been switched.<br>
- Pressure has also been multiplied by 10, so it's not in millibars any more but in decapascals...<br>
- Altitude has been converted from feet ('get text' version) to meters (GSD).</p>

<p>To summarize, here are the inferred column headings for the GSD:<br>
<strong>| 2 Pressure (daPa) | 3 Altitude (m) | 4 t (d°C = decidegree Celcius) | 5 td (d°C) |</strong></p>

<p>I don't know what to make of the "99999" temperature line that appeared in the GSD...</p>

<p>Hope you can make something out of this!</p>

CC BY-SA 4.0
2019-12-10T04:44:33.390Z
Interesting! I didn't bother trying to "decode" the GSD and match up the values. I'll dig into this a bit tomorrow, but I feel you've got it. FWIW: Yes, the multiplication by 10 is probably to remove the decimal -- it's one less character to send/store and if this data is byte-compressed then using `int`s instead of floats prevents a lot of problems: https://www.belighted.com/blog/float-is-evil
James S
CC BY-SA 4.0
2019-12-10T08:34:18.320Z
Yes, I guess it makes sense to encode the data with integers, even if it means working with uncommon unit prefixes... Let us know if you manage to further decipher the file!
Jean-Marie Prival
CC BY-SA 4.0
2019-12-16T08:19:28.577Z
@JamesS, an update on this?
Jean-Marie Prival
CC BY-SA 4.0
2019-12-21T16:43:51.557Z
Sorry. I got distracted. This works as you found. I also realized that Line 2 is the Valid From date, and Line 4 includes the Lat/Lng of the grid point. Column 6 and 7 are wind info. I put together some code to decode this: https://gist.github.com/jamesshannon/eae1bb995a906dcb1ba2ca8172a7c53e
James S
CC BY-SA 4.0
2019-12-09T17:06:38.317Z
2019-12-10T08:29:39.367Z
2019-12-10T08:29:39.367Z
Jean-Marie Prival
<p>The GSD file is just a text (ASCII) file, which you can read with almost anything you want. Since you are using python I would recommend looking at Pandas and especially the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html" rel="nofollow noreferrer">pandas.read_csv</a> functionality.</p>

<p>I am using this URL as an example now:
<a href="https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&amp;latest=latest&amp;start_year=2019&amp;start_month_name=Dec&amp;start_mday=3&amp;start_hour=7&amp;start_min=0&amp;n_hrs=1.0&amp;fcst_len=shortest&amp;airport=50%2C-90&amp;text=Ascii%20text%20%28GSD%20format%29&amp;hydrometeors=false&amp;start=latest" rel="nofollow noreferrer">https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&amp;latest=latest&amp;start_year=2019&amp;start_month_name=Dec&amp;start_mday=3&amp;start_hour=7&amp;start_min=0&amp;n_hrs=1.0&amp;fcst_len=shortest&amp;airport=50%2C-90&amp;text=Ascii%20text%20%28GSD%20format%29&amp;hydrometeors=false&amp;start=latest</a></p>

<p>From the <a href="https://rucsoundings.noaa.gov/" rel="nofollow noreferrer">ruc soundings</a> you referred to. Here I just entered lat=50 and lon=-90 to pick something. You see this in the URL in "airport=".
You can download the data you need with wget or curl and put into a file with a better name (sounding.txt) like this:</p>

<pre><code>wget "https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&amp;latest=latest&amp;start_year=2019&amp;start_month_name=Dec&amp;start_mday=3&amp;start_hour=7&amp;start_min=0&amp;n_hrs=1.0&amp;fcst_len=shortest&amp;airport=50%2C-90&amp;text=Ascii%20text%20%28GSD%20format%29&amp;hydrometeors=false&amp;start=latest" -O sounding.txt
</code></pre>

<p>Then you can write a small python program to fetch the data you need and read the data with pandas.</p>

<p>I also want to note that if you are going to use grib2 you will be able to easily change the model since grib2 is a standard format for NWP data. This will be a little more complicated, as it is a bit more tricky to read. grib2 is a binary format that is very good for storing large datasets. I refer to <a href="https://confluence.ecmwf.int/display/ECC" rel="nofollow noreferrer">eccodes</a> from ECMWF if you want to look more into this.</p>

CC BY-SA 4.0
2019-12-03T17:16:46.790Z
Thanks.  I should have been more clear. My problem isn't reading the data, but interpreting it. Firstly, the GSD definiton says that the first 4 lines of 
the sounding are identification and information lines", However, line 4 of the file you posted clearly looks to be the first line of data, so already I wonder if I'm looking at the right thing. Generally, though, I don't see how to get `(temp, altitude)` from that CSV. No `temp` heading. The definition suggests temp is in column 4, but those values range down to < -500, so that's probably not temp?
James S
CC BY-SA 4.0
2019-12-03T21:50:44.860Z
I see, I misunderstood. I have quickly looked through the javascript source code, but could not find a way to get the raw data directly. Alternatively, you can consider to get the data from an other source. Two alternatives could be: [Plymouth University](https://vortex.plymouth.edu/myo/fx/raobfx.html) which gives NWP data, and [Wyoming University](http://weather.uwyo.edu/upperair/sounding.html) which gives real observations.
Whir
CC BY-SA 4.0
2019-12-03T07:30:44.293Z
2019-12-03T07:30:44.293Z
Whir
<p>I want to know the current lapse rate for a given point in the US. In other words, I want "live" temperature data at various altitudes. Live is flexible -- I'm generally OK with a forecast which is valid for the current point in time. Where can I get this data, preferably in a format that's easy to ingest into Python?</p>

<p><strong>More details:</strong></p>

<p>I'm currently using a lapse rate constant to try to estimate the temperature at various altitudes, but would like to use something more sophisticated. I'm a pilot, so I initially thought about using the Temps &amp; Winds Aloft product, and then interpolating between the sporadic sites, but then I found the <a href="https://rucsoundings.noaa.gov/" rel="noreferrer">models on NOAA's site</a>. But:</p>

<ol>
<li><p>I'm not clear on which one is best for my use case. Op40 seems to be a good default. But the <a href="https://rapidrefresh.noaa.gov/hrrr/" rel="noreferrer">HRRR model</a> seems even better, specifically due to the higher resolution.</p></li>
<li><p>I'm not sure where raw data in a format that I can use. If, e.g., I create an interactive skew plot for Op40 on the NOAA site, I can then click the <em>Get Text</em> button and get the type of info I'm interested in:</p></li>
</ol>

<p><a href="https://i.sstatic.net/rmf3T.png" rel="noreferrer"><img src="https://i.sstatic.net/rmf3T.png" alt="enter image description here"></a></p>

<p>But if I choose the <em>ASCII Text</em> on the first page I get a <a href="https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&amp;latest=latest&amp;start_year=2019&amp;start_month_name=Nov&amp;start_mday=28&amp;start_hour=5&amp;start_min=0&amp;n_hrs=1.0&amp;airport=38.702743%2C-123.433474&amp;text=Ascii%20text%20%28GSD%20format%29&amp;hydrometeors=false&amp;start=latest" rel="noreferrer">GSD file</a> which doesn't seem to follow <a href="https://rucsoundings.noaa.gov/raob_format.html" rel="noreferrer">NOAA's own file format</a>. And it looks like HRRR comes in a <em>grib2</em> format, which also doesn't seem to be as simple as <code>lat/lon,altitude,temp</code>. It seems like these files provide something more raw which then needs to be simulated against to get the temps? I found some python libraries, but could use a pointer on the approach I need to take.</p>

<meteorology><weather-forecasting><atmosphere-modelling>
Where to get temperature sounding model forecast data?
James S
# Where to get temperature sounding model forecast data?

(Asked by: username_0 on 2019-12-03)

I want to know the current lapse rate for a given point in the US. In other words, I want "live" temperature data at various altitudes. Live is flexible -- I'm generally OK with a forecast which is valid for the current point in time. Where can I get this data, preferably in a format that's easy to ingest into Python?

**More details:**

I'm currently using a lapse rate constant to try to estimate the temperature at various altitudes, but would like to use something more sophisticated. I'm a pilot, so I initially thought about using the Temps & Winds Aloft product, and then interpolating between the sporadic sites, but then I found the [models on NOAA's site](https://rucsoundings.noaa.gov/). But:

1. I'm not clear on which one is best for my use case. Op40 seems to be a good default. But the [HRRR model](https://rapidrefresh.noaa.gov/hrrr/) seems even better, specifically due to the higher resolution.
2. I'm not sure where raw data in a format that I can use. If, e.g., I create an interactive skew plot for Op40 on the NOAA site, I can then click the *Get Text* button and get the type of info I'm interested in:

[![enter image description here](https://i.sstatic.net/rmf3T.png)](https://i.sstatic.net/rmf3T.png)

But if I choose the *ASCII Text* on the first page I get a [GSD file](https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&latest=latest&start_year=2019&start_month_name=Nov&start_mday=28&start_hour=5&start_min=0&n_hrs=1.0&airport=38.702743%2C-123.433474&text=Ascii%20text%20%28GSD%20format%29&hydrometeors=false&start=latest) which doesn't seem to follow [NOAA's own file format](https://rucsoundings.noaa.gov/raob_format.html). And it looks like HRRR comes in a *grib2* format, which also doesn't seem to be as simple as `lat/lon,altitude,temp`. It seems like these files provide something more raw which then needs to be simulated against to get the temps? I found some python libraries, but could use a pointer on the approach I need to take.

**Tags:** meteorology, weather-forecasting, atmosphere-modelling


---

## 2 answers

### Answer by username_1 on 2019-12-09. Score: 0 | Accepted answer

From what I see, for some reason the GSD has split the 't/td' column into two separate columns, and has multiplied the temperatures by 10. Why? Maybe to get rid of the decimal point... So when you see a value < -500 it's actually < -50 °C.

[![Comparison between GSD and 'get text'](https://i.sstatic.net/HWgMo.png)](https://i.sstatic.net/HWgMo.png)

Other changes:  
- Pressure and altitude have been switched.  
- Pressure has also been multiplied by 10, so it's not in millibars any more but in decapascals...  
- Altitude has been converted from feet ('get text' version) to meters (GSD).

To summarize, here are the inferred column headings for the GSD:  
**| 2 Pressure (daPa) | 3 Altitude (m) | 4 t (d°C = decidegree Celcius) | 5 td (d°C) |**

I don't know what to make of the "99999" temperature line that appeared in the GSD...

Hope you can make something out of this!

> **Comments:**
> **username_0**: Interesting! I didn't bother trying to "decode" the GSD and match up the values. I'll dig into this a bit tomorrow, but I feel you've got it. FWIW: Yes, the multiplication by 10 is probably to remove the decimal -- it's one less character to send/store and if this data is byte-compressed then using `int`s instead of floats prevents a lot of problems: https://www.belighted.com/blog/float-is-evil  
> **username_1**: Yes, I guess it makes sense to encode the data with integers, even if it means working with uncommon unit prefixes... Let us know if you manage to further decipher the file!  
> **username_1**: @username_0, an update on this?  
> **username_0**: Sorry. I got distracted. This works as you found. I also realized that Line 2 is the Valid From date, and Line 4 includes the Lat/Lng of the grid point. Column 6 and 7 are wind info. I put together some code to decode this: https://gist.github.com/jamesshannon/eae1bb995a906dcb1ba2ca8172a7c53e  

---

### Answer by username_2 on 2019-12-03. Score: 3

The GSD file is just a text (ASCII) file, which you can read with almost anything you want. Since you are using python I would recommend looking at Pandas and especially the [pandas.read\_csv](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html) functionality.

I am using this URL as an example now:
<https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&latest=latest&start_year=2019&start_month_name=Dec&start_mday=3&start_hour=7&start_min=0&n_hrs=1.0&fcst_len=shortest&airport=50%2C-90&text=Ascii%20text%20%28GSD%20format%29&hydrometeors=false&start=latest>

From the [ruc soundings](https://rucsoundings.noaa.gov/) you referred to. Here I just entered lat=50 and lon=-90 to pick something. You see this in the URL in "airport=".
You can download the data you need with wget or curl and put into a file with a better name (sounding.txt) like this:

```
wget "https://rucsoundings.noaa.gov/get_soundings.cgi?data_source=Op40&latest=latest&start_year=2019&start_month_name=Dec&start_mday=3&start_hour=7&start_min=0&n_hrs=1.0&fcst_len=shortest&airport=50%2C-90&text=Ascii%20text%20%28GSD%20format%29&hydrometeors=false&start=latest" -O sounding.txt

```

Then you can write a small python program to fetch the data you need and read the data with pandas.

I also want to note that if you are going to use grib2 you will be able to easily change the model since grib2 is a standard format for NWP data. This will be a little more complicated, as it is a bit more tricky to read. grib2 is a binary format that is very good for storing large datasets. I refer to [eccodes](https://confluence.ecmwf.int/display/ECC) from ECMWF if you want to look more into this.

> **Comments:**
> **username_0**: Thanks.  I should have been more clear. My problem isn't reading the data, but interpreting it. Firstly, the GSD definiton says that the first 4 lines of  the sounding are identification and information lines", However, line 4 of the file you posted clearly looks to be the first line of data, so already I wonder if I'm looking at the right thing. Generally, though, I don't see how to get `(temp, altitude)` from that CSV. No `temp` heading. The definition suggests temp is in column 4, but those values range down to < -500, so that's probably not temp?  
> **username_2**: I see, I misunderstood. I have quickly looked through the javascript source code, but could not find a way to get the raw data directly. Alternatively, you can consider to get the data from an other source. Two alternatives could be: [Plymouth University](https://vortex.plymouth.edu/myo/fx/raobfx.html) which gives NWP data, and [Wyoming University](http://weather.uwyo.edu/upperair/sounding.html) which gives real observations.  

---

