Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lab 13: Comparing ECCO and OSCAR Surface Velocities

In this lab, we will compare sea surface velocity data from two sources: 1) an ocean state estimate from the Estimating the Circulation and Climate of the Ocean consortium and 2) the Ocean Surface Current Analyses Real-time (OSCAR) product derived from remotely-sensed data. We will see how to compare these products both in space and in time.

This notebook has four main parts organized as follows:

  1. Downloading ECCO and OSCAR surface velocity data

  2. Interpolating ECCO onto the OSCAR grid

  3. Spatial comparison between model and data

  4. Temporal comparison between model and data

Import the modules for this notebook

Motivation

In the previous labs, we have explored several satellite-derived products. In each case, we were primarily working with observations or observation-based analyses. Oceanographers also use numerical models to reconstruct the ocean circulation, and we often want to compare the model with observations to understand where the model is consistent with observations.

ECCO State Estimate

In this lab, we will work with the Estimating the Circulation and Climate of the Ocean (ECCO) Version 4 Release 4 state estimate. ECCO state estimates are based on a global configuration of the MIT General Circulation Model (MITgcm). The model uses a large collection of satellite and in situ observations to construct a dynamically consistent reconstruction of the three-dimensional, time-evolving ocean state, but there are nonetheless differences between these observations and the modeled state.

OSCAR Ocean Currents

We will compare daily surface velocities from ECCO with daily surface currents from the Ocean Surface Current Analyses Real-time (OSCAR) product. OSCAR is an observation-based surface-current analysis that combines satellite sea-surface height, surface wind, and sea-surface-temperature information using a simplified physical model.

An Example: Ocean Circulation in the 2015 El Niño Event

In this lab, we will explore one month in the year 2015 when a strong El Niño event modulated ocean properties in the equatorial Pacific. We will examine the extent to which the surface circulation is influenced by the changes due to ENSO conditions. This type of comparison is common to test model-data consistency but it is important to note that it is not a completely independent validation since ECCO and OSCAR use some overlapping observing systems, including satellite observations of the sea surface.

Getting Started

As in the previous labs, we will keep the downloaded files in a separate data directory. We will divide the data into two subdirectories so that it is easy to tell which files came from ECCO and which came from OSCAR. Define a path to your data folder and ensure you have some folders for the individual products:

Part 1: Downloading ECCO and OSCAR surface velocity data

To download the products for this lab, begin by defining the time span of interest:

Downloading the ECCO Data

To obtain the ECCO Version 4 Release 4 state estimate, we will use the product available on the Physical Oceanography DAAC. A description of the ECCO velocity is available HERE. We can download this data using the podaac-data-subscriber tools as we saw in Lab 6.

Recall that we need to provide a collection short name:

Then, we can use the PODAAC tools to obtain the data:

After downloading the files, we can ensure that we have all of the files in the month:

Found 32 ECCO NetCDF files

Downloading the OSCAR data

Next, we will download the OSCAR data. We will use the 0.25 degree product described HERE. This data set is available using earthaccess with the tools introduced during lab 8.

Recall that we need to “log in” to Earthdata with our stored credentials:

Next, we search for granules using a search function:

Found 31 granules.

Finally, we download the files with a download function:

Loading...
Loading...
Loading...
Downloaded 31 files.

Inspecting files from each product

Examine the variables in Panoply

Before writing a loop over many daily files in our analysis, it is useful to open one file and examine its variables. Pop these open in Panoply and examine the variable names, dimensions, units, and coordinate conventions.

Plot the first ECCO surface velocity

Using the information observed in Panoply, next we’ll write a Python function to read in the surface grid of the ECCO product. The function should take in a file path and return a 2D grid of velocity.

Using the function above, let’s plot the first field to see how it looks:

<Figure size 640x480 with 2 Axes>

Plot the first OSCAR surface velocity

Similar to the steps for the ECCO data above, next we’ll write a Python function to read in the velocities from the OSCAR product. Again, the function should take in a file path and return a 2D grid of velocity.

Again, using the function above, let’s plot the first field to see how it looks:

<Figure size 640x480 with 2 Axes>

Part 2: Interpolating ECCO velocities onto the OSCAR grid

The ECCO model output is posted on a grid with a 0.5-degree spacing, while the OSCAR grid has 0.25-degree spacing. A direct subtraction such as ecco_u - oscar_u will not work unless the arrays have the same shape and represent the same geographic locations.

In this section, we will use linear interpolation to estimate the ECCO velocity at every OSCAR grid cell center. We will interpolate the eastward and northward components separately. After this step, we will obtain ecco_u_on_oscar and ecco_v_on_oscar fields with the same dimensions and coordinates as the OSCAR fields.

Read in all ECCO and OSCAR data

To facilitate this interpolation at each of the grid points in our study time period, let’s first use the functions above to read in the ECCO data and the OSCAR data into 3D arrays containing the fields for each of the files. Let’s start with the ECCO data:

ECCO array shape: (31, 360, 720)

Next, let’s read in the OSCAR data:

OSCAR array shape: (31, 719, 1440)

Interpolate ECCO Data to the OSCAR grid

Next, we’ll write a function to interpolate each 2D ECCO field onto the OSCAR grid. Then we’ll use this function in a loop to make new ECCO grids which are the same shape as the OSCAR grid with the data at co-located regions.

Write the interpolation function below (hint: reference the interpolation in Lab 9 if you need a reminder for how this works):

The interpolation function above works on one two-dimensional field. We will now apply it to each daily ECCO field so that the resulting model arrays are stored on the OSCAR grid (but they still represent ECCO velocities).

Plot the interpolation result

Now that the ECCO data is on the same grid as the OSCAR data, let’s plot the pre- and post-interpolation grids to ensure the process was carried out as expected. First, let’s compute the speeds for each product on the first time step:

Then, plot the two side-by-side

<Figure size 1000x400 with 2 Axes>

🤔 Consider these questions

  • Why do the native ECCO and interpolated ECCO fields look similar but not identical?

  • What information is added by interpolating the model rather than simply resizing the array?

  • Where might linear interpolation produce misleading values?

  • If we instead interpolated OSCAR onto the ECCO grid, would the model-data comparison be the same?

Part 3: Spatial comparison between model and data

Now the model and observation-based product have matching dates and matching grid-cell centers, we can compare the products cell by cell.

Mean Speed Comparison

One of the first metrics we can compare is the mean speed fields - this will give us a broad sense for where the model is consistent with the data. Begin by computing the mean through time:

Then, plot these means along with their difference:

<Figure size 1200x400 with 6 Axes>

Comparison as a scatter plot

Another way that we can compare speeds in the model and the observational product is through a scatter plot. Begin by making two arrays with the mean interpolated ECCO points and the OSCAR points. Be sure to remove masked values and ensure that both arrays are the same size

Then, make a scatter plot with a one-to-one line:

<Figure size 640x480 with 1 Axes>

🤔 Consider these questions

  • Is the mean speed larger in ECCO or OSCAR?

  • Does the model-data difference have a preferred sign or a preferred location?

  • What leads to these differences?

Part 4: Temporal comparison between model and data

In addition to spatial comparisons, we can also examine how the model and data values change through time. This comparison can reveal short term variability, unusual events, and periods when the model-data mismatch becomes larger.

In this example, we’ll compare the daily mean zonal and meridional velocity in the equatorial region of the Pacific. To begin, let’s define a mask defined by longitudes and latitudes around the equatorial Pacific:

Let’s make sure this mask is located on the map where we anticipate it should be located - always good to do a sanity check:

<Figure size 640x480 with 1 Axes>

When we’re happy with the mask, we can compute statistics in this mask. Let’s compute a daily time series of zonal and meridional velocities in this mask area:

Finally, let’s plot these time series for comparison:

<Figure size 800x700 with 2 Axes>

🤔 Consider these questions

  • How do the mean velocities compare through this month?

  • How does this influence your interpretation of each product?

🤔 Try it for yourself!

Try this same comparison for another time period and region of interest. How do your results compare to the analysis here?