---
jupytext:
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.12
    jupytext_version: 1.7.1
kernelspec:
  display_name: Python 3
  language: python
  name: python3
platform: HALO
flight_id: HALO-20240809b
takeoff: "2024-08-09 09:30:00Z"
landing: "2024-08-09 16:30:00Z"
departure_airport: EDJA
arrival_airport: GVAC
crew:
  - name: Florian Ewald
    job: PI
  - name: Martin Wirth
    job: WALES
  - name: Clara Bayley
    job: HAMP
  - name: Helene Glöckner
    job: Dropsondes
  - name: Kevin Wolf
    job: Smart/VELOX
  - name: Lea Volkmer
    job: SpecMACS
  - name: Christian Heske
    job: Scientist
  - name: tbd
    job: Ground contact
categories: []
orphan: true
---

{logo}`PERCUSION`

# Flight plan - {front}`flight_id`

```{badges}
```

## Crew

The flight is planned to take off at {front}`takeoff`.

```{crew}
```

## Flight plan

```{code-cell} python3
:tags: [hide-input]
from orcestra.flightplan import sal, bco, LatLon, IntoCircle, path_preview, plot_cwv
from datetime import datetime
import intake

cat = intake.open_catalog("https://tcodata.mpimet.mpg.de/internal.yaml")

date_time = datetime(2024, 8, 6, 12, 0, 0)
date_time_str = date_time.strftime('%Y-%m-%d')

flight_time = datetime(2024, 8, 9, 12, 0, 0)

radius = 100e3

airport = sal
north = LatLon(lat=15.529, lon=-24.982, label='north')
south = LatLon(lat=2.586, lon=-27.440, label='south')
edge_south = LatLon(lat=5.0, lon=-26.996, label='circle_south')
center = LatLon(lat=8.251, lon=-26.389, label='circle_center')
edge_north = LatLon(lat=11.5, lon=-25.772, label='circle_north')
mindelo = LatLon(lat=16.891, lon=-25.006, label='mindelo')
esp = LatLon(lat=28.300, lon=-16.000, label='esp')
limal = LatLon(lat=25.000, lon=-17.500, label='limal')
isoka = LatLon(lat=22.100,  lon=-19.500,label='isoka')
bulvo = LatLon(lat=14.000,  lon=-24.500,label='bulvo')
cpvx1 = LatLon(lat=17.000,  lon=-22.700,label='cpvx1')
dimik = LatLon(lat=17.800,  lon=-22.250,label='dimik')
cpve1 = LatLon(lat=14.633,  lon=-24.150,label='cpve1')

leg_south = [
     esp, 
     limal,
     isoka,
     bulvo,
     cpvx1,
     dimik,
     cpve1,
     airport
]

path = leg_south  

ds = cat.HIFS(refdate=date_time_str, reftime=date_time.hour).to_dask()
cwv_flight_time = ds["tcwv"].sel(time=flight_time, method = "nearest")

ax = path_preview(path)
plot_cwv(cwv_flight_time)


```

```{code-cell} python3
:tags: [hide-input]
import pandas as pd
from dataclasses import asdict

pd.DataFrame.from_records(map(asdict, [limal,bulvo,dimik,airport])).set_index("label")

```
* After takeoff, fly to south of Canary Island (*limal*)
* Fly towards Sal and drop 3 dropsondes along the path 
* If last dropsonde is still in the air continue south of Sal and return when DS landed (*bulvo*)
* Return to Sal

```{code-cell} python3
:tags: [hide-input]
from orcestra.flightplan import export_flightplan

export_flightplan("HALO-20240809a", path)
```
