Skip to content

Instantly share code, notes, and snippets.

View ashiklom's full-sized avatar

Alexey Shiklomanov ashiklom

View GitHub Profile
@ashiklom
ashiklom / zarr-chunks.py
Created March 8, 2023 17:58
Experimenting with Zarr chunking
import xarray as xr
import numpy as np
d1 = np.random.rand(133, 10, 10)
t1 = np.arange(1, 134)
xs = np.arange(1, 11)
ys = np.arange(1, 11)
chunking = {"time": 100, "x": 10, "y": 10}
@ashiklom
ashiklom / aws-mfa
Last active April 9, 2025 14:20
AWS MFA script
#!/bin/bash
if (return 0 2> /dev/null)
then
: # Pass
else
echo 'This script must be `source`d, not executed!'
exit 255
fi
@ashiklom
ashiklom / visualization.mmd
Created January 20, 2023 16:54
NASA Earth Science visualization architecture prototype
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashiklom
ashiklom / my-wget.py
Created December 13, 2022 22:54
EDL "wget" implementation
def wget(url):
import urllib.request
import netrc
import os
import fsspec
import base64
from urllib.parse import urlparse
# Get login credentials
@ashiklom
ashiklom / run-apply-oe.sh
Created August 26, 2022 15:11
Isofit apply_oe example script
#!/usr/bin/env bash
set -euxo pipefail
# Number of parallel cores
n_cores=4
# Name of conda environment you are using
CONDA_ENV_NAME="isofit-master"
@ashiklom
ashiklom / env-hypertrace.yml
Last active June 8, 2021 15:12
Conda environment for Hypertrace
name: env-hypertrace
channels:
- conda-forge
- defaults
dependencies:
# Core utilities
- pip
- mamba
# Isofit dependencies -- from `setup.py` file
- python >=3.8,<3.9.0
@ashiklom
ashiklom / neon-ggspatial.R
Created February 25, 2021 22:07
NEON data processing with ggspatial
library(conflicted)
library(hdf5r)
library(raster)
library(sf)
library(fs)
library(dplyr)
library(tidyr)
library(purrr)
library(fst)
library(vroom)
@ashiklom
ashiklom / 01-simple-edr.R
Last active January 28, 2021 16:32
EDR-PROSPECT tutorial
# Install the package with the following:
if (FALSE) {
install.packages("remotes") # If you don't have the remotes package
remotes::install_github("ashiklom/rrtm")
}
library(rrtm)
example <- edr_r(
# Cohort state variables, in order from tallest to shortest
@ashiklom
ashiklom / docker-compose.override.yml
Created November 5, 2020 13:54
PEcAn API docker compose overrides
version: "3.2"
services:
api:
volumes:
- ./apps/api/:/api
# If you want direct database access, uncomment this:
postgres:
ports:
@ashiklom
ashiklom / api-ED2.R
Last active January 25, 2021 18:37
PEcAn API minimal example
library(rpecanapi)
library(httr)
library(magrittr, include.only = "%>%")
library(dplyr)
library(glue)
wfmessage <- function(wf) {
message(glue(
"Follow workflow status at:\n",
"http://localhost:8000/pecan/05-running.php?",