---
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-20240827a
takeoff: "2024-08-26 18:00:00Z"
landing: "2024-08-26 21:30:00Z"
departure_airport: GVAC
arrival_airport: GVAC
crew:
  - name: Guillaume Seurat
    job: Pilot
  - name: Dominique Duchanoy
    job: Pilot
  - name: Thierry André
    job: Mechanics
  - name: Claude Lainard
    job: Expé Principal
  - name: Hubert Bellec
    job: Expé 
  - name: Sandrine Bony
    job: PI
  - name: Emmeline François
    job: LNG
  - name: Frédéric Laly
    job: aWALI
  - name: Pierre Coutris
    job: Microphys 1
  - name: Alfons Schwarzenboeck
    job: Microphys 2
  - name: Julien Delanoë
    job: RASTA
  - name: Giovanni Biagioli
    job: BASTA
categories: [c_atr, sar_under, meteor]
orphan: true
---

{logo}`MAESTRO`

# 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.
* Flight track designed for coordination with HALO, RV Meteor, and the SAR instrument on the RCM1 satellite
* Due to the increased length of the legs, only two flight levels will be flown: within the subcloud layer and at about FL200.

```{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, 25, 12, 0, 0)
date_time_str = date_time.strftime('%Y-%m-%d')
flight_time = datetime(2024, 8, 27, 12, 0, 0)

radius = 70e3 # units: km
circle_atr = LatLon(lat=14.5, lon=-22.5, label="circle_atr")
halo_circle = IntoCircle(circle_atr, radius, 360)
rv_meteor = LatLon(lat=13,lon=-23.5, label="rv_meteor")

airport = sal
wp1 = LatLon(lat=16.2040000, lon=-22.5000000, label='wp1')
wp2 = LatLon(lat=13.3860000, lon=-22.5000000, label='wp2')

path = [airport, wp1, wp2, wp1, 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")
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'))

ax.scatter(rv_meteor.lon, rv_meteor.lat, color="tab:orange")
ax.text(rv_meteor.lon+0.08, rv_meteor.lat, color="tab:orange", s='rv_meteor', bbox=dict(facecolor='white',edgecolor='white', boxstyle='round,pad=0.1'))

ax.set_extent([-24, -21, 12.8, 17])

plot_cwv(cwv_flight_time)


```
<!-- ![Flight Levels](./LEVELS-ATR-20240826a.jpg) -->

<!-- * SAFIRE Flight Plan submitted to Air Traffic Control (ATC)

![Page 1](./SAFIRE-ATR-20240813b.png) -->

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

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

## Crew

```{crew}
```