|
1 | | -# Project Overview |
| 1 | +# HyPlan |
2 | 2 |
|
3 | | -HyPlan is an open-source Python library for planning airborne remote sensing campaigns. |
| 3 | +An open-source Python library for planning airborne remote sensing campaigns. |
4 | 4 |
|
5 | | ---- |
6 | | - |
7 | | -## Repository Contents |
8 | | - |
9 | | -### Core Modules |
10 | | - |
11 | | -- **airports.py**: Functions for locating and analyzing nearby airports for mission logistics. |
12 | | -- **sun.py**: Functions to calculate solar position for mission planning. |
13 | | -- **glint.py**: Functions to predict solar glint angles based on sensor view angles and solar position. |
14 | | -- **flight_line.py**: Functions to generate and modify flight lines. |
15 | | -- **flight_box.py**: Functions for generating multiple flight lines that cover a geographic area. |
16 | | -- **sensors.py**: Defines sensor characterisitics. |
17 | | -- **terrain.py**: Functions for downloading terrain DEM data and calculating where the sensor field of view intersects the ground. |
18 | | -- **swath.py**: Functions to compute swath coverage based on sensor field of view, altitude, and terrain elevation. |
19 | | -- **geometry.py**: Utility functions for geometric calculations essential to flight planning and sensor modeling. |
20 | | -- **units.py**: Utility functions for unit conversions and handling. |
21 | | -- **download.py**: Utility functions for downloading necessary datasets or dependencies. |
| 5 | +HyPlan helps scientists and engineers design flight missions for hyperspectral and multispectral remote sensing. It handles flight line generation, sensor modeling, swath coverage, solar glint prediction, cloud analysis, terrain-aware calculations, and mission logistics including airport selection and aircraft performance. |
22 | 6 |
|
| 7 | +## Features |
23 | 8 |
|
24 | | -### Configuration and Setup |
25 | | - |
26 | | -- **setup.py**: Script for installing the package. |
27 | | -- **pyproject.toml**: Build configuration file. |
28 | | -- **requirements.txt**: Lists Python dependencies for the project. |
29 | | -- **LICENSE.md**: Licensing details. |
30 | | - |
31 | | -### Documentation |
32 | | - |
33 | | -- **README.md**: Overview and instructions for the repository. |
| 9 | +- **Flight planning** — Define flight lines, generate multi-line coverage patterns, and compute complete mission plans with takeoff, transit, data collection, and landing segments |
| 10 | +- **Sensor modeling** — Pre-configured NASA instruments (AVIRIS-3, AVIRIS-NG, HyTES, PRISM, MASTER, and more) with ground sample distance and swath calculations |
| 11 | +- **Solar glint prediction** — Predict glint angles across flight lines for water observation missions |
| 12 | +- **Terrain-aware analysis** — Download DEM data and compute where the sensor field of view intersects the ground |
| 13 | +- **Cloud cover analysis** — Estimate clear-sky probability from MODIS imagery via Google Earth Engine |
| 14 | +- **Aircraft performance** — Pre-configured aircraft models (NASA ER-2, G-III, B200, and others) with climb/cruise/descent calculations |
| 15 | +- **Airport logistics** — Search and filter airports by location, runway length, and other criteria |
| 16 | +- **Geospatial export** — Output to GeoJSON, KML, and interactive Folium maps |
34 | 17 |
|
35 | 18 | --- |
36 | 19 |
|
37 | 20 | ## Installation |
38 | 21 |
|
39 | | -To set up the environment, clone the repository and install the dependencies: |
| 22 | +### Option 1: pip |
40 | 23 |
|
41 | 24 | ```bash |
42 | | -# Clone the repository |
43 | 25 | git clone https://github.com/ryanpavlick/hyplan |
44 | 26 | cd hyplan |
45 | | - |
46 | | -# Install dependencies |
47 | | -pip uninstall -y hyplan; pip install -e . |
| 27 | +pip install -e . |
48 | 28 | ``` |
49 | 29 |
|
50 | | -Or using conda/mamba, e.g. to create a new environment and install the dependencies |
| 30 | +### Option 2: conda/mamba |
51 | 31 |
|
52 | | -``` |
53 | | -# Assuming you have downloaded the repo, run the following outside of the repo folder |
54 | | -mamba deactivate |
| 32 | +```bash |
55 | 33 | mamba env create --file hyplan/hyplan.yml |
56 | 34 | mamba activate hyplan-env |
57 | 35 | pip install -e hyplan |
58 | 36 | ``` |
59 | | -This will create a new conda environment names "hyplan" with the dependencies and install the hyplan library within that environment |
60 | 37 |
|
61 | 38 | --- |
62 | 39 |
|
63 | | -## Usage |
| 40 | +## Quick Start |
64 | 41 |
|
65 | | -### Example: Planning a Flight Mission |
| 42 | +### Define a flight line |
66 | 43 |
|
67 | | -Need to add material here |
| 44 | +```python |
| 45 | +from hyplan.flight_line import FlightLine |
| 46 | +from hyplan.units import ureg |
68 | 47 |
|
69 | | -## Contributing |
| 48 | +flight_line = FlightLine.start_length_azimuth( |
| 49 | + lat1=34.05, lon1=-118.25, |
| 50 | + length=ureg.Quantity(50000, "meter"), |
| 51 | + az=45.0, |
| 52 | + altitude=ureg.Quantity(1000, "meter"), |
| 53 | + site_name="LA Northeast", |
| 54 | +) |
| 55 | +``` |
70 | 56 |
|
71 | | -Contributions are welcome! If you have suggestions or find issues, please open an issue or submit a pull request. |
| 57 | +### Compute a flight plan |
| 58 | + |
| 59 | +```python |
| 60 | +from hyplan.aircraft import DynamicAviation_B200 |
| 61 | +from hyplan.airports import Airport |
| 62 | +from hyplan.flight_plan import compute_flight_plan, plot_flight_plan |
| 63 | + |
| 64 | +aircraft = DynamicAviation_B200() |
| 65 | +departure = Airport("KSBA") |
| 66 | +destination = Airport("KBUR") |
| 67 | + |
| 68 | +plan = compute_flight_plan(aircraft, [flight_line], departure, destination) |
| 69 | +plot_flight_plan(plan, departure, destination, [flight_line]) |
| 70 | +``` |
| 71 | + |
| 72 | +### Predict solar glint |
| 73 | + |
| 74 | +```python |
| 75 | +from datetime import datetime, timezone |
| 76 | +from hyplan.sensors import AVIRIS3 |
| 77 | +from hyplan.glint import compute_glint_vectorized |
| 78 | + |
| 79 | +sensor = AVIRIS3() |
| 80 | +obs_time = datetime(2025, 2, 17, 18, 0, tzinfo=timezone.utc) |
| 81 | + |
| 82 | +gdf = compute_glint_vectorized(flight_line, sensor, obs_time) |
| 83 | +gdf.to_file("glint_results.geojson", driver="GeoJSON") |
| 84 | +``` |
72 | 85 |
|
73 | 86 | --- |
74 | 87 |
|
75 | | -## License |
| 88 | +## Modules |
| 89 | + |
| 90 | +| Module | Description | |
| 91 | +|--------|-------------| |
| 92 | +| `flight_line` | Create, modify, split, clip, and export individual flight lines | |
| 93 | +| `flight_box` | Generate parallel flight lines covering a geographic area | |
| 94 | +| `flight_plan` | Compute complete mission plans with timing and altitude profiles | |
| 95 | +| `aircraft` | Aircraft performance models (NASA ER-2, G-III, B200, and others) | |
| 96 | +| `sensors` | Sensor definitions (AVIRIS-3, AVIRIS-NG, HyTES, PRISM, MASTER, etc.) | |
| 97 | +| `frame_camera` | Frame camera modeling with ground footprint calculations | |
| 98 | +| `glint` | Solar glint angle prediction for water observations | |
| 99 | +| `swath` | Sensor swath coverage with terrain integration | |
| 100 | +| `terrain` | DEM data acquisition and ray-terrain intersection | |
| 101 | +| `sun` | Solar position and timing calculations | |
| 102 | +| `clouds` | Cloud cover analysis and clear-sky probability from MODIS | |
| 103 | +| `airports` | Airport database with search, filtering, and runway data | |
| 104 | +| `dubins_path` | Minimum-radius turning trajectories between waypoints | |
| 105 | +| `geometry` | Geospatial utilities (haversine, coordinate transforms, polygons) | |
| 106 | +| `units` | Unit conversions using Pint (meters, feet, knots, etc.) | |
| 107 | +| `plotting` | Interactive Folium map generation | |
| 108 | +| `download` | File download with caching and retry | |
| 109 | + |
| 110 | +--- |
76 | 111 |
|
77 | | -HyPlan is licensed under the Apache License, Version 2.0. See the `LICENSE.md` file for details. |
| 112 | +## Examples |
| 113 | + |
| 114 | +The `examples/` directory contains runnable scripts demonstrating each module: |
| 115 | + |
| 116 | +- `test_flight_line.py` — Flight line creation, clipping, rotation, splitting |
| 117 | +- `test_flight_box.py` — Multi-line coverage patterns |
| 118 | +- `test_flight_plan.py` — Full mission planning with airports |
| 119 | +- `test_aircraft.py` — Aircraft performance calculations |
| 120 | +- `test_sensors.py` — Sensor instantiation and GSD calculations |
| 121 | +- `test_glint.py` — Solar glint prediction and visualization |
| 122 | +- `test_swath.py` — Swath polygon generation |
| 123 | +- `test_terrain.py` — DEM handling and ray-terrain intersection |
| 124 | +- `test_sun.py` — Solar position calculations |
| 125 | +- `test_clouds.py` — Cloud cover analysis |
| 126 | +- `test_airports.py` — Airport search and filtering |
| 127 | +- `test_dubins.py` — Dubins path trajectories |
| 128 | +- `test_frame_camera.py` — Frame camera footprint calculations |
| 129 | +- `test_geometry.py` — Geometric utilities |
| 130 | +- `test_units.py` — Unit conversions |
78 | 131 |
|
79 | 132 | --- |
80 | 133 |
|
| 134 | +## Contributing |
| 135 | + |
| 136 | +Contributions are welcome! If you have suggestions or find issues, please open an issue or submit a pull request. |
| 137 | + |
| 138 | +## License |
| 139 | + |
| 140 | +HyPlan is licensed under the Apache License, Version 2.0. See `LICENSE.md` for details. |
| 141 | + |
81 | 142 | ## Contact |
82 | 143 |
|
83 | 144 | For inquiries or further information, please contact Ryan Pavlick (ryan.p.pavlick@nasa.gov). |
0 commit comments