# EKE preprocessing

This notebook shows how to generate the EKE_timeseries.nc file

```python
# Import libraries
import xarray as xr
import cmocean as cm
import cartopy.crs as ccrs

import pylab as plt
import numpy as np
# Inline plotting
%matplotlib inline
```

```python
from dask.distributed import Client
```

```python
from utils import area,ccrs_land,add_patches
import datetime
```

```python
c = Client()
c
```

Client

Scheduler: tcp://127.0.0.1:33109

Dashboard: /proxy/8787/status

Cluster

Workers: 6

Cores: 36

Memory: 154.62 GB

```python
files = '/g/data/ua8/CMEMS_SeaLevel/v2019/*/*.nc'
# files='path2AVISO+/*.nc'
```

```python
dataset_AVISO = xr.open_mfdataset(files,parallel=True)
```

```python
dataset_AVISO
```

<svg style="position: absolute; width: 0; height: 0; overflow: hidden">
<defs>
<symbol id="icon-database" viewBox="0 0 32 32">
<path d="M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z"></path>
<path d="M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path>
<path d="M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path>
</symbol>
<symbol id="icon-file-text2" viewBox="0 0 32 32">
<path d="M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z"></path>
<path d="M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
<path d="M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
<path d="M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
</symbol>
</defs>
</svg>

<xarray.Dataset>
Dimensions:    (latitude: 720, longitude: 1440, nv: 2, time: 9928)
Coordinates:
  * time       (time) datetime64[ns] 1993-01-01 1993-01-02 ... 2020-03-07
  * latitude   (latitude) float32 -89.88 -89.62 -89.38 ... 89.38 89.62 89.88
  * longitude  (longitude) float32 0.125 0.375 0.625 0.875 ... 359.4 359.6 359.9
  * nv         (nv) int32 0 1
Data variables:
    crs        (time) int32 -2147483647 -2147483647 ... -2147483647 -2147483647
    lat_bnds   (time, latitude, nv) float32 dask.array<chunksize=(1, 720, 2), meta=np.ndarray>
    lon_bnds   (time, longitude, nv) float32 dask.array<chunksize=(1, 1440, 2), meta=np.ndarray>
    err        (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    adt        (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    ugos       (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    vgos       (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    sla        (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    ugosa      (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    vgosa      (time, latitude, longitude) float64 dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
Attributes:
    Conventions:                     CF-1.6
    Metadata_Conventions:            Unidata Dataset Discovery v1.0
    cdm_data_type:                   Grid
    comment:                         Sea Surface Height measured by Altimetry...
    contact:                         servicedesk.cmems@mercator-ocean.eu
    creator_email:                   servicedesk.cmems@mercator-ocean.eu
    creator_name:                    CMEMS - Sea Level Thematic Assembly Center
    creator_url:                     http://marine.copernicus.eu
    date_created:                    2019-01-17T16:58:50Z
    date_issued:                     2019-01-17T16:58:50Z
    date_modified:                   2019-01-17T16:58:50Z
    geospatial_lat_max:              89.875
    geospatial_lat_min:              -89.875
    geospatial_lat_resolution:       0.25
    geospatial_lat_units:            degrees_north
    geospatial_lon_max:              359.875
    geospatial_lon_min:              0.125
    geospatial_lon_resolution:       0.25
    geospatial_lon_units:            degrees_east
    geospatial_vertical_max:         0.0
    geospatial_vertical_min:         0.0
    geospatial_vertical_positive:    down
    geospatial_vertical_resolution:  point
    geospatial_vertical_units:       m
    history:                         2019-01-17 16:58:51Z: Creation
    institution:                     CLS, CNES
    keywords:                        Oceans > Ocean Topography > Sea Surface ...
    keywords_vocabulary:             NetCDF COARDS Climate and Forecast Stand...
    license:                         http://marine.copernicus.eu/web/27-servi...
    platform:                        ERS-1, Topex/Poseidon,
    processing_level:                L4
    product_version:                 2019
    project:                         COPERNICUS MARINE ENVIRONMENT MONITORING...
    references:                      http://marine.copernicus.eu
    software_version:                6.2_DUACS_DT2018_baseline
    source:                          Altimetry measurements
    ssalto_duacs_comment:            The reference mission used for the altim...
    standard_name_vocabulary:        NetCDF Climate and Forecast (CF) Metadat...
    summary:                         SSALTO/DUACS Delayed-Time Level-4 sea su...
    time_coverage_duration:          P1D
    time_coverage_end:               1993-01-01T00:00:00Z
    time_coverage_resolution:        P1D
    time_coverage_start:             1993-01-01T00:00:00Z
    title:                           DT merged all satellites Global Ocean Gr...

xarray.Dataset

<input id='section-ab8a01dd-17dd-4849-8603-6bf38a4296fd' class='xr-section-summary-in' type='checkbox' disabled >Dimensions:

latitude: 720

longitude: 1440

nv: 2

time: 9928

<input id='section-f3ccc550-b1cd-4228-a761-5937245727f7' class='xr-section-summary-in' type='checkbox'  checked>Coordinates: (4)

time

(time)

datetime64[ns]

1993-01-01 ... 2020-03-07
<input id='attrs-fbe163d9-8ec1-4167-a75d-05c0830fb0f9' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-118feed7-739f-461c-a961-9e4c72ab651d' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

axis :

T

long_name :

Time

standard_name :

time

array(['1993-01-01T00:00:00.000000000', '1993-01-02T00:00:00.000000000',
       '1993-01-03T00:00:00.000000000', ..., '2020-03-05T00:00:00.000000000',
       '2020-03-06T00:00:00.000000000', '2020-03-07T00:00:00.000000000'],
      dtype='datetime64[ns]')

latitude

(latitude)

float32

-89.88 -89.62 ... 89.62 89.88
<input id='attrs-9ad269cd-8d48-41fd-8c15-cb63480085e2' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-c2e3c773-0125-4ca7-8632-501758a55e51' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

axis :

Y

bounds :

lat_bnds

long_name :

Latitude

standard_name :

latitude

units :

degrees_north

valid_max :

89.875

valid_min :

-89.875

array([-89.875, -89.625, -89.375, ...,  89.375,  89.625,  89.875],
      dtype=float32)

longitude

(longitude)

float32

0.125 0.375 0.625 ... 359.6 359.9
<input id='attrs-794c88ca-87f6-4aaf-a030-3f396ac652fa' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-15facb94-17ef-4bfd-a8ff-2dfe9cd89126' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

axis :

X

bounds :

lon_bnds

long_name :

Longitude

standard_name :

longitude

units :

degrees_east

valid_max :

359.875

valid_min :

0.125

array([1.25000e-01, 3.75000e-01, 6.25000e-01, ..., 3.59375e+02, 3.59625e+02,
       3.59875e+02], dtype=float32)

nv

(nv)

int32

0 1
<input id='attrs-3a15403f-7f00-4c2f-ae09-a03e08446552' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-1b2d3355-cae1-4cb4-beb8-3a65afcca461' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

Vertex

units :

1

array([0, 1], dtype=int32)

<input id='section-e6b875b9-ed38-489f-bd73-14f85725568d' class='xr-section-summary-in' type='checkbox'  checked>Data variables: (10)

crs

(time)

int32

-2147483647 ... -2147483647
<input id='attrs-349eb9c8-b3e9-4603-9e90-4798358e4ef1' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-ccc3e6e2-3edc-41f3-a963-7a3bfeebe014' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

This is a container variable that describes the grid_mapping used by the data in this file. This variable does not contain any data; only information about the geographic coordinate system.

grid_mapping_name :

latitude_longitude

inverse_flattening :

298.257

semi_major_axis :

6378136.3

array([-2147483647, -2147483647, -2147483647, ..., -2147483647,
       -2147483647, -2147483647], dtype=int32)

lat_bnds

(time, latitude, nv)

float32

dask.array<chunksize=(1, 720, 2), meta=np.ndarray>
<input id='attrs-9cfa57ec-e3fc-4519-8209-00696a13110d' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-77368d0e-6912-4872-9cf6-cba739214359' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

latitude values at the north and south bounds of each pixel.

units :

degrees_north

 	 Array 	 Chunk

 Bytes 	 57.19 MB 	  5.76 kB

 Shape 	 (9928, 720, 2) 	  (1, 720, 2)

 Count 	 39712 Tasks 	 9928 Chunks

 Type 	 float32 	 numpy.ndarray

<svg width="156" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="35" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="39" y2="3" />
  <line x1="17" y1="7" x2="42" y2="7" />
  <line x1="21" y1="11" x2="46" y2="11" />
  <line x1="24" y1="14" x2="50" y2="14" />
  <line x1="28" y1="18" x2="53" y2="18" />
  <line x1="32" y1="22" x2="57" y2="22" />
  <line x1="36" y1="26" x2="61" y2="26" />
  <line x1="39" y1="29" x2="65" y2="29" />
  <line x1="43" y1="33" x2="68" y2="33" />
  <line x1="47" y1="37" x2="72" y2="37" />
  <line x1="50" y1="40" x2="76" y2="40" />
  <line x1="54" y1="44" x2="79" y2="44" />
  <line x1="58" y1="48" x2="83" y2="48" />
  <line x1="62" y1="52" x2="87" y2="52" />
  <line x1="65" y1="55" x2="91" y2="55" />
  <line x1="69" y1="59" x2="94" y2="59" />
  <line x1="73" y1="63" x2="98" y2="63" />
  <line x1="76" y1="66" x2="102" y2="66" />
  <line x1="80" y1="70" x2="106" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="35" y1="0" x2="106" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="106" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="106" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="106" y1="70" x2="106" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="93.294544" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >2</text>
  <text x="126.000852" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,126.000852,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

lon_bnds

(time, longitude, nv)

float32

dask.array<chunksize=(1, 1440, 2), meta=np.ndarray>
<input id='attrs-a31661e6-52d5-4347-aa3d-94274c35c5c5' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-5fd55f16-d455-4d37-a225-062bb2eb58eb' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

longitude values at the west and east bounds of each pixel.

units :

degrees_east

 	 Array 	 Chunk

 Bytes 	 114.37 MB 	  11.52 kB

 Shape 	 (9928, 1440, 2) 	  (1, 1440, 2)

 Count 	 39712 Tasks 	 9928 Chunks

 Type 	 float32 	 numpy.ndarray

<svg width="156" height="161" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="40" x2="80" y2="111" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="40" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="44" />
  <line x1="17" y1="7" x2="17" y2="47" />
  <line x1="21" y1="11" x2="21" y2="51" />
  <line x1="24" y1="14" x2="24" y2="55" />
  <line x1="28" y1="18" x2="28" y2="59" />
  <line x1="32" y1="22" x2="32" y2="62" />
  <line x1="36" y1="26" x2="36" y2="66" />
  <line x1="39" y1="29" x2="39" y2="70" />
  <line x1="43" y1="33" x2="43" y2="73" />
  <line x1="47" y1="37" x2="47" y2="77" />
  <line x1="50" y1="40" x2="50" y2="81" />
  <line x1="54" y1="44" x2="54" y2="85" />
  <line x1="58" y1="48" x2="58" y2="88" />
  <line x1="62" y1="52" x2="62" y2="92" />
  <line x1="65" y1="55" x2="65" y2="96" />
  <line x1="69" y1="59" x2="69" y2="99" />
  <line x1="73" y1="63" x2="73" y2="103" />
  <line x1="76" y1="66" x2="76" y2="107" />
  <line x1="80" y1="70" x2="80" y2="111" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,111.13127961619224 10.0,40.54304432207459" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="35" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="39" y2="3" />
  <line x1="17" y1="7" x2="42" y2="7" />
  <line x1="21" y1="11" x2="46" y2="11" />
  <line x1="24" y1="14" x2="50" y2="14" />
  <line x1="28" y1="18" x2="53" y2="18" />
  <line x1="32" y1="22" x2="57" y2="22" />
  <line x1="36" y1="26" x2="61" y2="26" />
  <line x1="39" y1="29" x2="65" y2="29" />
  <line x1="43" y1="33" x2="68" y2="33" />
  <line x1="47" y1="37" x2="72" y2="37" />
  <line x1="50" y1="40" x2="76" y2="40" />
  <line x1="54" y1="44" x2="79" y2="44" />
  <line x1="58" y1="48" x2="83" y2="48" />
  <line x1="62" y1="52" x2="87" y2="52" />
  <line x1="65" y1="55" x2="91" y2="55" />
  <line x1="69" y1="59" x2="94" y2="59" />
  <line x1="73" y1="63" x2="98" y2="63" />
  <line x1="76" y1="66" x2="102" y2="66" />
  <line x1="80" y1="70" x2="106" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="35" y1="0" x2="106" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="106" y2="70" style="stroke-width:2" />
  <line x1="80" y1="111" x2="106" y2="111" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="111" style="stroke-width:2" />
  <line x1="106" y1="70" x2="106" y2="111" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,111.13127961619224 80.58823529411765,111.13127961619224" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="93.294544" y="131.131280" font-size="1.0rem" font-weight="100" text-anchor="middle" >2</text>
  <text x="126.000852" y="90.859757" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,126.000852,90.859757)">1440</text>
  <text x="35.294118" y="95.837162" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,95.837162)">9928</text>
</svg>

err

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-576b596b-cdb7-4072-a1c7-2e991ecb8f61' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-916f196b-5108-434f-bdfe-6d921bce4888' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

The formal mapping error represents a purely theoretical mapping error. It mainly traduces errors induced by the constellation sampling capability and consistency with the spatial/temporal scales considered, as described in Le Traon et al (1998) or Ducet et al (2000)

grid_mapping :

crs

long_name :

Formal mapping error

units :

m

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

adt

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-3b57c346-c70b-480f-b26e-b7f0ce2f1702' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-c7b45054-8913-4c51-b421-b3ea2b8d92ed' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

The absolute dynamic topography is the sea surface height above geoid; the adt is obtained as follows: adt=sla+mdt where mdt is the mean dynamic topography; see the product user manual for details

grid_mapping :

crs

long_name :

Absolute dynamic topography

standard_name :

sea_surface_height_above_geoid

units :

m

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

ugos

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-d14036f1-36b7-48a6-98c1-05c6396d2e1a' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-8f12246b-2341-415d-a72c-935e7c5b4b33' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

grid_mapping :

crs

long_name :

Absolute geostrophic velocity: zonal component

standard_name :

surface_geostrophic_eastward_sea_water_velocity

units :

m/s

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

vgos

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-342faed8-218d-44a3-b091-b8319c73c5b6' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-d37c386b-9354-4b6a-a271-9904843d3104' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

grid_mapping :

crs

long_name :

Absolute geostrophic velocity: meridian component

standard_name :

surface_geostrophic_northward_sea_water_velocity

units :

m/s

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

sla

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-8f44b60f-524c-46a5-bc69-8f8bfaa00058' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-b4610574-a9fc-4680-b1f9-ec33c817d86b' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

The sea level anomaly is the sea surface height above mean sea surface; it is referenced to the [1993, 2012] period; see the product user manual for details

grid_mapping :

crs

long_name :

Sea level anomaly

standard_name :

sea_surface_height_above_sea_level

units :

m

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

ugosa

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-c60f9847-a48e-4093-9230-ef332463aa6a' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-a24dff32-9a0a-4dd8-86da-7c608dd747fa' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

The geostrophic velocity anomalies are referenced to the [1993, 2012] period

grid_mapping :

crs

long_name :

Geostrophic velocity anomalies: zonal component

standard_name :

surface_geostrophic_eastward_sea_water_velocity_assuming_sea_level_for_geoid

units :

m/s

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

vgosa

(time, latitude, longitude)

float64

dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
<input id='attrs-f63b0adb-8bcc-4728-9a4d-aecf656d6617' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-85ba162a-6611-4a86-b277-28c1174849f5' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

comment :

The geostrophic velocity anomalies are referenced to the [1993, 2012] period

grid_mapping :

crs

long_name :

Geostrophic velocity anomalies: meridian component

standard_name :

surface_geostrophic_northward_sea_water_velocity_assuming_sea_level_for_geoid

units :

m/s

 	 Array 	 Chunk

 Bytes 	 82.35 GB 	  8.29 MB

 Shape 	 (9928, 720, 1440) 	  (1, 720, 1440)

 Count 	 29784 Tasks 	 9928 Chunks

 Type 	 float64 	 numpy.ndarray

<svg width="171" height="157" style="stroke:rgb(0,0,0);stroke-width:1" >

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="10" y1="36" x2="80" y2="107" style="stroke-width:2" />

  <line x1="10" y1="0" x2="10" y2="36" style="stroke-width:2" />
  <line x1="13" y1="3" x2="13" y2="40" />
  <line x1="17" y1="7" x2="17" y2="44" />
  <line x1="21" y1="11" x2="21" y2="47" />
  <line x1="24" y1="14" x2="24" y2="51" />
  <line x1="28" y1="18" x2="28" y2="55" />
  <line x1="32" y1="22" x2="32" y2="59" />
  <line x1="36" y1="26" x2="36" y2="62" />
  <line x1="39" y1="29" x2="39" y2="66" />
  <line x1="43" y1="33" x2="43" y2="70" />
  <line x1="47" y1="37" x2="47" y2="73" />
  <line x1="50" y1="40" x2="50" y2="77" />
  <line x1="54" y1="44" x2="54" y2="81" />
  <line x1="58" y1="48" x2="58" y2="85" />
  <line x1="62" y1="52" x2="62" y2="88" />
  <line x1="65" y1="55" x2="65" y2="92" />
  <line x1="69" y1="59" x2="69" y2="96" />
  <line x1="73" y1="63" x2="73" y2="99" />
  <line x1="76" y1="66" x2="76" y2="103" />
  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />

  <polygon points="10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,107.33790767131957 10.0,36.74967237720192" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="10" y1="0" x2="50" y2="0" style="stroke-width:2" />
  <line x1="13" y1="3" x2="54" y2="3" />
  <line x1="17" y1="7" x2="57" y2="7" />
  <line x1="21" y1="11" x2="61" y2="11" />
  <line x1="24" y1="14" x2="65" y2="14" />
  <line x1="28" y1="18" x2="69" y2="18" />
  <line x1="32" y1="22" x2="72" y2="22" />
  <line x1="36" y1="26" x2="76" y2="26" />
  <line x1="39" y1="29" x2="80" y2="29" />
  <line x1="43" y1="33" x2="83" y2="33" />
  <line x1="47" y1="37" x2="87" y2="37" />
  <line x1="50" y1="40" x2="91" y2="40" />
  <line x1="54" y1="44" x2="95" y2="44" />
  <line x1="58" y1="48" x2="98" y2="48" />
  <line x1="62" y1="52" x2="102" y2="52" />
  <line x1="65" y1="55" x2="106" y2="55" />
  <line x1="69" y1="59" x2="109" y2="59" />
  <line x1="73" y1="63" x2="113" y2="63" />
  <line x1="76" y1="66" x2="117" y2="66" />
  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />

  <line x1="10" y1="0" x2="80" y2="70" style="stroke-width:2" />
  <line x1="50" y1="0" x2="121" y2="70" style="stroke-width:2" />

  <polygon points="10.0,0.0 50.54304432207459,0.0 121.13127961619224,70.58823529411765 80.58823529411765,70.58823529411765" style="fill:#8B4903A0;stroke-width:0"/>

  <line x1="80" y1="70" x2="121" y2="70" style="stroke-width:2" />
  <line x1="80" y1="107" x2="121" y2="107" style="stroke-width:2" />

  <line x1="80" y1="70" x2="80" y2="107" style="stroke-width:2" />
  <line x1="121" y1="70" x2="121" y2="107" style="stroke-width:2" />

  <polygon points="80.58823529411765,70.58823529411765 121.13127961619224,70.58823529411765 121.13127961619224,107.33790767131957 80.58823529411765,107.33790767131957" style="fill:#ECB172A0;stroke-width:0"/>

  <text x="100.859757" y="127.337908" font-size="1.0rem" font-weight="100" text-anchor="middle" >1440</text>
  <text x="141.131280" y="88.963071" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(-90,141.131280,88.963071)">720</text>
  <text x="35.294118" y="92.043790" font-size="1.0rem" font-weight="100" text-anchor="middle" transform="rotate(45,35.294118,92.043790)">9928</text>
</svg>

<input id='section-cf5df5c2-9fbe-4728-974c-8ec081928291' class='xr-section-summary-in' type='checkbox'  >Attributes: (44)

Conventions :

CF-1.6

Metadata_Conventions :

Unidata Dataset Discovery v1.0

cdm_data_type :

Grid

comment :

Sea Surface Height measured by Altimetry and derived variables

contact :

servicedesk.cmems@mercator-ocean.eu

creator_email :

servicedesk.cmems@mercator-ocean.eu

creator_name :

CMEMS - Sea Level Thematic Assembly Center

creator_url :

http://marine.copernicus.eu

date_created :

2019-01-17T16:58:50Z

date_issued :

2019-01-17T16:58:50Z

date_modified :

2019-01-17T16:58:50Z

geospatial_lat_max :

89.875

geospatial_lat_min :

-89.875

geospatial_lat_resolution :

0.25

geospatial_lat_units :

degrees_north

geospatial_lon_max :

359.875

geospatial_lon_min :

0.125

geospatial_lon_resolution :

0.25

geospatial_lon_units :

degrees_east

geospatial_vertical_max :

0.0

geospatial_vertical_min :

0.0

geospatial_vertical_positive :

down

geospatial_vertical_resolution :

point

geospatial_vertical_units :

m

history :

2019-01-17 16:58:51Z: Creation

institution :

CLS, CNES

keywords :

Oceans > Ocean Topography > Sea Surface Height

keywords_vocabulary :

NetCDF COARDS Climate and Forecast Standard Names

license :

http://marine.copernicus.eu/web/27-service-commitments-and-licence.php

platform :

ERS-1, Topex/Poseidon,

processing_level :

L4

product_version :

2019

project :

COPERNICUS MARINE ENVIRONMENT MONITORING SERVICE (CMEMS)

references :

http://marine.copernicus.eu

software_version :

6.2_DUACS_DT2018_baseline

source :

Altimetry measurements

ssalto_duacs_comment :

The reference mission used for the altimeter inter-calibration processing is Topex/Poseidon between 1993-01-01 and 2002-04-23, Jason-1 between 2002-04-24 and 2008-10-18, OSTM/Jason-2 between 2008-10-19 and 2016-06-25, Jason-3 since 2016-06-25.

standard_name_vocabulary :

NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table v37

summary :

SSALTO/DUACS Delayed-Time Level-4 sea surface height and derived variables measured by multi-satellite altimetry observations over Global Ocean.

time_coverage_duration :

P1D

time_coverage_end :

1993-01-01T00:00:00Z

time_coverage_resolution :

P1D

time_coverage_start :

1993-01-01T00:00:00Z

title :

DT merged all satellites Global Ocean Gridded SSALTO/DUACS Sea Surface Height L4 product and derived variables

### Compute EKE:

\begin{equation}
EKE = \frac{1}{2} \left(u'^2+v'^2\right)
\end{equation}

The provided $u'$ and $v'$ from AVISO is an anomaly from 1993-2012. Changing this period does not affect the main result of the study.

```python
EKE = 1/2 * (dataset_AVISO.ugosa**2 + dataset_AVISO.vgosa**2)
```

Rechunk dataset

```python
EKE_rechunk = EKE.chunk({"latitude": 100, "longitude": 100,'time':357})
```

Coarsen dataset to a 1 degree grid.

```python
EKE_coarsen = EKE_rechunk.coarsen({'latitude':4,'longitude':4}).mean()
```

Roll over 12 months:

```python
EKE_rolled = EKE_coarsen.rolling(time=365,center=True).mean().compute()
# This computation requires ~ 50 GB of RAM, to decrease the usage of RAM,
# reduce the size of the chunks.
```

```python
EKE_rolled = EKE_rolled.to_dataset(name="EKE").rename({'latitude':'lat','longitude':'lon'})
```

```python
EKE_rolled
```

<svg style="position: absolute; width: 0; height: 0; overflow: hidden">
<defs>
<symbol id="icon-database" viewBox="0 0 32 32">
<path d="M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z"></path>
<path d="M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path>
<path d="M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path>
</symbol>
<symbol id="icon-file-text2" viewBox="0 0 32 32">
<path d="M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z"></path>
<path d="M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
<path d="M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
<path d="M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
</symbol>
</defs>
</svg>

<xarray.Dataset>
Dimensions:  (lat: 180, lon: 360, time: 9928)
Coordinates:
  * time     (time) datetime64[ns] 1993-01-01 1993-01-02 ... 2020-03-07
  * lat      (lat) float32 -89.5 -88.5 -87.5 -86.5 -85.5 ... 86.5 87.5 88.5 89.5
  * lon      (lon) float32 0.5 1.5 2.5 3.5 4.5 ... 355.5 356.5 357.5 358.5 359.5
Data variables:
    EKE      (time, lat, lon) float64 nan nan nan nan nan ... nan nan nan nan

xarray.Dataset

<input id='section-5b488a8b-6677-4dc1-8337-2ed7b1866bf9' class='xr-section-summary-in' type='checkbox' disabled >Dimensions:

lat: 180

lon: 360

time: 9928

<input id='section-e7e60457-0833-4b78-b8b8-6fb260bf26ec' class='xr-section-summary-in' type='checkbox'  checked>Coordinates: (3)

time

(time)

datetime64[ns]

1993-01-01 ... 2020-03-07
<input id='attrs-3dac1a08-2301-4dfc-b3c3-172536c2b7e8' class='xr-var-attrs-in' type='checkbox' ><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-5763a90a-36dc-4aff-80c7-c47ee718621d' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

axis :

T

long_name :

Time

standard_name :

time

array(['1993-01-01T00:00:00.000000000', '1993-01-02T00:00:00.000000000',
       '1993-01-03T00:00:00.000000000', ..., '2020-03-05T00:00:00.000000000',
       '2020-03-06T00:00:00.000000000', '2020-03-07T00:00:00.000000000'],
      dtype='datetime64[ns]')

lat

(lat)

float32

-89.5 -88.5 -87.5 ... 88.5 89.5
<input id='attrs-31a1a7d8-782d-4c93-9e8e-bb9eb21cc2c9' class='xr-var-attrs-in' type='checkbox' disabled><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-83019038-8420-4063-b5d3-4464e080519d' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

array([-89.5, -88.5, -87.5, -86.5, -85.5, -84.5, -83.5, -82.5, -81.5, -80.5,
       -79.5, -78.5, -77.5, -76.5, -75.5, -74.5, -73.5, -72.5, -71.5, -70.5,
       -69.5, -68.5, -67.5, -66.5, -65.5, -64.5, -63.5, -62.5, -61.5, -60.5,
       -59.5, -58.5, -57.5, -56.5, -55.5, -54.5, -53.5, -52.5, -51.5, -50.5,
       -49.5, -48.5, -47.5, -46.5, -45.5, -44.5, -43.5, -42.5, -41.5, -40.5,
       -39.5, -38.5, -37.5, -36.5, -35.5, -34.5, -33.5, -32.5, -31.5, -30.5,
       -29.5, -28.5, -27.5, -26.5, -25.5, -24.5, -23.5, -22.5, -21.5, -20.5,
       -19.5, -18.5, -17.5, -16.5, -15.5, -14.5, -13.5, -12.5, -11.5, -10.5,
        -9.5,  -8.5,  -7.5,  -6.5,  -5.5,  -4.5,  -3.5,  -2.5,  -1.5,  -0.5,
         0.5,   1.5,   2.5,   3.5,   4.5,   5.5,   6.5,   7.5,   8.5,   9.5,
        10.5,  11.5,  12.5,  13.5,  14.5,  15.5,  16.5,  17.5,  18.5,  19.5,
        20.5,  21.5,  22.5,  23.5,  24.5,  25.5,  26.5,  27.5,  28.5,  29.5,
        30.5,  31.5,  32.5,  33.5,  34.5,  35.5,  36.5,  37.5,  38.5,  39.5,
        40.5,  41.5,  42.5,  43.5,  44.5,  45.5,  46.5,  47.5,  48.5,  49.5,
        50.5,  51.5,  52.5,  53.5,  54.5,  55.5,  56.5,  57.5,  58.5,  59.5,
        60.5,  61.5,  62.5,  63.5,  64.5,  65.5,  66.5,  67.5,  68.5,  69.5,
        70.5,  71.5,  72.5,  73.5,  74.5,  75.5,  76.5,  77.5,  78.5,  79.5,
        80.5,  81.5,  82.5,  83.5,  84.5,  85.5,  86.5,  87.5,  88.5,  89.5],
      dtype=float32)

lon

(lon)

float32

0.5 1.5 2.5 ... 357.5 358.5 359.5
<input id='attrs-abbc13e2-3c23-4349-aef4-46da14e1d8ff' class='xr-var-attrs-in' type='checkbox' disabled><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-0f6c57bf-eeb1-43cd-bb70-086842c8d03f' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

array([  0.5,   1.5,   2.5, ..., 357.5, 358.5, 359.5], dtype=float32)

<input id='section-a43b3029-187e-4394-aa1d-0a6586cac2de' class='xr-section-summary-in' type='checkbox'  checked>Data variables: (1)

EKE

(time, lat, lon)

float64

nan nan nan nan ... nan nan nan nan
<input id='attrs-ad6cf549-bede-4254-91c6-9227bfaed20f' class='xr-var-attrs-in' type='checkbox' disabled><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg><input id='data-97e8a6ad-16b8-46de-8544-f7952b690bc6' class='xr-var-data-in' type='checkbox'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg>

array([[[nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        ...,
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan]],

       [[nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        ...,
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan]],

       [[nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        ...,
...
        ...,
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan]],

       [[nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        ...,
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan]],

       [[nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        ...,
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan],
        [nan, nan, nan, ..., nan, nan, nan]]])

<input id='section-e621dbfe-8bcc-49ac-bcb1-e8bbd011b0e5' class='xr-section-summary-in' type='checkbox' disabled >Attributes: (0)

### Add metadata

```python
EKE_rolled.attrs['title'] = "Eddy Kinetic Energy"
EKE_rolled.attrs['Description'] = """Eddy Kinetic Energy computed from AVISO+ altimetry products."""
EKE_rolled.attrs['Publication'] = "Dataset created for Martínez-Moreno, J. et. al. 2020: \n 'Global changes in oceanic mesoscale currents over the satellite altimetry record'"
EKE_rolled.attrs['Author'] = "Josué Martínez-Moreno"
EKE_rolled.attrs['Contact'] = "josue.martinezmoreno@anu.edu.au"

EKE_rolled.attrs['Created date'] = datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")

counter = 0
units = [r"$m^2s^{-2}$"]
names = ["EKE"]
long_names = ["Eddy Kinetic Energy"]

EKE_rolled['EKE'].attrs['units'] = units[counter]
EKE_rolled['EKE'].attrs['name'] = names[counter]
EKE_rolled['EKE'].attrs['long_name'] = long_names[counter]

EKE_rolled['EKE'].attrs['missing_value'] = np.nan
EKE_rolled['EKE'].attrs['valid_min'] = np.nanmin(EKE_rolled['EKE'])
EKE_rolled['EKE'].attrs['valid_max'] = np.nanmax(EKE_rolled['EKE'])
EKE_rolled['EKE'].attrs['valid_range'] = [np.nanmin(EKE_rolled['EKE']),np.nanmax(EKE_rolled['EKE'])]
```

## Store netCDF

```python
comp = dict(zlib=True, complevel=5)
encoding = {var: comp for var in EKE_rolled.data_vars}

EKE_rolled.to_netcdf('../datasets/EKE_timeseries.nc', encoding=encoding)
```


# Introducción al Aprendizaje por Refuerzos

### Curso Aprendizaje por Refuerzos, Diplomatura en Ciencia de Datos, Aprendizaje Automático y sus Aplicaciones

### FaMAF, 2019

#### Agenda

* Presentación Docentes
* Introducción. Diferencias entre Aprendizaje Supervisado, No Supervisado y Por Refuerzos
* Modelo Agente Entorno. Agente Situado. Arquitectura Actor-Crítico.
* Aprendizaje por Refuerzos. Elementos. Ciclo del Aprendizaje por Refuerzos. Definición Formal.
* Procesos de Decisión de Markov. Función de Valor. Ecuación de Bellman. Optimalidad.
* Diferencias Temporales
* SARSA y Q-Learning

## Docentes

* Jorge A. Palombarini
* Juan Cruz Barsce
* Ezequiel Beccaría

## Página y Libro Sutton

http://incompleteideas.net/

https://drive.google.com/file/d/1opPSz5AZ_kVa1uWOdOiveNiBFiEOHjkG/view

## Introducción: Diferencias entre Aprendizaje Supervisado, No Supervisado y Por Refuerzos

## Entidad Inteligente -> Agente Situado

* La idea de aprender por interacción con nuestro entorno es quizás la primera en aparecer cuando pensamos acerca de la naturaleza del aprendizaje.

* Por ejemplo, cuando un niño juega, mueve sus brazos, o mira alrededor, no tiene un "maestro" explicito, pero posee una conexion sensorial y motora con su entorno.

* El ejercicio de dicha conexión produce información acerca de la relación causa-efecto y las consecuencias de las acciones que lleva a cabo, y respecto de qué hacer de manera tal de lograr objetivos. Así, *aprender por interacción* es una idea fundacional de muchas teorías del aprendizaje y la inteligencia.

*  En este curso, se explorará un **enfoque computacional dirigido por objetivos para *aprender por interacción***: el **Aprendizaje por Refuerzos (Reinforcement Learning)**.

## Agent-Environment Framework

* El desarrollo de la inteligencia requiere que la entidad o el agente esté situada/o en un entorno **(Measuring universal intelligence: Towards an anytime intelligence test, Hernandez-Orallo & Dowe, Artificial Intelligence, 2010).**

* El agente y su entorno interactúan a través de la ejecución de acciones, observación de estados y señales de reward. La inteligencia tendrá efecto sólo si el agente tiene claramente definidos objetivos o metas que persigue activamente mientras ocurre la interacción.

## Aprendizaje por Refuerzos (Reinforcement Learning)

* **Reinforcement learning** consiste en aprender **qué hacer** -mapear situaciones a acciones- de manera tal de **maximizar** una señal numérica de recompensa.

* Al aprendiz (**agente**) no se le especifica cuáles acciones ejecutar, sino que debe descubrir a través de ***prueba y error*** cuáles acciones producen la mayor cantidad de recompensa acumulada. En los casos más interesantes, las acciones pueden afectar no solo la recompensa inmediata, sino solamente el estado, recibiéndose una recompensa sólo en algunos estados o bien al final del episodio (***Delayed-reward***).

* Se conoce simultaneamente como RL al problema de **aprender por interacción**, a las **métodos de solución** de dicho problema, y al **área de la IA que estudia el problema y los métodos de solución**.

* El problema de RL puede ser formalizado empleando **Procesos de Decisión de Markov**.

* La toma de decisiones secuencial involucra aprender sobre nuestro entorno y elegir acciones que maximizan el retorno esperado. El RL computacional, inspirado por estas ideas, las formalizo y produjo un impacto importante en robótica, machine learning y neurociencias.

> El Aprendizaje por Refuerzos (RL) consiste en un agente que se encuentra en algún estado $s \in S$ inmerso en un entorno $E$ y ejecuta acciones $a \in A$ en busca de una meta. El agente puede ser modelado formalmente como una función f, que toma un  historial de interacción como entrada, y devuelve una acción a tomar. Una manera conveniente para representar el agente es una medida de probabilidad sobre el set A de acciones, en base a un historial de interacción: $$ f(a_{n}|s_{1}a_{1} r_{2} s_{2}a_{2}...r_{n}s_{n}) $$ que representa la probabilidad de la acción a en el ciclo n dado un historial de interacción.

* Problema RL: ***¿Cómo el agente produce la distribución de probabilidad sobre las acciones?***

* ***Dilema de exploración - explotación***: debido a que el Agente no recibe ejemplos de entrenamiento, debe probar alternativas, procesar los resultados de sus acciones y modificar su comportamiento en algún sentido. ¿Cuándo explotar este conocimiento vs. cuándo probar nuevas estrategias?

## Arquitectura Actor-Crítico

## Elementos del Aprendizaje por Refuerzos

* **Policy (Política): **

Una política define la manera de comportarse de un agente, en cualquier momento de tiempo dado. Basicamente, es un mapeo de un estado o percepción s a una acción a, pudiendo ser estocásticas.

* **Reward Function (Función de Recompensa)**

Define cuantitativamente el objetivo del agente. Es un mapeo de un par estado-acción a un número real que indica "cuán deseable" es ejecutar dicha acción en ese estado. Asimismo, el único objetivo del agente es maximizar la recompensa total que recibe a lo large del tiempo. Cabe mencionar que, si bien la función de reward no puede ser alterada por el agente, provee las bases para cambiar la política del mismo.

* **Value function (Función de Valor)**

La función de valor se diferencia de la función de reward en el sentido de que indica "cuán deseable" es, a largo plazo, ejecutar una acción en un determinado estado. Así, el valor de un estado *s* es la cantidad total de reward que el agente espera obtener a futuro comenzando la interacción en el estado *s*.

* **Environment (Entorno)**

El entorno se encuentra constitutido por todo aquel elemento (real o simulado) que el agente no puede controlar. Es con quién el agente interactúa a partir de la ejecución de acciones de control.

## Ciclo del Aprendizaje por Refuerzos

### Definición formal

* Si el problema de RL dado tiene un conjunto finito de estados y acciones y satisface la propiedad de Markov entonces puede definirse como un Proceso de Decisión de Markov

\begin{equation}
MDPFinito = (S, A, P(.), R(.), γ)
\end{equation}

donde

$$ S = {s_{1}, s_{2}, ..., s_{n}} $$
es un conjunto finito de estados.

$$ A = {a_{1}, a_{2}, ..., a_{m}} $$
es un conjunto finito de acciones.
$$ P_{a}(s,s') = P(s_{t+1} = s | s_{t} = s, a_{t} = a) $$
es la probabilidad de que la acción a tomada en tiempo t y en estado s lleve al agente al estado s' en tiempo t+1
$$ R_{a}(s,s') $$
es la recompensa inmediata recibido tras transicionar, luego de tomar la acción a, desde el estado s al estado s'
$$\gamma \in  [0,1]$$
es el factor de descuento, representando la diferencia en la importancia de la recompensa a corto plazo vs la recompensa a largo plazo.

* Un **episodio** (instancia) de este MDP forma una secuencia finita
$$s_{0}, a_{0}, r_{1}, s_{1}, a_{1}, r_{2}, s_{2}, ... , s_{n-1}, a_{n-1}, r_{n}, s_{n} $$
donde $$s_{n}$$
es un estado final (o n es el tiempo de corte).

* La recompensa total del episodio está dado por
$$ R = r_{1} + r_{2} + ... + r_{n} $$

* En consecuencia, la recompensa a futuro partiendo del tiempo $t$ está dado por
$$R_{t} = r_{t} + r_{t+1} + ... $$

* Hay que considerar que el ambiente es estocástico en la mayor parte de los entornos reales y, por tanto, la recompensa suele diverger mientras más alejado se encuentre el instante de tiempo considerado. Es por esto que se utiliza un parámetro $γ$ llamado _factor de descuento_, para descontar el valor de las recompensas futuras. De esta manera,

\begin{equation} R_{t} = r_{t} + γr_{t+1} + γ^2r_{t+2} + γ^3r_{t+3} + ... = r_{t} + γ(r_{t+1} + γr_{t+2} + γ^2r_{t+3} ...) = r_{t} + γR_{t+1} \end{equation}

* Si utilizamos $γ=0$, el agente priorizará sólo la recompensa inmediata, mientras que $\gamma=1$ hará que considere todas los recompensas de la misma manera, independientemente del momento en donde las reciba.

* Dado un Proceso de Decisión de Markov, una Política (determinística) es una función $\pi$ que a partir de un estado $s \in S$, devuelve como resultado una acción $a \in A$. Una política estocástica devuelve, para un estado $s$ y una acción $a$, una probabilidad.

## Procesos de Decisión de Markov

**Resolver un problema de decisión modelado como un PDM implica encontrar los valores de la función de valor V**

### Función de Valor

* El valor de un estado es el retorno esperado por el agente, comenzando la interacción en dicho estado, dependiendo de la política ejecutada por el agente.

* El valor de la ejecución de una acción en un estado es el retorno esperado por el agente, comenzando la interacción en dicho estado a partir de la ejecución de dicha acción, dependiendo de la política ejecutada por el agente.

Una propiedad fundamental de las funciones de valor es que satisfacen ciertas propiedades recursivas. Para cualquier política  π y cualquier estado s, V(s) y Q(s,a) pueden ser definidas recursivamente en términos de la denominada *Ecuación de Bellman* ** (Bellman, 1957) **

### Ecuación de Bellman

* La idea básica es:

* Entonces,

* O, sin el operador de valor esperado:

La ecuación anterior refleja el hecho de que el valor de un estado se encuentra definido en términos de la recompensa inmediata y los valores de los estados siguientes ponderados en función de las probabilidades de transición, y adicionalmente un factor de descuento.

### Ecuación de Optimalidad de Bellman

La Ecuación de Optimalidad de Bellman refleja el hecho de que el Valor de un estado bajo la política óptima debe ser igual al retorno esperado para la mejor acción en dicho estado:

Al mismo tiempo, la acción óptima para un estado s dada la función de valor, puede obtenerse mediante:

La política anterior se denomina **Política Greedy**, dado que selecciona la mejor acción para cada estado, teniendo en cuenta la función de valor V(s). De manera análoga, la función de acción-valor óptima puede expresarse como:

## Ejemplo MDP y Políticas (*)

\(*) entorno de ejemplo basado en curso de Aprendizaje Profundo por Refuerzos, dictado por Juan Gómez Romero en la Escuela de Ciencias Informáticas 2019 - UBA

## Actividad 1

[RL Warm Up Lab!](lab_0_warmup_rl.ipynb)

## Aproximaciones para el aprendizaje de V y Q mediante Soluciones Tabulares

### Model Based vs. Model Free

* Model-free aprende Q/V directamente y presenta muy baja complejidad computacional.

* Model-based aprende T y R y usa un algoritmo de planning para encontrar la política. Uso eficiente de los datos/experiencia. Alto costo computacional.

## Aprendizaje por Diferencias Temporales (TD Learning).

* La idea principal es actualizar una predicción de la función de valor en base al cambio que existe en la misma de un momento al siguiente (**Diferencia Temporal o Temporal Difference**)

* Los algoritmos de aprendizaje basados en TD se emplean en mayor medida para realizar el CONTROL respecto de las acciones que ejecuta un agente que interactúa con su entorno. De esa manera, en lugar de aprender la función de estado-valor **V**, se orientan al aprendizaje de la función de acción-valor **Q**.

* En particular, existen dos enfoques principales para realizar el aprendizaje de funciones **Q**, ambos considerando el trade-off exploración/explotación: **on-policy** y **off-policy**. En particular, los métodos **on-policy** estiman $Q_{π}(s, a)$ para la política π que el agente se encuentra ejecutando, para todos los estados s y acciones a.

* Dicha estimación puede ser realizada empleando el mismo método TD descripto anteriormente para actualizar $V_{π}$, an base a:

## Trade-off exploración explotación

* Es el dilema en que incurre el agente al momento de **elegir entre distintas acciones**.

* Consiste en optar entre elegir una acción (a priori óptima) cuyos efectos son conocidos, esperando obtener un resultado similar (_explotar_) o elegir otra (posiblemente no óptima) cuyos efectos son desconocidos, pero que puede conducir a aprender más (_explorar_)?

## SARSA: On-Policy TD Learning

* El agente y su entorno interactúan a través de la ejecución de acciones, observación de estados y señales rewards. La inteligencia tendrá efecto sólo si el agente tiene claramente definidos objetivos o metas que persigue activamente mientras ocurre la interacción.

## Actividad 2

[Lab Introducción al RL](lab_1_intro_rl.ipynb)

## Bootstrapping

* Bootstrapping in RL puede entenderse como "emplear uno o más valores estimados en la actualización del mismo tipo de valor estimado".

* En el caso de los métodos TD:

* Presenta la desventaja de estar sesgado hacia los valores iniciales de la función de valor Q o V (Problema importante si empleamos estimadores, el sistema se autorreferencia)

* Empleando trayectorias más largas (Métodos MC) tenemos el problema de la alta varianza -> Necesitamos mayor cantidad de ejemplos para converger

## Q-Learning: Off-Policy TD Learning

* Uno de los más importantes avances en RL fue el desarrollo del algoritmo **off-policy** conocido como Q-learning (Watkins, 1989). En su forma más simple, en Q-learning la actualización de la función de acción-valor realizada se define por:

* Es este caso, la función de acción-valor Q aproxima directamente q∗, es decir, la función de acción-valor correspondiente a la política óptima, independientemente de la política seguida por el agente (de ahí su clasificación como **off-policy**), la cuál tiene efecto en el proceso de selección de acciones y por lo tanto determina cuales pares estado-acción se actualizan.

## Ejemplo On-Policy vs. Off-Policy: The Cliff

```python

```


```python
%matplotlib inline

import matplotlib
import numpy as np
import matplotlib.pyplot as plt

plt.rcParams["figure.figsize"] = (12, 9)
plt.rcParams["font.size"] = 18
```

# Reprocessing

Reprocessing recovers uranium and plutonium isotopes from spent nuclear fuel (SNF). In this step, some high level waste (HLW) streams may be separated in preparation for special treatment before disposal.

## Learning Objectives

At the end of this lesson you should be equipped to:

- Understand the motivations for reprocessing.
- Assess the pros and cons of various reprocessing strategies.
- Recognize the actinides and the motivation to manage them.
- Explain the differences in process between major reprocessing strategies.
- Order the steps of a typical PUREX process.
- Recall the history of nuclear fuel reprocessing.
- Recognize the safety challenges encountered historically in nuclear fuel repo
- Explain the relationship between reprocessing and nonproliferation.
- Calculate the impact of reprocessing and recycling on fuel utilization.
- Calculate the impact of reprocessing and recycling on fuel cycle costs.

## Used Nuclear Fuel and The Actinides

### What are actinides?

Actinides are all elements that are heavier than Actinium (Z=89). We typically care about a particular set of actinides called _transuranics_ or TRU. These are all elements heavier than Uranium (Z=92). Particularly:

- Np (Z=93)
- Pu (Z=94)
- Am (Z=95)
- Cm (Z=96)

### Management of Actinides

There are three primary reasons to manage actinides.

- Repository benefit: The decay heat burden of the actinides is a challenge for geologic disposal and increases repository management horizon.
- Energy Recovery: There is energy stored in many of these actinides, as some are fissile or have fissile daughters.
- Proliferation Resistence: Actinides can be used to construct a nuclear weapon (specifically, Pu).

### Repository Benefit

Let's look closely at repository benefit in the case of Yucca Mountain. The following plots are from Wigeland et al. [http://www.wmsym.org/archives/2004/pdfs/4333.pdf](http://www.wmsym.org/archives/2004/pdfs/4333.pdf).

**Discussion: If reduced SNF heat allows increased fuel loading, how does that impact the cost of the repository?**

**Vote: Do you think the cost of reproccessing is balanced by the savings in repository cost?**

## Closed and Open Nuclear Fuel Cycles

To recycle SNF (or, if you prefer, UNF) one must first chemically "reprocess" the nuclear fuel that emerges from nuclear reactors.

### Compare Once Through to U-Pu Recycling

 This figure from Michael Corradini, 2006

### Compare to Advanced LWR Fuel Cycles

## Major Accidents in Reprocessing Facilities
Reprocessing facilities have been responsible for more radiation release events than power reactors have, in general. [https://en.wikipedia.org/wiki/International_Nuclear_Event_Scale](https://en.wikipedia.org/wiki/International_Nuclear_Event_Scale).

## The Atomic Man

Aug. 30, 1976. Harold McCluskey. Hanford. Americium recovery facility.

Additional notes on the medical side of this accident: [https://www.dademoeller.com/dademoellerblog/wp-content/uploads/2014/08/2014-08-Americium-Incident-Carbaugh.pdf](https://www.dademoeller.com/dademoellerblog/wp-content/uploads/2014/08/2014-08-Americium-Incident-Carbaugh.pdf)

## Rocky Flats

September 11, 1957, (and May 11, 1969) near Golden, Colorado.

Uranium and plutonium are pyrophoric.

## The First Tokai Mura Accident

> On the night of Tuesday 11 March 1997, a small explosion occurred in a nuclear reprocessing plant of the Dōnen. Windows were smashed and smoke escaped to the atmosphere. On Thursday, workers repaired thirty broken windows and three doors with duct tape. They had been damaged during the blast. At least 37 workers were exposed to elevated levels of radiation during the incident.

## The Second Tokai Mura Accident

This accident, Sept. 30, 1999, was a different kind of accident. The previous accidents described were combustion related. This was a criticality accident.

Workers, uninformed about the impact of geometry on criticality, poured approximately 20% enriched uranium into a wide cylindrical bucket.

> The criticality involved about 16 kilograms of 18.8 percent enriched uranium in solution in a tank. The tank is used to precipitate uranium from nitric acid liquid solution. The tank contained far more uranium than allowed for safe operation. The tank should not have contained more than 2.4 kilograms.

### NRC Review

[http://www.nrc.gov/reading-rm/doc-collections/commission/secys/2000/secy2000-0085/attachment1.pdf](http://www.nrc.gov/reading-rm/doc-collections/commission/secys/2000/secy2000-0085/attachment1.pdf)

Also:
[https://www.nrc.gov/docs/ML1704/ML17045A577.pdf](https://www.nrc.gov/docs/ML1704/ML17045A577.pdf)

- Procedure appropriateness
- Safety culture
- Regulatory body did not require adequate safety review
- Training inadequacy

# Separations Methods

Separations is typically either aqueous or electrochemical (pyro). The most common method, by far, today is aqueous separations via PUREX.

The basic options are thus:

- Separate U, Pu, (as today).
- Separate U, Pu+U (small amount of U).
- Separate U, Pu, minor actinides.
- Separate U, Pu+Np, Am+Cm.
- Separate U+Pu all together.
- Separate U, Pu+actinides, certain fission products

Current capacity ([via world nuclear association](http://www.world-nuclear.org/information-library/nuclear-fuel-cycle/fuel-recycling/processing-of-used-nuclear-fuel.aspx)):

|  Reactor | Nation  | Facility  | tonnes per year  |
|---|---|---|---|
| LWR  |  France | La Hague  | 1700  |
| LWR  |  UK     | Sellafield (THORP)  | 600  |
| LWR  |  Russia | Ozersk  (Mayak)  | 400  |
| LWR  |  Japan  | Rokkasho  | 800  |
| Other  |  UK | Sellafield (Magnox)  | 1500  |
| Other  |  India | PHWR  | 330  |
| Other  |  Japan |  Tokai, MOX | 40  |

An aside on [ANS Position Statements](http://www.ans.org/pi/ps/) :

- [Position Statement 45](http://cdn.ans.org/pi/ps/docs/ps45.pdf)
- [Position Statement 74](http://www.ans.org/pi/ps/docs/ps74.pdf)

## PUREX

PUREX is simple, conventional separation of FP from U-Pu-MA (Does not reduce radioactivity but separates for further processing). [LLNL Report source material here.](https://e-reports-ext.llnl.gov/pdf/799624.pdf)

- Head end: (Sometimes Voloxidation), Chopping, shearing, dissolving.
- 1st Processing Phase: Coextraction. "In the first cycle, uranium and plutonium are co-extracted into an
organic phase, leaving the fission products and other actinide activation products in the aqueous phase"
- Second Processing Phase: Pu Extraction. "In the second cycle, plutonium is stripped away from the uranium and
returned to an aqueous phase,"
- Third Processing Phase: "In the third cycle, uranium is stripped away from the organic phase into dilute nitric acid"
- Finally: Additional purification and return to appropriate valences.

### Chopping, Shearing and Dissolving

The first step is mostly mechanical, but involves some chemistry. Namely, the cladding is removed, the fuel is chopped, and then it is dissolved. This relies on nitrite solutions.

NEEP 571, M. Corradini & PPH Wilson

JAEA R&D Review 2011 Copyright(c) Japan Atomic Energy Agency. All Rights Reserved.

NEEP 571, M. Corradini & PPH Wilson

### Solvent Extraction

The valence of the Pu and U matter for the rest of this flowsheet.

**Based on this diagram, what do you think 'raffinate' refers to?**

### Separation of Pu and U

Additional solvent extraction steps separate uranium and plutonium into separate streams.

### Return to appropriate valences

### PUREX for Weapons
PUREX was initially created for military applications.

- created separated pure plutonium
- produced significant high level liquid waste

### PUREX for civilian applications

- Waste handling has been greatly improved
- Excellent safety record at commercial France and UK plants
- Produces separated pure plutonium

## UREX & UREX+

NEEP 571, M. Corradini & PPH Wilson

# Pyroprocessing / Electrochemical Separations

This brochure from Argonne is a good primer of electrorefining: http://www.cse.anl.gov/pdfs/pyroprocessing_brochure.pdf .

This image comes from that brochure:

> Electrorefining is very similar to electroplating. Used fuel attached to an anode is suspended in a chemical bath;
electric current then dissolves the used fuel and plates out the uranium and other actinides on the cathode.
These extracted elements are then sent to the cathode processor where the residual salt from the refining
process is removed.
Finally, the remaining actinides and uranium are cast into fresh fuel rods and the salt is recycled back into the
electrorefiner

# Fuel Utilization

One reason to consider reprocessing is economic. While right now, the cost of uranium and associated enrichment services is low in comparison to other fuel forms, per kWh, this may not always be the case.

\begin{align}
U &= \frac{\mbox{mass of fuel consumed}}{\mbox{mass of resource (e.g., nat U) used}}\\
 &= \frac{M_f}{FF\times M_l}\\
 M_f &= \mbox{mass of fuel consumed}\\
 M_l &= \mbox{mass of fuel loaded into the core}\\
 FF &= \mbox{enrichment feed factor}\\
\end{align}

## Aside: $M_f$
First, let's think about the mass of fuel question. Your book states without proof that thermal $^{235}U$ fissions consume about 1.23g per MWd.

**Let's show that this is the case.**

First, recall :

\begin{align}
^{235}_{92}U + ^{1}_{0}n \rightarrow \left(^{236}_{92}U\right)^* \rightarrow ^{A_1}_{Z_1}X +  ^{A_2}_{Z_2}X + {\nu ^{1}_{0}n} + Q
\end{align}

That's our fission reaction. For each fission, 200MeV of energy is released. Let's then calculate how many atoms result in a thermal power of one Joule (1 $W\cdot s$).

\begin{align}
\left(\frac{1\mbox{ fission}}{200 MeV}\right)
\left(\frac{1MeV}{1.6021\times10^{-13}J}\right)
& =3.12\times 10^{10}
\left(\frac{fissions}{J}\right)
\end{align}

Each fission is one uranium atom, so:
\begin{align}
\left(\frac{3.12\times 10^{10}\mbox{atoms fissioned}}{J}\right)
\left(235 \frac{g}{ mol}\right)\left(\frac{1 mol}{6.022\times10^{23} atoms}\right)& = 1.22\times 10^{-11}\frac{g}{J}\\
\end{align}

We need to convert to MWd, so we'll need to know how many joules are in a MWd.

\begin{align}
\left(\frac{1 J}{W\cdot s}\right)
\left(\frac{10^6 W}{MW}\right)
\left(\frac{60\times60 s}{h}\right)
\left(\frac{24h}{d}\right)
&=
8.64\times10^{10}\frac{J}{MWd}
\end{align}

Then, we can multiply J/MWd against g/J to get g/MWd.

\begin{align}
\left(8.64\times10^{10}\frac{J}{MWd}\right)\left(1.22\times 10^{-11}\frac{g}{J}\right)&= 1.05 \frac{g}{MWd}
\end{align}

**However, we have to correct for the fact that fuel is also consumed by non-fission capture.**

\begin{align}
\frac{\sigma_c}{\sigma_f} &= 0.169\\
\Rightarrow\frac{\sigma_f + \sigma_c}{\sigma_f} &= 1.169\\
\end{align}

So, we get:
\begin{align}
\left(\frac{g}{MWd}\right)\left(\frac{\sigma_f + \sigma_c}{\sigma_f}\right)
&= 1.05 \frac{g}{MWd}\times  1.169 = 1.23
\end{align}

```python
mev_per_fission = 200
j_per_mev = 1.60218e-13
fission_per_sec = 1/(mev_per_fission*j_per_mev)
print("fissions per second", fission_per_sec)

N_5 = 235/6.022E23
g_per_fission = fission_per_sec*N_5
print("g per fission", g_per_fission)

j_per_mwd = (10**6)*(3600)*(24)
print("Joule per MWd", j_per_mwd)

cap_to_fiss = 1 + 0.169
g_per_mwd = j_per_mwd*g_per_fission*cap_to_fiss
print("g per MWd", g_per_mwd)

```

    fissions per second 31207479808.76056
    g per fission 1.2178275913415362e-11
    Joule per MWd 86400000000
    g per MWd 1.230025352496413

## U Utilization

Alright, now you have 1.23 g/MWd for uranium 235 fissions. Now you can figure out the mass consumed for some burnup amount.

\begin{align}
U &= \frac{\mbox{mass of fuel consumed}}{\mbox{mass of resource (e.g., nat U) used}}\\
 &= \frac{\frac{1.23g}{MWd}BU(tIHM)}{\mbox{mass of resource (e.g., nat U) used}}
\end{align}

Now, though, you need the feed factor, to get the denominator.

\begin{align}
FF &= \frac{x_p - x_w}{x_f - x_w}\\
\end{align}

\begin{align}
U &= \frac{\frac{1.23g}{MWd}BU(tIHM)}{FF\times M_l}
\end{align}

## Fuel Utilization in Breeders

A breeder reactor has the quality that it encourages the breeding of a secondariy fissile nuclide and thus, gets more fuel utilization.

Let's introduce the concept of $\gamma$, the losses in reprocessing and fuel refabrication.

\begin{align}
U &= \frac{\frac{M_f}{M_l}}{\left[\frac{M_f}{M_l}\right](1-\gamma) + \gamma}\\
\end{align}

Let's compare once through with a breeder.

\begin{align}
\frac{M_f}{M_l} &= \frac{g}{Mwd}\times BU\\
              &= \frac{1.23g}{MWd}\times\frac{50MWd}{tHM}\times\frac{10^3tHM}{g}\\
              &= 0.0615
\end{align}

For a typical LWR, the feed factor is :

\begin{align}
FF &= \frac{x_p - x_w}{x_f - x_w}\\
&= \frac{4 - .2}{0.711 - 0.2}\\
&= 7.436
\end{align}

Thus, U = 0.0615/7.436 = 0.0082 for a typical LWR.

For a reprocessing scheme with 2% losses:

\begin{align}
U &= \frac{0.0615}{\left[0.0615\right](1-0.02) + 0.02}\\
\end{align}

```python
g_per_kg=1000
BU=50
FF=7.436
gamma = 0.02
U_lwr = BU*g_per_mwd/(g_per_kg*FF)
mf_per_ml= BU*g_per_mwd/g_per_kg
U_breed=mf_per_ml/(mf_per_ml*(1-gamma) + gamma)
print("u_lwr =", U_lwr)
print("M_f/M_l =", mf_per_ml)
print("u_breed =", U_breed)

# In the book, there is a distinction for HM utilization
BU=80
mf_per_ml= BU*g_per_mwd/g_per_kg
HM_breed=mf_per_ml/(mf_per_ml*(1-gamma) + gamma)
print("M_f/M_l =", mf_per_ml)
print("hm_breed =", HM_breed)

```

    u_lwr = 0.008270746049599336
    M_f/M_l = 0.06150126762482066
    u_breed = 0.7661681305015127
    M_f/M_l = 0.09840202819971304
    hm_breed = 0.8451314791998584

## MOX reactor physics

SNF recycling in MOX is conducted today in many nations, led primarily by France.

> Today MOX is widely used in Europe and in Japan. Currently about 40 reactors in Europe (Belgium, Switzerland, Germany and France) are licensed to use MOX, and over 30 are doing so. In Japan about ten reactors are licensed to use it and several do so. These reactors generally use MOX fuel as about one-third of their core, but some will accept up to 50% MOX assemblies. France aims to have all its 900 MWe series of reactors running with at least one-third MOX. Japan also planned to use MOX in one-third of its reactors in the near future and APDC expects to start up a 1383 MWe (gross) reactor with a complete fuel loading of MOX at the Ohma plant in 2022. Other advanced light water reactors such as the EPR or AP1000 are able to accept complete fuel loadings of MOX if required. --- World Nuclear Association

From [WNA](http://www.world-nuclear.org/information-library/nuclear-fuel-cycle/fuel-recycling/mixed-oxide-fuel-mox.aspx)

From [WNA](http://www.world-nuclear.org/information-library/nuclear-fuel-cycle/fuel-recycling/mixed-oxide-fuel-mox.aspx)

French reactors typically do not use 100% MOX fuel because the amount of acceptable plutonium content is limited by reactor physics.

UOx reactor

MOx reactor

### Higher fission cross section of Pu causes power peaking.

### Because of high absorption in Pu, control rod worth is reduced.

### Lower $\eta$ value in Pu means that more Pu is needed to acheive same exess reactivity

However, slower burnup means less excess reactivity is needed in MOX cores.

### Aside: Delayed Neutron Fraction and Mean Neutron Lifetime

By combining the neutron transport equation with a source contribution from
delayed neutrons,  we can arrive at the fundamental analysis tool in nuclear reactor
kinetics. These are a stiff set of PDEs involving nonlinearly coupled
neutronics, thermodynamics, and hydraulics.

The delayed neutron precursors obey the equation,

\begin{align}
  \frac{\partial \hat{C}_i(t,r)}{\partial t} =
  \beta_i\nu\Sigma_f(r,t)\phi(r,t) -
  \lambda_i\hat{C}_i(r,t)\\
  i\in [1,6].
\end{align}

$\beta_i$ and $\lambda_i$ depend on the incident neutron energy, fissionable
isotope, and precursor group.  In this way, the  linearized Boltzmann transport
equation has seven dimensions.  Taking delayed neutrons into account, the one
speed neutron diffusion equation can be written,

\begin{align}
  \frac{1}{v}\frac{\partial \phi(r,t)}{\partial t} - D(r,t)\nabla^2\phi(r,t) + \
  \Sigma_a(r,t)\phi(r,t) = (1-\beta)\nu\Sigma_F(r,t)\phi(r,t) + \
  \sum_{i=1}^6\lambda_i\hat{C}_i(r,t).
\end{align}

Transient analysis methods seek to solve this equation for changes in the
parameters caused by a changing reactor conditions. Additional PDEs are added to
this calculation to capture the dependence of temperature on heat conduction and
the effect of fluid flow.

\begin{equation}
  \frac{d}{dt}\left[
    \begin{array}{c}
      p\\
      \zeta_1\\
      .\\
      .\\
      .\\
      \zeta_J\\
      \omega_1\\
      .\\
      .\\
      .\\
      \omega_K\\
    \end{array}
    \right]
    =
    \left[
      \begin{array}{ c }
        \frac{\rho(t,T_{fuel},T_{cool},\cdots)-\beta}{\Lambda}p +
        \displaystyle\sum^{j=J}_{j=1}\lambda_j\zeta_j\\
        \frac{\beta_1}{\Lambda} p - \lambda_1\zeta_1\\
        .\\
        .\\
        .\\
        \frac{\beta_J}{\Lambda}p-\lambda_J\zeta_J\\
        \kappa_1p - \lambda_1\omega_1\\
        .\\
        .\\
        .\\
        \kappa_{k}p - \lambda_k\omega_{k}\\
      \end{array}
      \right]
    \end{equation}

\begin{align}
    \rho(t,&T_{fuel},T_{cool},T_{mod}, T_{refl}) = \mbox{ reactivity, [pcm]}\\
    \beta &= \mbox{ fraction of neutrons that are delayed}\\
    \beta_j &= \mbox{ fraction of delayed neutrons from precursor group j}\\
    \zeta_j &= \mbox{ concentration of precursors of group j}\\
    \lambda^{d}_j &= \mbox{ decay constant of precursor group j}\\
    \omega_k &= \mbox{ decay heat from FP group k}\\
    \kappa_k &= \mbox{ heat per fission for decay FP group k}\\
    \lambda^{FP}_k &= \mbox{ decay constant for decay FP group k}\\
    l &= \mbox{mean neutron lifetime}\\
      &= \mbox{mean time for one neutron to be removed from the reactor}\\
      &= \frac{1}{\left(\Sigma_a + DB^2\right)v}\\
    \Lambda &= \mbox{neutron reproduction time}\\
            &= \mbox{mean time for one neutron to be replaced by another neutron on fissioning}\\
            &= \frac{1}{\nu\Sigma_fv}\\
 \end{align}

**Bottom line: lower fraction of delayed neutrons constrains reactor control.**
**Bottom line: Similarly, shorter prompt neutron lifetimes neutrons constrain reactor control.**

## Plutonium and Void Coefficients

\begin{align}
\rho &= \frac{k_{eff} - 1}{k_{eff}}\\
&= \begin{cases}
\rho > 0 & \mbox{supercritical}\\
\rho = 0 & \mbox{critical}\\
\rho < 0 & \mbox{subcritical}\\
\end{cases}\\
\rho_{tot} &= \sum \rho_i\\
\rho_{void} &= \mbox{Reactivity from coolant voiding}\\
\alpha_v &= \mbox{void reactivity coefficient}\\
&=\frac{\partial \rho}{\partial v}
\end{align}

# Conversion Ratio

The conversion ratio is a measure of the evolution of fissile nuclides in the core and their involvement in fission.

\begin{align}
CR &= \frac{\mbox{production of fissile nuclei}}{\mbox{depletion of fissile nuclei}}\\
&=\begin{cases}
< 1 & \mbox{burner} \\
> 1 & \mbox{breeder}
\end{cases}
\end{align}

## Breeding in Thermal Reactors

For typical enriched uranium fuel, this is, effectively:

\begin{align}
CR &= \frac{\mbox{production of } ^{239}Pu}{\mbox{depletion of } ^{235}U}
\end{align}

In more detail, we could say:

\begin{align}
CR &= \frac{\mbox{production of } ^{239}Pu}{\mbox{depletion of } ^{235}U + \mbox{depletion of } ^{239}Pu}
\end{align}

If $\nu_0$ is the number of neutrons produced for each neutron absorbed in $^{235}U$ is 2.075, then what has to happen in order to have a $^{235}U$ fuelled breeder?

- 1st neutron: creates another fission
- 2nd neutron: produces $^{239}Pu$
- 0.08 neutrons left over

Is the above situation likely?

There is an opportunity for thermal spectrum using $^{233}U$, which has a higher $\nu_0$, equal to 2.296. Of course, the way this works is that $^{232}Th$ is the fertile nuclide and $^{233}U$ is the fissile fuel that is preferentially bred. However, one must start with $^{235}U$.

## Breeding in Fast Reactors

We can do a bit better with a plutonium-based fuel cycle. Since ${239} Pu$ has a high capture to fission cross section at thermal energies, we can only do this by aiming for a harder (faster, less thermal, higher energy) neutron spectrum in the core.

[source](http://www.tpub.com/doenuclearphys)

Go to : [https://pollev.com/katyhuff](https://pollev.com/katyhuff)

```python
from IPython.display import IFrame
IFrame("https://embed.polleverywhere.com/free_text_polls/PpzDE4SqDrxQGN0?preview=true", width=1000, height=700)
```

- In a fast reactor of this sort, the neutrons are not thermalized. Instead, $^{239}Pu$ fissions occur at high energies (above 1MeV).
- At these energies, the fission cross section in $^{239}Pu$ is $\sigma_f = 1.7b$
- and the capture-to-fission ratio is less than 0.03.
- Also, at about 3 neutrons per fission for ${239} Pu$ fissions at 1MeV, there are plenty of neutrons available for breeding.

 [source](https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/LMFBR_schematics2.svg/1280px-LMFBR_schematics2.svg.png)

### LMFBR Coolant
Fast reactors must avoid thermalization of the neutrons. Thus, moderating coolants are avoided. Instead, liqiud metals are chosen as the coolant for their relatively high mass number A. An added advantage of liquid metals is that they are excellent at heat transfer.

A typical choice for LMFBR coolant is ${23}Na$. Can you think of any downsides of sodium as a coolant?

```python
from IPython.display import IFrame

IFrame("https://embed.polleverywhere.com/free_text_polls/gvv1yTIP8TMNTaY?preview=true", width=1000, height=700)
```

### LMFBR Fuel

The fuel is typically made of mixed $PuO_2$ (about 80%) and $UO_2$ (about 20%) pellets. Depleted uranium is typically used

**From what type of fuel cycle facility would you acquire depleted uranium?**

```python
from IPython.display import IFrame
IFrame("https://embed.polleverywhere.com/ranking_polls/Ija9UIgC1yFsugXWljhJk?controls=none&short_poll=true", width=800, height=600)
```

## What about burners?

CR << 1 can be acheived in a number of types of reactors. An extreme option, when burning actinides is the primary goal, is an accelerator driven system.

[source: MYRRHA](myrrha.sckcen.be)

But where do we get the spallation neutrons?

[source: LANSCE](http://www.lanl.gov)

## Natural Uranium Savings From Recycling U and Pu

Let's introduce some new variables:

\begin{align}
x_s &= \mbox{enrichment of uranium in used fuel}\\
fPu &= \mbox{mass of fissile plutonium}\\
s &= \mbox{kg of fPu recovered per kg of used fuel}\\
u &= \mbox{kg of used fuel per kg of fresh fuel}\\
\end{align}

We can calculate the savings in natural uranium due to plutonium recycling.

Consider 1 kg of fresh fuel. It contains $x_p$ kg of $^{235}U$. If we replce this kg with MOX (Pu and depleted U tails) we calculate an "equivalence":

\begin{align}
x_p\mbox{ kg of }^{235}U \longleftrightarrow x_w\mbox{ kg of }^{235}U + \frac{x_p - x_w}{p}\mbox{ kg of Pu}
\end{align}

So, if natural uranium is used as feed, FF kg of natural uranium are needed for each kg. If MOX is used instead, the savings is :

\begin{align}
\frac{FF\cdot p}{x_p - x_w} = \mbox{(kgU saved per kg fPu)}
\end{align}

We can also describe savings in terms of s (Pu recovered) and amount of fuel discharged:

\begin{align}
\frac{s\cdot FF\cdot p}{x_p - x_w} = \mbox{(kgU saved per kg of fuel discharged)}
\end{align}

Or , we can describe it per kg initially loaded into the reactor :
\begin{align}
\frac{u \cdot s\cdot FF\cdot p}{x_p - x_w} = \mbox{(kgU saved per kg of fuel initially charged into the reactor )}
\end{align}

Finally, we can describe it per kg of natural uranium
\begin{align}
\frac{u \cdot s \cdot p}{x_p - x_w} = \mbox{(kgU saved per kg of natural uranium feed )}
\end{align}

```python

```