Skip to content

Instantly share code, notes, and snippets.

View betolink's full-sized avatar

Luis López betolink

View GitHub Profile

Comparing v006 and v007 ATL03 Reads

Overview

When using equivalent methods the read times of v007 and v006 data are similar, with v007 being slightly faster. For both v006 and v007 data using the blocksize fsspec parameter results is a substantial speedup.

Methods

Ten v007 ATL03 files of varying file size were compared for read speeds on Cryocloud (AWS us-west-2 based Jupyter Hub) using one group of data (gt1l) using the h5py Python library. The h_ph variable as well as three relevant coordinate variables (lat_ph, lon_ph, and delta_time) were read. Times shown are the mean time of 6 independent reads. Error bars show the standard deviation of those times. All files were read 7 times. The first read was not included in the averages because it often was much slower than the subsequent reads (often 2x slower), likely due to an optimization technique from s3 that speeds up sequential reads. Additionally, each file was read 6 times consecutively prior to beginning timed reads, to decrease the effect of a

@s-kganz
s-kganz / profile_earthaccess.py
Created May 16, 2025 23:01
Script to recreate open_rasterio leak on HLSL30 granules
import xarray as xr
import rasterio
import rioxarray
import gc
import earthaccess
assert(earthaccess.login(strategy="netrc").authenticated)
# Find a granule, load it into memory, take mean, call gc
gdal_config = {
@rauchg
rauchg / p.sh
Last active July 16, 2025 11:22
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@ajelenak
ajelenak / h5stat-extra.py
Last active October 7, 2025 19:29
Additional HDF5 dataset chunk statistics
import argparse
import json
import operator
from collections import defaultdict
from dataclasses import dataclass
from functools import partial, reduce
import os
from typing import Any, Union
from configparser import ConfigParser
from pathlib import Path
@MarcSkovMadsen
MarcSkovMadsen / hvplot_interactive.py
Last active January 3, 2023 20:12
Example of using hvPlot .interactive with Panel
import pandas as pd
import hvplot.pandas
import panel as pn
pn.extension(sizing_mode="stretch_width")
PALETTE = [
"#ff6f69",
"#ffcc5c",
"#88d8b0",
@the-spyke
the-spyke / pipewire.md
Last active October 12, 2025 21:34
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@aleixmorgadas
aleixmorgadas / 1. Fallacies.md
Last active October 2, 2021 04:53
Distributed Systems Fundamentals Questions

Fallacy #1. The network is reliable

  • Why the pattern Client-Response might cause some troubles?
  • What are distributed objects?
  • How we can solve this problem?

Fallacy #2. Latency isn't a problem

  • How many calls do you do between services before replying a syncronous call to the end user?
  • Which pattern is more common in your application? Remote calls or messages?
@wolfv
wolfv / github_actions.yaml
Last active August 15, 2025 11:04
micromamba usage
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
@ajelenak
ajelenak / h5-to-zarr.py
Last active March 29, 2025 23:01
Python code to extract HDF5 chunk locations and add them to Zarr metadata.
# Requirements:
# HDF5 library version 1.10.5 or later
# h5py version 3.0 or later
# pip install git+https://github.com/HDFGroup/zarr-python.git@hdf5
import logging
from urllib.parse import urlparse, urlunparse
import numpy as np
import h5py
import zarr
@pdp7
pdp7 / BeagleBone: sharing Internet connection from Linux laptop with USB.md
Last active September 14, 2025 17:09
BeagleBone: sharing Internet connection from Linux laptop with USB

WARNING: interfaces can enumarate differently:

ufw status
#iptables -F
#iptables --table nat --append POSTROUTING --out-interface wlxe0b94db737c9 -j MASQUERADE
#iptables --table nat --append POSTROUTING --out-interface enp0s20u1u1 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface enp0s20u1u2 -j MASQUERADE
#iptables --append FORWARD --in-interface enx1cba8c9bbeb5 -j ACCEPT
#iptables --append FORWARD --in-interface enx9884e391a556 -j ACCEPT
iptables --append FORWARD --in-interface enx9884e391a559 -j ACCEPT