Skip to content

Instantly share code, notes, and snippets.

View luabida's full-sized avatar
🌙
路安

Luã B. Vacaro luabida

🌙
路安
  • FGV Rio
  • Brazil
  • 02:55 (UTC -03:00)
View GitHub Profile
@blaylockbk
blaylockbk / nearest_latlon_index.py
Created July 27, 2020 20:28
I often have xarray datasets with latitude and longitude coordinates (not as xarray dimensions). When I need to pluck values from a point nearest to a specific lat/lon coordinate (like a weather station), this is what I use...
import numpy as np
import xarray as xr
def to_180(lon):
"""
Wrap longitude from degrees [0, 360] to degrees [-180, 180].
An alternative method is
lon[lon>180] -= 360
@gitaarik
gitaarik / git_submodules.md
Last active April 22, 2025 19:46
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.