This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/usr/bin/env bash | |
| set -e | |
| set -x | |
| # Check if INSTALL_PREFIX is set; otherwise, error | |
| if [ -z "$INSTALL_PREFIX" ]; then | |
| echo "INSTALL_PREFIX is not set" | |
| echo "Example usage: INSTALL_PREFIX='~/.local/bin' bash $0" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| import re | |
| from pathlib import Path | |
| from typing import Union | |
| import pandas as pd | |
| import xarray as xr | |
| Filename = Union[str, Path] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # pip install requests rich beautifulsoup4 | |
| import sys | |
| import requests | |
| from bs4 import BeautifulSoup | |
| from rich.console import Console | |
| from rich.panel import Panel | |
| URL = "https://dailytao.org/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import argparse | |
| from pathlib import Path | |
| def split_file(filename: str | Path, lines_per_file: int, output_prefix: str): | |
| """Split a text file into multiple files. | |
| Parameters | |
| ---------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from concurrent.futures import ThreadPoolExecutor | |
| def get_s3_direct_urls( | |
| safe_names: list[str], max_workers: int = 5 | |
| ) -> str | None: | |
| """Get the S3 urls for a list of SAFE granules.""" | |
| def _get_url(safe_name): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import time | |
| from pathlib import Path | |
| import h5py | |
| import numpy as np | |
| from dolphin import io | |
| class GDALStackReader: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| from pathlib import Path | |
| from compass.utils import helpers | |
| from shapely import geometry | |
| import numpy as np | |
| import s1reader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dolphin.io import load_gdal, get_raster_xysize, get_raster_nodata, get_raster_dtype, get_raster_chunk_size | |
| class GDALReader: | |
| # https://docs.dask.org/en/stable/generated/dask.array.from_array.html | |
| def __init__(self, filename, masked=True): | |
| self.filename = filename | |
| self._shape = get_raster_xysize(filename)[::-1] | |
| self._nodata = get_raster_nodata(filename) | |
| self._masked = masked | |
| self._dtype = get_raster_dtype(filename) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import annotations | |
| import datetime | |
| from typing import Optional, Any | |
| import h5netcdf | |
| import h5py | |
| import numpy as np | |
| import pyproj |