Skip to content

Instantly share code, notes, and snippets.

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.
library(mapgl)
mapboxgl(
style = mapbox_style("streets"),
center = c(-87.61694, 41.86625),
zoom = 15.99,
pitch = 40,
bearing = 20,
antialias = TRUE
) |>
@Kodiologist
Kodiologist / example.parquet
Last active July 24, 2023 16:52
Example of writing and reading a Parquet file with XIS temperature predictions
# UPDATE: Instead of using this script, you should probably
# use http://web.archive.org/web/2021id_/https://modis.ornl.gov/files/modis_sin.kmz
#!/usr/bin/env python3
"""
Draw the shapes of tiles used by Moderate Resolution Imaging
Spectroradiometer (MODIS) satellite products. The output is a TSV file
with the shapes as well-known text (WKT) that can be read into QGIS.
"""
library(tidyterra)
library(tidyverse)
library(terra)
library(tigris)
library(sf)
library(mapboxapi)
# Get data from https://www.mrlc.gov/data/nlcd-2019-land-cover-conus
# Warning - it's big!
nlcd <- rast("~/data/nlcd_2019_land_cover_l48_20210604/nlcd_2019_land_cover_l48_20210604.img")
@grantmcdermott
grantmcdermott / bboot.R
Last active May 6, 2022 18:50
Bayesian bootstrap
# Context: https://twitter.com/grant_mcdermott/status/1487528757418102787
library(data.table)
library(fixest)
bboot =
function(object, reps = 100L, cluster = NULL, ...) {
fixest_obj = inherits(object, c('fixest', 'fixest_multi'))
@barronh
barronh / tempo_syntheticearlyadopters2.ipynb
Created November 10, 2021 15:37
tempo_syntheticearlyadopters2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DavZim
DavZim / map_projections.R
Created January 20, 2021 10:37
Creates a gif of the world in different map projections
library(tidyverse)
library(sf)
library(spData)
library(gganimate)
data(world)
# see also: https://proj.org/operations/projections/index.html
projs <- list(
"Mercator" = "+proj=merc",
@mkiang
mkiang / 01_pull_data.R
Created December 10, 2020 22:35
Collaboration network 2020 version
## Visualizing authorship networks: code for this blog post:
## https://mathewkiang.com/2020/12/10/my-collaboration-network-for-2010-to-2020-other-plots
## Imports ----
library(scholar) # remotes::install_github("jkeirstead/scholar")
library(tidyverse)
library(fs)
library(here)
## Constants ----
// US area polygon
var pol = ee.Geometry.Polygon([ [ [ -80.919630492025277, 30.699135009797704 ], [ -80.871245451372644, 30.336014265533166 ], [ -80.762754341973988, 29.906426353226227 ], [ -80.504997201528766, 29.330160083879278 ], [ -80.083106700408266, 28.673401576509857 ], [ -80.070233511479728, 28.651960676800226 ], [ -80.058638153313169, 28.629988680787292 ], [ -80.04835227119456, 28.607547474440747 ], [ -80.039403769248054, 28.584700211077717 ], [ -80.031816742625793, 28.561511131077758 ], [ -80.025611421049575, 28.538045379128882 ], [ -80.020804123732901, 28.514368819546309 ], [ -80.0174072256752, 28.490547850204102 ], [ -80.01542913528462, 28.466649215616201 ], [ -80.0148742832517, 28.442739819698442 ], [ -80.015743122564871, 28.418886538736928 ], [ -80.018032139528088, 28.395156035079435 ], [ -80.021733875613705, 28.371614572058188 ], [ -80.026836959956768, 28.348327830641338 ], [ -80.033326152273503, 28.32536072829911 ], [ -80.041182395964384, 28.302777240558235 ], [ -80.050382881141516, 28.2806402