Explore NOAA ObsPack#

The NOAA ObsPack products are collections of observation data from many sites which have been collated and standardised. ObsPack data products are prepared by NOAA in consultation with data providers. Available ObsPack products can be accessed and downloaded from the ObsPack download page.

In this tutorial, we will demonstrate how the NOAA ObsPack can be loaded into the object store, explored and plotted.

0. Using the tutorial object store#

To avoid adding the example data we use in this tutorial to your normal object store, we need to tell OpenGHG to use a separate sandboxed object store that we’ll call the tutorial store. To do this we use the use_tutorial_store function from openghg.tutorial. This sets the OPENGHG_TUT_STORE environment variable for this session and won’t affect your use of OpenGHG outside of this tutorial.

from openghg.tutorial import use_tutorial_store


1. Loading the NOAA ObsPack data#

First we’ll tell OpenGHG to use the tutorial object store, located in your computer’s temporary directory.

from openghg.tutorial import use_tutorial_store

Download the data#

For convenience we have included a copy of the “obspack_ch4_1_GLOBALVIEWplus_v2.0_2020-04-24” to be retrieved from our example database. Once this has been downloaded, this can be processd using the add_noaa_obspack() function available from openghg.store subpackage. The file is ~ 128 MB in size so might take a short time to download depending on your internet connection.

from openghg.tutorial import retrieve_example_data
from openghg.store import add_noaa_obspack

url = "https://github.com/openghg/example_data/raw/main/obspack/obspack_ch4_example.tar.gz"
noaa_obspack_directory = retrieve_example_data(url=url)

Process and store the data#

res = add_noaa_obspack(noaa_obspack_directory)

Visualise the data within the object store#

The object store should now contain a larage amount of CH4, we can visualise the structure of the store like so:

from openghg.objectstore import visualise_store


2. Search, retrieve and plot#

Now we can query the object store and find all the flask data for example

from openghg.retrieve import search_surface

search_surface(species="ch4", measurement_type="flask", data_source="noaa_obspack")

Or we can do an all in one search and retrieve using get_obs_surface. Here we find CH4 data from Estevan Point, British Columbia, retrieve it and plot it.

from openghg.retrieve import get_obs_surface

data = get_obs_surface(site="HPB", species="ch4")

As there isn’t any ranking data set (see tutorial 2) get_obs_surface doesn’t know which inlet to select, we need to tell it.

data = get_obs_surface(site="HPB", species="ch4", inlet="93m")

3. Cleanup#

If you’re finished with the data in this tutorial you can cleanup the tutorial object store using the clear_tutorial_store function.

from openghg.tutorial import clear_tutorial_store