---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
---
(l4)=
# Level 4 (L4) Product Specification
## Overview description of the GHRSST L4 data product
L4 products are the analyzed SST products, usually derived from GHRSST L2P products. L4 data products should ideally be made available within the GHRSST R/GTS framework to the user community within 24 hours.
L4 products include gap-free analyzed SST data together with a number of ancillary fields that simplify interpretation and application of the SST data. Data providers are responsible for providing documentation on their analysis procedure. The common format of L4 products allows data users to code with the security that as new SST data products are brought on-line, very minimal code changes are required to make full use of new L4 product. Time previously spent on coding different I/O routines for each satellite data set can be spent working with the data to produce results.
The GHRSST Science Team determined that there will be 4 mandatory fields that form the core data content of a GHRSST L4 data file. In addition to global attributes and geo-location information, RDACs must produce the following within a L4 file:
- Sea Surface temperature data (SST)
- Error estimates for SST data
- Sea ice fraction
- Land/sea/ice flag
In addition there are a number of optional fields that may be used at the data provider’s discretion.
```{table} Summary description of the contents within a GHRSST L4 data product
:name: l4_content_summary
| Description | Required | Relevant section of this document |
|----------------------------------------|-----------|-----------------------------------|
| Dimensions (e.g., i x j x k) | Mandatory | Section |
| Global attributes | Mandatory | Section |
| [i x j x k] geolocation data | Mandatory | Section |
| [i x j x k] array of SST data | Mandatory | {numref}`__l4_analysed_sst` |
| [i x j x k] array of error estimates | Mandatory | {numref}`__l4_analysis_error` |
| [i x j x k] array of sea ice fraction | Mandatory | {numref}`__l4_sea_ice_fraction` |
| [i x j x k] array of land/sea/ice mask | Mandatory | {numref}`__l4_mask` |
| [i x j x k] array of optional fields | Optional | {numref}`__l4_sea_ice_fraction_error` |
```
## L4 data record format specification
L4 analysed data products are derived from an analysis procedure implemented at regular intervals (daily, six-hourly or other time periods). L4 data products include SST, error statistics, sea ice fraction, land/sea/ice mask, and other optional data for each grid-cell. A six-byte experimental block is available for data providers to test new aspects of the file or information specific to the analysis system that will eventually transition into a GHRSST standard L4 analysis field once tested.
{numref}`l4_data_fields` describes the format of GDS L4 grid cell ancillary data that should be created for each L4 grid cell. In the following sections, each variable within the L4 data file is described in detail.
```{table} L4 SST product data fields
:name: l4_data_fields
| **Name** | **Description** | **Units** |
|---|---|---|
| analysed\_sst | SST from analysis system | K, scaled, short |
| analysis\_error | Error standard deviation estimate | K, scaled, short |
| sea\_ice\_fraction | Fractional Sea Ice area concentration. | 0-1 scaled byte |
| mask | land/ice/lake mask | Flag [8bits] |
| sea_ice_fraction_error | If the error estimates on the sea ice field are available, it is recommended to provide this information as an experimental field called sea_ice_fraction_error variable. | 0-1 scaled byte |
| Experimental fields | Each grid cell has a 6 byte storage space available for RDACs and other users to include specific information. The policy for use of these fields is that they should make a useful contribution to the data sets and to GHRSST. Ideally experimental fields should transition into full fields once stable and agreed by the GHRSST Science Team. Use of these fields requires that a description of the content and specification is agreed with the GHRSST Data Assembly and Systems Technical Advisory Group and that GDS-2.1 variable attributes are included in the variable. See XXX. | 6 bytes (maximum). Defined by data providers. |
```
(__l4_analysed_sst)=
## Variable **analysed\_sst**
The variable **analysed\_sst** will be included with the format requirements shown in {numref}`l4_analysed_sst`.
The data provider is responsible for providing GHRSST with documentation on how the analysed SST is determined. Note that the RDAC should place **_FillValue** in pixels that fall on land.
```{table} CDL example description of **analysed\_sst** variable
:name: l4_analysed_sst
| **Storage type** | **Name** | **Description** | **Unit** |
|-------------------|--------------|----------------------------------|----------|
| short | analysed\_sst | SST values from analysis systems | kelvin |
```
```{code-cell}
:tags: [remove-input]
:name: l4_analysed_sst
!ncdump -h samples/20240229000000-IFR-L4_GHRSST-SSTfnd-ODYSSEA-GLOB_010-v02.1-fv01.0.nc | grep $'[ , \t]analysed_sst[(,:]'
```
(__l4_analysis_error)=
## Variable **analysis\_error**
The variable **analysis\_error** will be included with the format requirements shown in {numref}`l4_analysis_error`.
The data provider is responsible for providing GHRSST with documentation on how **analysis\_error** is determined.
```{table} CDL example description of analysis\_error variable
:name: l4_analysis_error
| **Storage type** | **Name** | **Description** | **Unit** |
|-------------------|----------------|-------------------------------------|----------|
| short | analysis\_error | Error estimate from analysis system | kelvin |
```
```{code-cell}
:tags: [remove-input]
!ncdump -h samples/20240229000000-IFR-L4_GHRSST-SSTfnd-ODYSSEA-GLOB_010-v02.1-fv01.0.nc | grep $'[ , \t]analysis_error[(,:]'
```
(__l4_sea_ice_fraction)=
## Variable **sea\_ice\_fraction**
The variable **sea\_ice\_fraction** will be included with the format requirements shown in {numref}`l4_sea_ice_fraction`.
Some SST data are contaminated in part or wholly by sea ice and the L4 variable **sea\_ice\_fraction** is used to quantify the fraction of an area contaminated with sea ice. If the error estimates on the sea ice field are available, it is recommended to provide this information as an experimental field called **sea\_ice\_fraction** variable.
```{table} CDL example description of **sea\_ice\_fraction** variable
:name: l4_sea_ice_fraction
| **Storage type** | **Name** | **Description** | **Unit** |
|-------------------|------------------|---------------------------------------|-----------|
| byte | sea\_ice\_fraction | Fractional sea ice area concentration | Fraction |
```
```{code-cell}
:tags: [remove-input]
!ncdump -h samples/20240229000000-IFR-L4_GHRSST-SSTfnd-ODYSSEA-GLOB_010-v02.1-fv01.0.nc | grep $'[ , \t]sea_ice_fraction[(,:]'
```
(__l4_mask)=
## Variable **mask**
The variable **mask** will be included with the format requirements shown in {numref}`l4_mask`.
```{table} CDL example description of **mask** variable
:name: l4_mask
| **Storage type** | **Name** | **Description** | **Unit** |
|-------------------|----------|------------------------|----------|
| byte | mask | land/sea/ice/lake mask | none |
```
```{code-cell}
:tags: [remove-input]
!ncdump -h samples/20240229000000-IFR-L4_GHRSST-SSTfnd-ODYSSEA-GLOB_010-v02.1-fv01.0.nc | grep $'[ , \t]mask[(,:]'
```
```{admonition} Comments:
Comments
This is a land/sea/ice mask with the following bit values:
- Bit 0:1 = water in grid
- Bit 1:1 = land in grid
- Bit 2:1 = optional, lake surface in grid
- Bit 3:1 = sea ice
- Bit 4:1 = optional, river surface in grid
- Bits [5-7] spare
Note that the lake and river surface bit values are optional.
The **source** attribute should list any data products used in creating this mask. List: **\\_\\_\**.
```
(__l4_sea_ice_fraction_error)=
## Optional Variable **sea_ice_fraction_error**
If the error estimates on the sea ice field are available, it is recommended to provide this information as an experimental field called **sea_ice_fraction_error** variable. The data provider is responsible for providing GHRSST with documentation on how **sea_ice_fraction_error** is determined.
```{table} CDL example description of **sea_ice_fraction_error** variable
:name: l4_sea_ice_fraction_error
| **Storage type** | **Name** | **Description** | **Unit** |
|-------------------|------------------------|---------------------------------------|-----------|
| byte | sea_ice_fraction_error | Fractional sea ice area concentration | Fraction |
```