Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix Weather data #127

Merged
merged 15 commits into from
Feb 3, 2025
Merged

Bug Fix Weather data #127

merged 15 commits into from
Feb 3, 2025

Conversation

Vaishnav2804
Copy link
Collaborator

@Vaishnav2804 Vaishnav2804 commented Jan 28, 2025

  • ClimateDataStore will not be a part of TrackGen method.
  • ClimateDataStore exposes 2 methods namely extract_weather and extract_weather_multiple_points to retrieve weather data for a given lat,lon,time or for a list of lat,lon and time.
  • pip install the below for xarray:
pip install cfgrib

Example Usage:

climate_data_store = ClimateDataStore(['10v','10u'], start_time, end_time,"/home/CanadaV2")
for track in tracks:
      for i in range(len(track['time'])):
          # Extract weather data for the current location and time
          values = climate_data_store.extract_weather(track['lat'][i], track['lon'][i], track['time'][i])

Documentation:
https://aisviz.gitbook.io/documentation/tutorials/climate-data

@Vaishnav2804 Vaishnav2804 self-assigned this Jan 28, 2025
@Vaishnav2804 Vaishnav2804 marked this pull request as draft January 28, 2025 01:12
@Vaishnav2804 Vaishnav2804 marked this pull request as ready for review January 28, 2025 01:15
@Vaishnav2804 Vaishnav2804 marked this pull request as draft January 28, 2025 23:45
@Vaishnav2804 Vaishnav2804 marked this pull request as ready for review January 29, 2025 00:46
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Jinnkunn
Copy link
Collaborator

The tests failed due to an ImportError: "Cannot import name 'epoch_to_iso8601' from 'aisdb.weather.era5'". Please verify the module's availability and import path.

@Jinnkunn
Copy link
Collaborator

If I understand correctly, the cfgrib library will be a dependency of AISdb. Is that correct? If so, I will add cfgrib to pyproject.toml to ensure it is automatically installed with AISdb.

@tsuzzy
Copy link
Collaborator

tsuzzy commented Jan 29, 2025

Hi @Vaishnav2804, could you please add the weather modules to the root __init__.py file so they can be referenced? This will likely resolve the module import issue.

@Vaishnav2804
Copy link
Collaborator Author

If I understand correctly, the cfgrib library will be a dependency of AISdb. Is that correct? If so, I will add cfgrib to pyproject.toml to ensure it is automatically installed with AISdb.

Yes. cfgrib will be a new dependency.

@Vaishnav2804
Copy link
Collaborator Author

If I understand correctly, the cfgrib library will be a dependency of AISdb. Is that correct? If so, I will add cfgrib to pyproject.toml to ensure it is automatically installed with AISdb.

Hi @Vaishnav2804, could you please add the weather modules to the root __init__.py file so they can be referenced? This will likely resolve the module import issue.

Added to __init.py__ and to pyproject.toml

@Vaishnav2804 Vaishnav2804 requested a review from tsuzzy February 3, 2025 05:09
adapt to Python version < 3.11
Copy link
Collaborator

@tsuzzy tsuzzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. Merge #127 into master branch.

@tsuzzy tsuzzy merged commit 7dae679 into master Feb 3, 2025
14 checks passed
@tsuzzy tsuzzy deleted the BG/weather-ais-integration branch February 3, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants