Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add func to load flight segmentation info #105

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions orcestra/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .flightplan import LatLon, bco, sal
from .utils import parse_datestr
from .utils import parse_datestr, get_flight_segments
from .io import read_igi, read_bahamas_100hz

import warnings
Expand All @@ -14,4 +14,12 @@
module="intake_xarray",
)

__all__ = ["LatLon", "bco", "sal", "parse_datestr", "read_igi", "read_bahamas_100hz"]
__all__ = [
"LatLon",
"bco",
"sal",
"parse_datestr",
"get_flight_segments",
"read_igi",
"read_bahamas_100hz",
]
11 changes: 11 additions & 0 deletions orcestra/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import xarray as xr
import matplotlib.pyplot as plt
import yaml
import fsspec


def parse_datestr(datestr):
Expand Down Expand Up @@ -100,3 +101,13 @@ def export_planet(fname, fig=None, dpi=144, stem_ext="_planet", **kwargs):
},
**kwargs,
)


@lru_cache
def get_flight_segments():
flight_segment_file = (
"https://orcestra-campaign.github.io/flight_segmentation/all_flights.yaml"
)
with fsspec.open(flight_segment_file) as f:
meta = yaml.safe_load(f)
return meta
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cartopy = "*"
cmocean = "*"
easygems = ">=0.0.8"
flox = "*" # part of xarray[accel]
fsspec = "*"
geopandas = "*"
gpxpy = "*"
healpix = "*"
Expand Down
Loading