---
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-20240811a
takeoff: "2024-08-11 12:00:00Z"
landing: "2024-08-11 21:00:00Z"
departure_airport: GVAC
arrival_airport: GVAC
crew:
  - name: Bjorn Stevens
    job: PI
  - name: Silke Gross
    job: WALES
  - name: Clara Bayley
    job: HAMP
  - name: Helene Glöckner
    job: Dropsondes
  - name: Anna Luebke
    job: Smart/VELOX
  - name: Veronika Pörtge 
    job: SpecMACS
  - name: Julia Windmiller
    job: Scientist
  - name: Divya Praturi
    job: Ground Support
categories: [ec_under, ec_track, c_north, c_mid, c_south, ec_south]
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, 9, 12, 0, 0)
date_time_str = date_time.strftime('%Y-%m-%d')

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

radius = 100e3

airport = sal
ec_north = LatLon(lat=15.529, lon=-24.982, label='ec_north')
ec_south = LatLon(lat=2.586, lon=-27.440, label='ec_south')
c_south = LatLon(lat=5.0, lon=-26.996, label='c_south')
c_mid = LatLon(lat=8.251, lon=-26.389, label='c_mid')
c_north = LatLon(lat=11.5, lon=-25.772, label='c_north')
mindelo = LatLon(lat=16.891, lon=-25.006, label='mindelo')

leg_south = [
     airport,
     ec_north,
     c_north,
     c_mid,
     c_south,
     ec_south
]

leg_circles = [
     IntoCircle(c_south, radius, 360),
     IntoCircle(c_mid, radius, 360),
     IntoCircle(c_north, radius, 360),
]
    
leg_home = [
     ec_north,
     mindelo,
     airport
]

path = leg_south + leg_circles + leg_home 

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, [ec_north, c_north, c_mid, c_south, ec_south])).set_index("label")
```
* 11:00 LT Take off … get on EarthCare Heading north of 14deg
* Drop first sonde at center of c_mid heading south
* Drop second sonde before starting Procedure turn (near 2.5 N, ec_south)
* 090 deg enter c_south (CCW) from south
* 270 deg exit to EC track
* meet EC along track (not after 1550 UT) 8.25 N and 26.39 W
* 270 deg enter c_mid (CW) from north
* 90 deg exit to EC track
* 90 deg enter c_north (CCW) fro south
* 90 deg exit c_north to EC track
* Descend to FL350 before passing over Mindelo to N point of c_atr
* 270 deg enter c_atr (CW)

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

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