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

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

from osgeo import gdal Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'osgeo'

set.seed(1)

url = "https://naciscdn.org/naturalearth/10m/raster/SR_LR.zip/SR_LR.tif"
url = paste0("/vsizip/vsicurl/", url)
#url <- "/vsicurl/https://gebco2023.s3.valeria.science/gebco_2023_land_cog.tif"

n = 44000
pts = cbind(x = runif(n, -180, 180), y = runif(n, -90, 90))
## whereever SGAT code does this: 


library(maptools)
data("wrld_simpl")
## Cells per degree
n <- 1
grid <- raster(nrows=n*diff(ylim),ncols=n*diff(xlim),
  xmn=xlim[1],xmx=xlim[2],ymn=ylim[1],ymx=ylim[2],
gdalinfo "/vsicurl/https://n5eil01u.ecs.nsidc.org/AMSA/AU_SI12.001/2012.07.02/AMSR_U2_L3_SeaIce12km_B04_20120702.he5" -sd 26
Driver: HDF5Image/HDF5 Dataset
Files: /vsicurl/https://n5eil01u.ecs.nsidc.org/AMSA/AU_SI12.001/2012.07.02/AMSR_U2_L3_SeaIce12km_B04_20120702.he5
Size is 608, 896
Metadata:
  Conventions=CF-1.6
  HDFEOS_INFORMATION_HDFEOSVersion=HDFEOS_5.1.15
  history=This version of the Sea Ice processing code contains updates provided by the science team on September 16, 2019. For details on these updates, see the release notes provided in the DAP.
  institution=NASA's AMSR Science Investigator-led Processing System (SIPS)

See

> ## Number of chunks and runs per chunk
> chunks <- 250
> runs <- 40
> plan(multisession, workers= availableCores()-1)
Error: Cannot create 127 parallel PSOCK nodes. Each node needs one connection, but there are only 124 connections left out of the maximum 128 available on this R installation

GeoBox from a DSN

def extent(dimension, transform): 
  return [transform[0], transform[0] + dimension[0] * transform[1], 
  transform[3] + dimension[1] * transform[5], transform[3]]
  
  
def bbox(dimension, transform): 
library(duckdbfs)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#>