Skip to content

Instantly share code, notes, and snippets.

View mdsumner's full-sized avatar

Michael Sumner mdsumner

  • Integrated Digital East Antarctica, Australian Antarctic Division
  • Hobart, Australia
View GitHub Profile

A small list of global datasets on Pawsey object storage.

'NSIDC_SEAICE_PS_S25km', 'NSIDC_SEAICE_PS_N25km' are the 25km sea ice concentrations between 1978-now.

'SEALEVEL_GLO_PHY_L4' is Copernicus altimetry, global longlat since 1993 (ssh, u/v currents

'oisst-avhrr-v02r01' is OISST 25km global longlat SST since 1982.

Virtual Zarr referencing NetCDF objects on Pawsey storage, stored as "kerchunk Parquet".

following on from https://bsky.app/profile/jerry-shannon.bsky.social/post/3lcisatdppk2h

gdalinfo /vsigs/gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3
ERROR 15: No valid GCS credentials found. For authenticated requests, you need to set GS_SECRET_ACCESS_KEY, GS_ACCESS_KEY_ID, 
GS_OAUTH2_REFRESH_TOKEN, GOOGLE_APPLICATION_CREDENTIALS, or other configuration options, or create a /home/ubuntu/.boto file. Consult
https://gdal.org/en/stable/user/virtual_file_systems.html#vsigs-google-cloud-storage-files for more details. For unauthenticated requests
on public resources, set the GS_NO_SIGN_REQUEST configuration option to YES.
rast("/vsis3/idea-10.7289-v5sq8xb5/www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/198109/oisst-avhrr-v02r01.19810901.nc")
## function to split "label: text" into data.frame(label = text)
v1 <- function(x) {  
  x <- gsub(": ", ":", x)  ## first clear that whitespace
  dd <- read.delim(text = x, sep = ":", header = FALSE); 
  setNames(data.frame(dd[[2]]), dd[[1]][1])
}

library(sf)
sf::sf_use_s2(FALSE)
prj <- "+proj=stere +lat_0=-90 +lat_ts=-70 +datum=WGS84"

f <- "~/FastIce_70_2006.nc"
ex <- c(-2700000, -2700000 + 5625 * 1000, -2397000, -2397000 + 4700 * 1000)


library(terra)
r <- rast(f, "Fast_Ice_Time_series")
set.ext(r, ext(ex))

WIP, trying to get the right resolution from a web tile server

library(tmap)
library(terra)


## reliable world polygons
psrc <- "/vsizip//vsicurl/https://github.com/wmgeolab/geoBoundaries/raw/main/releaseData/CGAZ/geoBoundariesCGAZ_ADM0.zip"
psrcsql <- "SELECT shapeGroup FROM geoBoundariesCGAZ_ADM0 WHERE shapeGroup IN ('AUS')"
  prj <- "+proj=stere +lat_0=-90 +lat_ts=-70 +datum=WGS84"

f <- "~/FastIce_70_2006.nc"
ex <- c(-2700000, -2700000 + 5625 * 1000, -2397000, -2397000 + 4700 * 1000)

nc <- ncdf4::nc_open(f)
print(nc) ## tells us metadata like
#> File ~/FastIce_70_2006.nc (NC_FORMAT_NETCDF4):
#> 

Zarr

zarrs

A real Rust library for Zarr, including virtualization support, Icechunk integration and v3.

GDAL

has its own Zarr v2 and v3 internal implementation, works but

@mdsumner
mdsumner / aad_.md
Last active January 16, 2025 05:44
docker run -it --rm pangeo/pangeo-notebook:latest bash

pip install arraylake xarray netcdf4 dask pooch
import xarray as xr
from arraylake import Client
library(terra)
dates <- seq(as.Date("2024-01-12"), as.Date("2025-01-11"), by = "1 day")
r <- rast(sds::nsidc_seaice(dates[length(dates)], hemisphere = "north"))
r[r > 2500] <- NA
r <- r/10
plot(r)