Giter Club home page Giter Club logo

Comments (5)

harrylui1995 avatar harrylui1995 commented on June 19, 2024

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

concord

from airtrafficsim.

kovar-ursa avatar kovar-ursa commented on June 19, 2024

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.

harrylui1995 avatar harrylui1995 commented on June 19, 2024

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.

kovar-ursa avatar kovar-ursa commented on June 19, 2024

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.

kovar-ursa avatar kovar-ursa commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.