---
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: ATR
flight_id: ATR-20240811a
takeoff: "2024-08-11 14:30:00Z"
landing: "2024-08-11 18:00:00Z"
departure_airport: GVAC
arrival_airport: GVAC
crew:
  - name: Guillaume Seurat
    job: Pilot
  - name: Jean-François Bourdinot 
    job: Pilot
  - name: Thierry André
    job: Mechanics
  - name: Tania Jiang
    job: Expé Principal
  - name:  Cyril de St Léger
    job: Expé 
  - name: Marie Lothon
    job: PI
  - name: Sophie Bounissou
    job: LNG
  - name: Patrick Chazette
    job: aWALI
  - name: Pierre Coutris
    job: Microphys 1
  - name: Thierry Latchimy
    job: Microphys 2
  - name: Julien Delanoë
    job: RASTA
  - name: Kevin Huet
    job: BASTA
orphan: true
categories: [ec_under, c_atr]

---

# Flight plan - {front}`flight_id`

```{badges}
```

## Flight plan
* The flight is planned to take off at {front}`takeoff` UTC and land at {front}`landing` UTC.
* The HALO circle around the ATR-transects will be of radius 84.3 km centered at 17.75 N, 24.333 W.

```{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, 11, 12, 0, 0)

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, 11, 12, 0, 0)

radius = 83.3e3 # units: km
circle_atr = LatLon(lat=17.75, lon=-24.333, label="circle_atr")
halo_circle = IntoCircle(circle_atr, radius, 360)

airport = sal
wp1 = LatLon(lat=17.518611, lon=-24.519444, label='wp1')
wp2 = LatLon(lat=16.653611, lon=-24.779722, label='wp2')
meeting_pt = LatLon(lat=17.080278, lon=-24.695278, label='EC meeting pt')
wp3 = LatLon(lat=17.543056, lon=-24.603889, label='wp3')
wp4 = LatLon(lat=16.374444, lon=-24.948333, label='wp4')
wp5 = LatLon(lat=16.935, lon=-24.995556, label='wp5')

path = [airport, wp1, wp2, meeting_pt, wp3, wp4, wp5, airport]

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)
path_preview([circle_atr.course(0, radius), halo_circle], ax=ax)  # HACK: Add HALO circle
ax.scatter(circle_atr.lon, circle_atr.lat, color="tab:orange", label='HALO Circle')
ax.set_extent([-25.5, -21.8, 16, 18.7])
ax.text(circle_atr.lon+0.05, circle_atr.lat, color="tab:orange", s='HALO_Circle', bbox=dict(facecolor='white',edgecolor='white', boxstyle='round,pad=0.1'))

plot_cwv(cwv_flight_time)


```
* SAFIRE Flight Plan submitted to Air Traffic Control (ATC)

![Page 1](./SAFIRE-ATR-20240811a-1.jpg)
![Page 2](./SAFIRE-ATR-20240811a-2.jpg)

* See higher resolution pdf [here](./SAFIRE-ATR-20240811a.pdf). 


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

pd.DataFrame.from_records(map(asdict, path+[circle_atr])).set_index("label")
```

## Crew

```{crew}
```