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
library(reproj)
x <- reproj_xy(do.call(cbind, maps::map(plot = F)[1:2], "EPSG:3976")


y <- reproj_xy(cbind(-180:180, -58), "EPSG:3976")

with these settings (region unset for good measure)

export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_S3_ENDPOINT=data.source.coop

export AWS_VIRTUAL_HOSTING=FALSE
export CPL_VSIL_USE_TEMP_FILE_FOR_RANDOM_WRITE=YES
export CPL_VSIS3_CREATE_DIR_OBJECT=TRUE
@mdsumner
mdsumner / minx.md
Last active December 17, 2024 12:55

running the quickstart

air_temp.to_zarr(repo.store, group='air_temperature')
/workenv/lib/python3.11/site-packages/xarray/core/dataset.py:2621: SerializationWarning: saving variable None with floating point data as an integer dtype without any _FillValue to use for NaNs
  return to_zarr(  # type: ignore[call-overload,misc]
Traceback (most recent call last):

A docker image for R folks wanting python too on GADI.

This update script will get the latest version of the image (it's big). Set your project/s for scratch and storage, I don't really understand the temp file stuff yet but this worked for me. Takes about 25min to get the image (you don't need to update often, this is very latest GDAL/PROJ/GEOS.

#!/bin/bash


#PBS -l ncpus=1

Get rema in longlat for a given extent, and resolution.

2m resolution is some thing like 1/50000 of a degree, so 3e-5 gives cells with 4m^2 area at 70S

#' Get REMA v2 data in longlat
#' 
#' This is crafted VRT hosted on github that references the source 2m GeoTIFFs and some pre-rendered lower resolutions, 
#' so we can make data from large areas quickly as well as small areas. 
#' 
```R
prj <- "+proj=stere +lat_0=-90 +lon_0=100 +lat_ts=-70"
library(raadtools)
files <- read_amsr2_3k_ice(returnfiles = TRUE)
files <- files[nrow(files):1, ]
im <- vapour::gdal_raster_data(files$fullname[1], target_ext = e, target_crs = prj)
p <- reproj::reproj(cbind(99.3, -64.5), prj, source = "EPSG:4326")