Comments (5)
Hi David, did you solve your problem? For me I can generate the aircraft at Concord using your setting.
from datetime import datetime
from pathlib import Path
from airtrafficsim.core.environment import Environment
from airtrafficsim.core.aircraft import Aircraft
from airtrafficsim.utils.enums import Config, FlightPhase
class demo_2(Environment):
def __init__(self):
# Initialize environment super class
super().__init__(file_name=Path(__file__).name.removesuffix('.py'), # File name (do not change)
start_time=datetime.fromisoformat(
'2022-03-22T00:00:00+00:00'),
end_time=1000,
weather_mode="",
performance_mode="BADA"
)
# Add aircraft
self.aircraft_head = Aircraft(self.traffic, call_sign="GHOST", aircraft_type="C25C", flight_phase=FlightPhase.CRUISE, configuration=Config.CLEAN, lat=43.223267, long=-71.631273, alt=5000.0, heading=175.0, cas=250.0, fuel_weight=10000.0, payload_weight=12000.0)
def should_end(self):
return False
from airtrafficsim.
Good morning,
I copied your code verbatim and it produced the same error:
query_results = map_index_queries(
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/airtrafficsim/lib/python3.11/site-packages/xarray/core/indexing.py", line 190, in map_index_queries
results.append(index.sel(labels, **options))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/airtrafficsim/lib/python3.11/site-packages/xarray/core/indexes.py", line 498, in sel
raise KeyError(f"not all values found in index {coord_name!r}")
KeyError: "not all values found in index 'longitude'"
I am using the 0.1.0 conda version. Is there a more recent version that doesn't have this behavior?
from airtrafficsim.
As I checked your error, I believe you install the conda "airtrafficsim" package in your "base" environment of conda, which creates conflicts between packages. You should follow the readme in our mainpage (https://github.com/HKUST-OCTAD-LAB/AirTrafficSim), which you could try to create an individual environment for "airtrafficsim".
Then you need to put the demo_2 script under the correct directory. The directory for new demos should be
"Your_root_address_for_anaconda"/anaconda3/envs/airtrafficsim/lib/python3.11/site-packages/airtrafficsim/data/environment/
from airtrafficsim.
Good morning,
Your example works when I save it to a new file. It does not work when I add it to my existing file. So, the error is on my end and not in the code.
Thank you for helping me sort through this.
from airtrafficsim.
Try setting:
weather_mode="ERA5",
in your code. When I do this, it throws the reported error.
Changing "ERA5" back to "" fixes the problem.
from airtrafficsim.
Related Issues (15)
- UI rework
- New performance model: OpenAP
- Weather data
- VNAV and Top of Descent
- Airways detection
- Adjustable simulation timestep
- Add tests
- Simulation button in UI fails to load data
- Clarify statement in paper
- Map sometimes fails to render
- Instructions on how to add BADA data HOT 1
- Docstring completeness and format
- Add contribution guidelines in main folder
- Bada 3.15 files - what to download? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airtrafficsim.