Skip to content

Instantly share code, notes, and snippets.

View RichardScottOZ's full-sized avatar

RichardScottOZ

  • Australia
View GitHub Profile

raster from multiple sources, disparate grid specs

This FlatGeoBuf file contains two polygon footprints, one is a northern hemisphere sea-ice concentration GeoTIFF image, the other southern (the values are scaled from 0-100% and stored with a palette, but we're just using the raw integer value here)

https://github.com/mdsumner/gti/raw/refs/heads/main/inst/extdata/tmerc_seaice.fgb

The source GeoTIFFs are in NSIDC south Polar Stereographic, and north Polar Stereographic as is standard. We use GTI format to register these as disparate data sources within a latent raster frame for rendering at a later time. We could store all the daily sea ice files this way, with an index on field 'date', so we could coalesce to a particular date (or set of dates, for examples like Sentinel scenes).

@kwinkunks
kwinkunks / AI_image_analysis_for_geoscience_v0.2.ipynb
Last active November 5, 2024 13:55
AI image analysis for geoscience
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ljstrnadiii
ljstrnadiii / reproject_resample.py
Last active November 2, 2024 06:08
Resample/Reproject Cogs w/ Dask + Rioxarray
import logging
import subprocess as sp
import tempfile
import threading
import geopandas as gpd
import numpy as np
import rioxarray
import xarray as xr
from rasterio.enums import Resampling
@crasm
crasm / gguf-merge.sh
Last active August 17, 2024 01:12
Shell script for merging TheBloke's .gguf-split model files
#!/bin/sh
log() {
format="$1"; shift
# shellcheck disable=SC2059
>&2 printf "$format\n" "$@"
}
usage() {
>&2 cat <<EOF
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active February 18, 2025 18:02
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@derrickturk
derrickturk / view_grid.py
Created May 2, 2023 19:42
View SMT Kingdom .GRD data (WIP)
# Copyright (c) 2023 Derrick W. Turk / terminus, LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
@claysauruswrecks
claysauruswrecks / requirements.txt
Last active April 7, 2024 16:32
Example using LlamaHub loaders to index Github repos into LlamaIndex and query GPTSimpleVectorIndex with GPT-4
# main
llama-index
langchain
@johnwbryant
johnwbryant / extract_aus.sh
Last active September 17, 2024 01:18
Extract Australia data in a usable format from Microsoft road detections data
#!/bin/bash
# see https://github.com/microsoft/RoadDetections
# 1) get the data
wget https://usaminedroads.blob.core.windows.net/road-detections/Oceania-Full.zip
# 2) extract the records for Australia, second column of tsv only
zgrep AUS Oceania-Full.zip | cut -f2 > AUS.geojson
# 3) convert to GPKG, works better in QGIS
@wandy-dev
wandy-dev / askgpt.sh
Last active January 4, 2023 19:58
GPT chat bot for the terminal.
#!/bin/bash
api_call() {
curl --no-progress-meter https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d "{
\"model\": \"text-davinci-003\",
\"prompt\": \"$@\",
\"temperature\": 0,
@mtsokol
mtsokol / FACET_PyData_Global_2022.ipynb
Created December 2, 2022 10:42
Notebook for FACET demo - PyData Global 2022
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.