GithubHelp home page GithubHelp logo

earthkit-plots's Introduction

earthkit-plots

earthkit-plots's People

Contributors

jamesvarndell avatar tlmquintino avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

earthkit-plots's Issues

How to generate line graph from numpy arrays

Is your feature request related to a problem? Please describe.

I tried to call "line()" in different ways but all failed. E.g.:

import earthkit.plots
import numpy as np
x = np.array([0,1,2,3])
y = np.array([5,6,7,8])
fig = earthkit.plots.line(x=x, y=y)
fig.show()

fails with:

Cannot find a wrapper for class: builtins.NoneType, returning unwrapped object
...
File ~/git/earthkit-plots/earthkit/plots/inputs.py:57, in xarray(self, data, args, kwargs)
     55 else:
     56     try:
---> 57         dataset = earthkit.data.from_object(data).to_xarray().squeeze()
     58     except (NotImplementedError, ValueError):
     59         return None

AttributeError: 'NoneType' object has no attribute 'to_xarray'

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Organisation

ECMWF

Plot tropical cyclone tracks from BUFR data

Is your feature request related to a problem? Please describe.

The BUFR file https://get.ecmwf.int/repository/test-data/earthkit-data/test-data/A_JSXX01ECEP251200_C_ECMP_20240625120000_tropical_cyclone_track_70W_132degE_6p4degN_bufr4.bin contains tropical cyclone track forecast for multiple ensemble members.

The following code extracts the minimum mslp locations for a given member into a pandas dataframe:

import earthkit.data

f_path = "A_JSXX01ECEP251200_C_ECMP_20240625120000_tropical_cyclone_track_70W_132degE_6p4degN_bufr4.bin"
ds = earthkit.data.from_source("file", f_path)
df = ds.to_pandas(columns=("latitude", "longitude", "pressureReducedToMeanSeaLevel"),
    filters={"ensembleMemberNumber": 2, "meteorologicalAttributeSignificance": [1,4]},
    required_columns=True)

df = df.dropna()
   latitude  longitude  pressureReducedToMeanSeaLevel
0       6.7      132.8                       100700.0
1       5.5      131.2                       100600.0
2       6.5      130.0                       100600.0
3       8.7      128.3                       100400.0
6      11.9      122.9                       100900.0
7      13.0      121.8                       100800.0

The task is to generate a plot containing a singe track or multiple tracks.

The data also contains the maximum 10m wind locations, which can be extracted with the following code:

df = ds.to_pandas(columns=("latitude", "longitude", "windSpeedAt10M"),
    filters={"ensembleMemberNumber": 2, "meteorologicalAttributeSignificance": 3},
             required_columns=True)

df = df.dropna()

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Organisation

ECMWF

Bug when specifying regular latitude-longitude domains which wrap the dateline

What happened?

WHen plotting domains which wrap the dateline, the entire width of the globe is shown, rather than just the specified domain.

What are the steps to reproduce the bug?

chart = earthkit.plots.Map(domain=[170, 190, -10, 10], crs=ccrs.PlateCarree())

chart.borders()

chart.coastlines()
chart.gridlines()

chart.show()

Version

latest

Platform (OS and architecture)

MacOS

Relevant log output

No response

Accompanying data

No response

Organisation

No response

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.