Skip to content

Instantly share code, notes, and snippets.

from osgeo import gdal, osr
from nisar.products.readers import open_product
# get the data bands
gcov = open_product('NISAR_L2_PR_GCOV_045_107_A_031_4005_DHDH_A_20240621T144514_20240621T144551_T00410_N_F_J_001.h5')
hhhh = gcov.getImageDataset(frequency='A', polarization='HHHH')
hvhv = gcov.getImageDataset(frequency='A', polarization='HVHV')
# compute your RGB pixel values here
red = hhhh[:,:]
@scottstanie
scottstanie / show_h5_sizes.py
Created December 4, 2023 21:03
Pretty print the size on disk + compression ratio of HDF5 datasets with h5py and rich
#!/usr/bin/env python
# requirements: h5py, rich
import sys
import h5py
from rich.console import Console
from rich.table import Table
def _get_object_metadata(obj) -> tuple[str, float, float] | None:
@dmccreary
dmccreary / find-big-images-in-ppt-file.sh
Last active December 13, 2025 00:00
Find big images in PowerPoint
#!/bin/sh
# this program has been updated to list both the images and the largest images and the slide numbers together
# get the parameter
echo "working on" "$1"
rm -r /tmp/big-images 2> /dev/null
mkdir /tmp/big-images
# copy the ppt file to /tmp
cp "$1" /tmp/big-images
# rename it to be .zip
mv "/tmp/big-images/$1" "/tmp/big-images/$1.zip"
@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
@ajelenak
ajelenak / cloud-access-to-hdf5.ipynb
Last active December 16, 2025 23:25
Access HDF5 Files in S3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ritaqk
Ritaqk / cloudSettings_old
Last active August 5, 2020 18:06
RitaqkVSCode
{"lastUpload":"2020-08-05T17:57:14.476Z","extensionVersion":"v3.4.3"}
@kwinkunks
kwinkunks / README.md
Last active November 15, 2025 17:31
Matplotlib colourmaps for QGIS

mpl2qgis

See script below.

Make sure the Python file is executable. Then:

$ ./mpl2qgis.py viridis bone

This writes a file colourmaps.xml. Result:

@lucwj
lucwj / install_cuda.md
Created June 30, 2017 07:01
Install TensorFlow CentOS

Verify You Have a CUDA-Capable GPU

To verify that your GPU is CUDA-capable, go to your distribution's equivalent of System Properties, or, from the command line, enter:

lspci | grep -i nvidia

If you do not see any settings, update the PCI hardware database that Linux maintains by entering update-pciids (generally found in /sbin) at the command line and rerun the previous lspci command.

If your graphics card is from NVIDIA and it is listed in CUDA-GPUS, your GPU is CUDA-capable.

@aiguofer
aiguofer / README.md
Last active April 27, 2023 19:12
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.
@lmarkus
lmarkus / README.MD
Last active January 27, 2026 19:27
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...