Preview:
#libraries
import datetime as dt
import xarray as xr
import fsspec
import s3fs
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd


#### AWS repository link - https://registry.opendata.aws/mur/

%%time
file_location = 's3://mur-sst/zarr'

ikey = fsspec.get_mapper(file_location, anon=True)

ds_sst = xr.open_zarr(ikey,consolidated=True)

ds_sst

data=ds_sst.sel(lat=slice(10,15),lon=slice(-68,-67))

data.analysed_sst[0,:,:].where(dataMask[0,:,:]==1).plot()


dataMask=ds_sst.mask.sel(lat=slice(10,15),lon=slice(-68,-67))
dataMask

data.analysed_sst[0,:,:].where(dataMask[0,:,:]==1).to_netcdf('testMUR.nc')

sst=xr.open_dataset('testMUR.nc')
sst.analysed_sst.plot()


downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter