{"id":13798690,"url":"https://github.com/junzis/openap-top","last_synced_at":"2025-06-23T02:07:32.977Z","repository":{"id":37779165,"uuid":"477631709","full_name":"junzis/openap-top","owner":"junzis","description":"easy-peasy optimal flight trajectory","archived":false,"fork":false,"pushed_at":"2025-06-11T21:36:43.000Z","size":8536,"stargazers_count":31,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-11T22:41:05.638Z","etag":null,"topics":["casadi","contrail","fuel","optimization","wind"],"latest_commit_sha":null,"homepage":"https://openap.dev/optimize","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junzis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-04T09:27:21.000Z","updated_at":"2025-06-11T21:36:47.000Z","dependencies_parsed_at":"2023-11-21T22:28:13.066Z","dependency_job_id":"51799856-2acd-483b-ae1f-b22a8d3b28c0","html_url":"https://github.com/junzis/openap-top","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/junzis/openap-top","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junzis%2Fopenap-top","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junzis%2Fopenap-top/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junzis%2Fopenap-top/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junzis%2Fopenap-top/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junzis","download_url":"https://codeload.github.com/junzis/openap-top/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junzis%2Fopenap-top/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261397374,"owners_count":23152490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["casadi","contrail","fuel","optimization","wind"],"created_at":"2024-08-04T00:00:49.970Z","updated_at":"2025-06-23T02:07:27.962Z","avatar_url":"https://github.com/junzis.png","language":"Python","funding_links":[],"categories":["Tools and Libraries"],"sub_categories":[],"readme":"# OpenAP Trajectory Optimizer\n\nThis repository contains the flight trajectory optimizer module based on the [OpenAP](https://github.com/junzis/openap) package. \n\nThis tool uses non-linear optimal control direct collocation algorithms from the `casadi` library. It provides simple interfaces to generate different optimal trajectories. For example, this tool can generate any of the following trajectories (or combinations thereof):\n\n- Complete flight trajectories or flight segments at different flight phase\n- Fuel-optimal trajectories\n- Wind-optimal trajectories\n- Cost index optimized trajectories\n- Trajectories optimized using customized 4D cost functions (contrails, weather)\n- Flight trajectories with constraint altitude, constant mach number, etc.\n\nWhat's more, you can also design your own objective functions and constraints to optimize the flight trajectory.\n\n\n## 🕮 User Guide\n\nA more detailed user guide is available in the OpenAP handbook: \u003chttps://openap.dev/optimize\u003e.\n\n\n## Install\n\n1. Install from PyPI:\n\n```sh\npip install --upgrade openap-top\n```\n\n2. Install the development branch from GitHub (also ensures the development branch of `openap`):\n\n```sh\npip install --upgrade git+https://github.com/junzis/openap\npip install --upgrade git+https://github.com/junzis/openap-top\n```\n\nThe `top` package is an extension of `openap` and will be placed in the `openap` namespace.\n\n## Quick Start\n\n### A simple optimal flight\n\nThe following is a piece of example code that generates a fuel-optimal flight between two airports, with a take-off mass of 85% of MTOW:\n\n```python\nfrom openap import top\n\noptimizer = top.CompleteFlight(\"A320\", \"EHAM\", \"LGAV\", m0=0.85)\n\nflight = optimizer.trajectory(objective=\"fuel\")\n```\n\nOther predefined objective functions are available, for example:\n\n```python\n# Cost index 30 (out of max 100)\nflight = optimizer.trajectory(objective=\"ci:30\") \n\n# Global warming potential over 100 years\nflight = optimizer.trajectory(objective=\"gwp100\")\n\n# Global temperature potential over 100 years\nflight = optimizer.trajectory(objective=\"gtp100\") \n```\n\nThe final `flight` object is a Pandas DataFrame. Here is an example:\n\n![example_optimal_flight](./docs/_static/flight_dataframe.png)\n\n### Using Wind Data\n\nTo include wind in our optimization, first download meteorological data in `grib` format from ECMWF, such as the ERA5 reanalysis data.\n\nOnce grid files are ready, we can read and enable wind for our optimizer with this example code:\n\n```python\nfrom openap import top\n\n\nfgrib = \"path_to_the_wind_data.grib\"\nwindfield = top.tools.read_grids(fgrib)\n\noptimizer = top.CompleteFlight(\"A320\", \"EHAM\", \"LGAV\", m0=0.85)\noptimizer.enable_wind(windfield)\n\nflight = optimizer.trajectory() # default objective is fuel\n```\n\nNext, we can visualize the trajectory with wind barbs:\n\n```\ntop.vis.trajectory(flight, windfield=windfield, barb_steps=15)\n```\n\n![example_optimal_flight](./docs/_static/optimal_flight_complete_example.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunzis%2Fopenap-top","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunzis%2Fopenap-top","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunzis%2Fopenap-top/lists"}