lombricquiver
  • Home
  • About
  • User Guide
    • Getting Started
    • At Easy
    • Usage Examples
    • Comparison
  • Documentation
    • API Reference
  • Previous
  • Next
  • Edit on GitHub
  • Getting Started
  • Retrieving Wind data from ERA5 dataset.
  • Process the data
  • Example dataset - Alternative
  • ERA5 Pipeline
  • Create Animation
  • Render and display
  • Tuning the animation
  • Single Color and diferent background image.

Getting Started¶

This document refers as a first glance on how to use lombricquiver library to produce wind streamlines at easy.

Quick start

  • import the package
In [12]:
Copied!
import xarray as xr
import lombricquiver
import pandas as pd
# Check Version
print(lombricquiver.__version__)
import xarray as xr import lombricquiver import pandas as pd # Check Version print(lombricquiver.__version__)
0.0.1

Retrieving Wind data from ERA5 dataset.¶

Wind data is retrieved through Earth Data Hub, a project linked to the Destination-Earth.

The Earth Data Hub requests a key in order to access its services. The access is granted on a free level for any user of the plataform. In case you are new, it is necessary to create a login and retrive your API-key straight on the plataform.

The API-key is located on the settings of your personal account. Please, log in on Destination Earth, then access Earth Data Hub and then go to setting, on the bottom part you are able to find your API key. After you have your API key, you can proceed with the tutorial.


Please run the code below and provide the your key

In [ ]:
Copied!
## This you open an input window to insert your API key
from lombricquiver.cacheb_path import cacheb_key
key = cacheb_key()
## This you open an input window to insert your API key from lombricquiver.cacheb_path import cacheb_key key = cacheb_key()
In [4]:
Copied!
ds = xr.open_dataset(
    f"https://edh:{key}@data.earthdatahub.destine.eu/era5/reanalysis-era5-single-levels-v0.zarr",
    chunks={},
    engine="zarr",
)
print(ds)
ds = xr.open_dataset( f"https://edh:{key}@data.earthdatahub.destine.eu/era5/reanalysis-era5-single-levels-v0.zarr", chunks={}, engine="zarr", ) print(ds)
<xarray.Dataset> Size: 423TB
Dimensions:              (valid_time: 748752, latitude: 721, longitude: 1440)
Coordinates:
    depthBelowLandLayer  float64 8B ...
    entireAtmosphere     float64 8B ...
  * latitude             (latitude) float64 6kB 90.0 89.75 89.5 ... -89.75 -90.0
  * longitude            (longitude) float64 12kB 0.0 0.25 0.5 ... 359.5 359.8
    number               int64 8B ...
    surface              float64 8B ...
  * valid_time           (valid_time) datetime64[ns] 6MB 1940-01-01 ... 2025-...
Data variables: (12/136)
    alnid                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    alnip                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    aluvd                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    aluvp                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    anor                 (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    asn                  (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    ...                   ...
    viiwn                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    vilwd                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    vilwe                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    vilwn                (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    z                    (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
    zust                 (valid_time, latitude, longitude) float32 3TB dask.array<chunksize=(4320, 64, 64), meta=np.ndarray>
Attributes:
    Conventions:             CF-1.7
    GRIB_centre:             ecmf
    GRIB_centreDescription:  European Centre for Medium-Range Weather Forecasts
    GRIB_edition:            1
    GRIB_subCentre:          0
    history:                 2025-02-13T19:10 GRIB to CDM+CF via cfgrib-0.9.1...
    institution:             European Centre for Medium-Range Weather Forecasts

Process the data¶

  • Uses the class ERA5Processor to pipeline the ERA5 wind data.

The ERA5 dataset is stored as a xarray, in order to make it easier to integrate, the ERA5Processor is called and deal with all the pre-processing steps.

In [ ]:
Copied!
# 1. Initialize the processor
from lombricquiver.era5_processor import ERA5DataProcessor

processor = ERA5DataProcessor(
    ds=ds,
    variables=['u10', 'v10', 't2m'],
    date_range=["2023-03-05", "2023-03-05"],
    spatial_range={
        'lat': [35.0, 71.0],
        'lon': [-10.0, 40.0]
    }
)

# 2. Pre-process data (slice, filter, extract variables) and load it
processor.process_data()
# 1. Initialize the processor from lombricquiver.era5_processor import ERA5DataProcessor processor = ERA5DataProcessor( ds=ds, variables=['u10', 'v10', 't2m'], date_range=["2023-03-05", "2023-03-05"], spatial_range={ 'lat': [35.0, 71.0], 'lon': [-10.0, 40.0] } ) # 2. Pre-process data (slice, filter, extract variables) and load it processor.process_data()

Example dataset - Alternative¶

In case you have not set the key within Destination Earth, you can use the example dataset to visualize some results. Altought, we encourage any user to try the API of Destination Earth due easy integration and free access.

In [13]:
Copied!
# !! Only run this cell if you are unable to retrieve your API key from Destination Earth !!
# This is an example dataset that can be used to visualize the quiver plot
from lombricquiver.era5_processor import ERA5DataProcessor
example_dataset = xr.open_dataset("examples/dataset/era5_data.nc")

processor = ERA5DataProcessor(
    ds = example_dataset,
    variables=['u10', 'v10', 't2m'],
    date_range=["2023-03-05", "2023-03-05"],
    spatial_range={
        'lat': [35.0, 71.0],
        'lon': [-10.0, 40.0]
    }
)

processor.loaded_dataset = example_dataset
# !! Only run this cell if you are unable to retrieve your API key from Destination Earth !! # This is an example dataset that can be used to visualize the quiver plot from lombricquiver.era5_processor import ERA5DataProcessor example_dataset = xr.open_dataset("examples/dataset/era5_data.nc") processor = ERA5DataProcessor( ds = example_dataset, variables=['u10', 'v10', 't2m'], date_range=["2023-03-05", "2023-03-05"], spatial_range={ 'lat': [35.0, 71.0], 'lon': [-10.0, 40.0] } ) processor.loaded_dataset = example_dataset

ERA5 Pipeline¶

-Prepare data for plot

In [14]:
Copied!
# Calculate wind speed
processor.calculate_wind_speed()
                                                                 
# Return the processed dataset
dataset = processor.get_processed_data()

# Create a subsampling dataset
dataset_subsampled = processor.subsample_data(2)

# Extract variables by a given timestep e.x: 10:00am
extract_var = ['u10', 'v10', 't2m','wind_speed']
dict_extract_var = processor.extract_components_by_given_timestep(extract_variables = extract_var,
                                                                timestep=10, ##10:00am
                                                                lat_long=True)
## Select a valid time to be exhibited
dataset_subsampled_10am = dataset_subsampled.isel(valid_time=10) ## 10:00 am
# Calculate wind speed processor.calculate_wind_speed() # Return the processed dataset dataset = processor.get_processed_data() # Create a subsampling dataset dataset_subsampled = processor.subsample_data(2) # Extract variables by a given timestep e.x: 10:00am extract_var = ['u10', 'v10', 't2m','wind_speed'] dict_extract_var = processor.extract_components_by_given_timestep(extract_variables = extract_var, timestep=10, ##10:00am lat_long=True) ## Select a valid time to be exhibited dataset_subsampled_10am = dataset_subsampled.isel(valid_time=10) ## 10:00 am

Create Animation¶

In [15]:
Copied!
from lombricquiver.manim_vector_field import VectorFieldAnimation
from lombricquiver.manim_vector_field import VectorFieldAnimation
In [ ]:
Copied!
## Create the Animator instance
vf = VectorFieldAnimation()

## All the following code are methods of the VectorFieldAnimation class
# Set the wind dataset in the class
vf.set_dataset(dataset_subsampled_10am)

# Create the background image and set under the hood
vf.create_background_image(
    dict_extract_var=dict_extract_var,
    var_heatmap = 'wind_speed' 
)

vf.configure_streamplot(
    animation_duration=5,  # 5 seconds of total animation
    max_anchors_per_line=100,  # max number of anchors per line in the animation
    flow_speed=1.5,  # speed of the streamline agent in the animation
    virtual_time=4,  # Higher values result in longer stream lines
)
## Returns the scene class to be used in Manim
Animation_singlecolor = vf.get_scene_class()
## Create the Animator instance vf = VectorFieldAnimation() ## All the following code are methods of the VectorFieldAnimation class # Set the wind dataset in the class vf.set_dataset(dataset_subsampled_10am) # Create the background image and set under the hood vf.create_background_image( dict_extract_var=dict_extract_var, var_heatmap = 'wind_speed' ) vf.configure_streamplot( animation_duration=5, # 5 seconds of total animation max_anchors_per_line=100, # max number of anchors per line in the animation flow_speed=1.5, # speed of the streamline agent in the animation virtual_time=4, # Higher values result in longer stream lines ) ## Returns the scene class to be used in Manim Animation_singlecolor = vf.get_scene_class()
Geographic extent: -10.00°E to 40.00°E, 35.00°N to 71.00°N
Aspect ratio: 0.84
Figure dimensions: 8.37 × 7.00 inches
Final image size: 2512 × 2100 pixels
Image saved as:base_layer.png
All good, background image path set to: base_layer.png

Render and display¶

In [ ]:
Copied!
%manim -ql -v WARNING Animation_singlecolor
%manim -ql -v WARNING Animation_singlecolor

Tuning the animation¶

The animation is created within the VectorFieldAnimation class, which is a animator to handle Manim's engine.

  • The parameters of the animation can be tuned with configure methods.
  • Title, subtitle and colorbar are optional features and are displayed with the parameter 'show'.
  • The streamplot can be seen either over a choosen palette or a single color for all stream lines.
In [10]:
Copied!
# # Create an instance of the class animator
vf = VectorFieldAnimation()

# # Set the wind dataset in the class
vf.set_dataset(dataset_subsampled_10am)

# # Create the background image and set under the hood
vf.create_background_image(
    dict_extract_var=dict_extract_var,
    var_heatmap = 'wind_speed' 
)

## Config the animations parameters
vf.configure_streamplot(
    animation_duration = 5, # 4 seconds of total animation
    max_anchors_per_line=100 , # max number of anchors per line in the animation
    flow_speed=1.8, # it is the speed of the streamline agent in the animation,
    virtual_time=4,#Higher values therefore result in longer stream lines
)

## Config title
vf.configure_title(
    show_title = True,
    title = 'Vector Field - Wind Speed',
    font_size= 36
)

## Config suptitle
vf.configure_subtitle(
    show_subtitle = True,
    font_size=16,
    subtitle = pd.to_datetime(str(vf.dataset()['valid_time'].values)).strftime('%Y-%m-%d %H:%M:%S')
)

## Config colorbar
vf.configure_colorbar(
    show=True,
    palette = 'viridis', ## Palette - from matplotlib palettes
    num_colors = 4 ,
    figsize = (1.0,9)
)

## Check if the animator is ready 
if vf.is_ready():
    print('Everything is set')
else:
    vf.get_missing_requirements()

## Create the scene class inherented from Manim Scene
Animation = vf.get_scene_class()
# # Create an instance of the class animator vf = VectorFieldAnimation() # # Set the wind dataset in the class vf.set_dataset(dataset_subsampled_10am) # # Create the background image and set under the hood vf.create_background_image( dict_extract_var=dict_extract_var, var_heatmap = 'wind_speed' ) ## Config the animations parameters vf.configure_streamplot( animation_duration = 5, # 4 seconds of total animation max_anchors_per_line=100 , # max number of anchors per line in the animation flow_speed=1.8, # it is the speed of the streamline agent in the animation, virtual_time=4,#Higher values therefore result in longer stream lines ) ## Config title vf.configure_title( show_title = True, title = 'Vector Field - Wind Speed', font_size= 36 ) ## Config suptitle vf.configure_subtitle( show_subtitle = True, font_size=16, subtitle = pd.to_datetime(str(vf.dataset()['valid_time'].values)).strftime('%Y-%m-%d %H:%M:%S') ) ## Config colorbar vf.configure_colorbar( show=True, palette = 'viridis', ## Palette - from matplotlib palettes num_colors = 4 , figsize = (1.0,9) ) ## Check if the animator is ready if vf.is_ready(): print('Everything is set') else: vf.get_missing_requirements() ## Create the scene class inherented from Manim Scene Animation = vf.get_scene_class()
Geographic extent: -10.00°E to 40.00°E, 35.00°N to 71.00°N
Aspect ratio: 0.84
Figure dimensions: 8.37 × 7.00 inches
Final image size: 2512 × 2100 pixels
Image saved as:base_layer.png
All good, background image path set to: base_layer.png
Everything is set
In [11]:
Copied!
%manim -ql -v WARNING Animation
%manim -ql -v WARNING Animation
Manim Community v0.19.0

Colorbar saved as the following file_name: colorbar
colorbar settings on scene 1.3155680224403927 7.000000000000001
                                                          
Your browser does not support the video element.

Single Color and diferent background image.¶

  • It is easy to change the background and apply other variables present at the animation.

Temperature variable now is being displayed.

In [ ]:
Copied!
## Create new background image for the animation 
new_background = create_layer_base(
    dict_extract_var,
    var_heatmap = 't2m',
    file_name = 'temp_base_layer.png'
)

## Also, let's change the time of the  day, lets plot at 17:00 
dict_extract_var = processor.extract_components_by_given_timestep(extract_variables = extract_var,
                                                                timestep=17, ## 10:00am,
                                                                lat_long=True)
dataset_subsampled_17 = dataset_subsampled.isel(valid_time=17) #17:00

vf.set_dataset(dataset_subsampled_17)
## Set the new background on the class animator
vf.set_background_image(new_background)

## Apply the same steps above

## Config the animations parameters
vf.configure_streamplot(
    animation_duration = 4, # 4 seconds of total animation
    max_anchors_per_line=75 , # max number of anchors per line in the animation
    flow_speed=1.8, # it is the speed of the streamline agent in the animation,
    virtual_time=4,#Higher values therefore result in longer stream lines
)

## Config title
vf.configure_title(
    show_title = True,
    title = 'Vector Field - Wind Speed',
    font_size= 36
)

## Config suptitle
vf.configure_subtitle(
    show_subtitle = True,
    font_size=16,
    subtitle = pd.to_datetime(str(vf.dataset()['valid_time'].values)).strftime('%Y-%m-%d %H:%M:%S')
)

## Config colorbar
vf.configure_colorbar(
    show=True,
    palette = 'viridis', ## Palette - from matplotlib palettes
    num_colors = 4 
)

## Check if the animator is ready 
if vf.is_ready():
    print('Everything is set')
else:
    vf.get_missing_requirements()

## Create the scene class inherented from Manim Scene
Animation_dif = vf.get_scene_class()
## Create new background image for the animation new_background = create_layer_base( dict_extract_var, var_heatmap = 't2m', file_name = 'temp_base_layer.png' ) ## Also, let's change the time of the day, lets plot at 17:00 dict_extract_var = processor.extract_components_by_given_timestep(extract_variables = extract_var, timestep=17, ## 10:00am, lat_long=True) dataset_subsampled_17 = dataset_subsampled.isel(valid_time=17) #17:00 vf.set_dataset(dataset_subsampled_17) ## Set the new background on the class animator vf.set_background_image(new_background) ## Apply the same steps above ## Config the animations parameters vf.configure_streamplot( animation_duration = 4, # 4 seconds of total animation max_anchors_per_line=75 , # max number of anchors per line in the animation flow_speed=1.8, # it is the speed of the streamline agent in the animation, virtual_time=4,#Higher values therefore result in longer stream lines ) ## Config title vf.configure_title( show_title = True, title = 'Vector Field - Wind Speed', font_size= 36 ) ## Config suptitle vf.configure_subtitle( show_subtitle = True, font_size=16, subtitle = pd.to_datetime(str(vf.dataset()['valid_time'].values)).strftime('%Y-%m-%d %H:%M:%S') ) ## Config colorbar vf.configure_colorbar( show=True, palette = 'viridis', ## Palette - from matplotlib palettes num_colors = 4 ) ## Check if the animator is ready if vf.is_ready(): print('Everything is set') else: vf.get_missing_requirements() ## Create the scene class inherented from Manim Scene Animation_dif = vf.get_scene_class()
Geographic extent: -10.00°E to 40.00°E, 35.00°N to 71.00°N
Aspect ratio: 0.84
Figure dimensions: 10.77 × 9.00 inches
Final image size: 2691 × 2250 pixels
Image saved as:base_layer.png
Out[ ]:
<lombricquiver.manim_vector_field.VectorFieldAnimation at 0x1f8fb7d34d0>
In [ ]:
Copied!
%manim -ql -v WARNING Animation_dif
%manim -ql -v WARNING Animation_dif
In [ ]:
Copied!
vf.dataset()
vf.dataset()
Out[ ]:
<xarray.Dataset> Size: 119kB
Dimensions:              (latitude: 73, longitude: 101)
Coordinates:
    valid_time           datetime64[ns] 8B 2023-03-05T10:00:00
    depthBelowLandLayer  float64 8B 100.0
    entireAtmosphere     float64 8B 0.0
    number               int32 4B 0
    surface              float64 8B 0.0
  * longitude            (longitude) float64 808B -10.0 -9.5 -9.0 ... 39.5 40.0
  * latitude             (latitude) float64 584B 71.0 70.5 70.0 ... 35.5 35.0
Data variables:
    u10                  (latitude, longitude) float32 29kB -0.3091 ... -0.4858
    v10                  (latitude, longitude) float32 29kB -9.922 ... 1.663
    t2m                  (latitude, longitude) float32 29kB ...
    wind_speed           (latitude, longitude) float32 29kB 9.927 ... 1.733
xarray.Dataset
    • latitude: 73
    • longitude: 101
    • valid_time
      ()
      datetime64[ns]
      2023-03-05T10:00:00
      array('2023-03-05T10:00:00.000000000', dtype='datetime64[ns]')
    • depthBelowLandLayer
      ()
      float64
      100.0
      long_name :
      soil depth
      positive :
      down
      standard_name :
      depth
      units :
      m
      array(100.)
    • entireAtmosphere
      ()
      float64
      0.0
      long_name :
      original GRIB coordinate for key: level(entireAtmosphere)
      units :
      1
      array(0.)
    • number
      ()
      int32
      0
      long_name :
      ensemble member numerical id
      standard_name :
      realization
      units :
      1
      array(0, dtype=int32)
    • surface
      ()
      float64
      0.0
      long_name :
      original GRIB coordinate for key: level(surface)
      units :
      1
      array(0.)
    • longitude
      (longitude)
      float64
      -10.0 -9.5 -9.0 ... 39.0 39.5 40.0
      array([-10. ,  -9.5,  -9. ,  -8.5,  -8. ,  -7.5,  -7. ,  -6.5,  -6. ,  -5.5,
              -5. ,  -4.5,  -4. ,  -3.5,  -3. ,  -2.5,  -2. ,  -1.5,  -1. ,  -0.5,
               0. ,   0.5,   1. ,   1.5,   2. ,   2.5,   3. ,   3.5,   4. ,   4.5,
               5. ,   5.5,   6. ,   6.5,   7. ,   7.5,   8. ,   8.5,   9. ,   9.5,
              10. ,  10.5,  11. ,  11.5,  12. ,  12.5,  13. ,  13.5,  14. ,  14.5,
              15. ,  15.5,  16. ,  16.5,  17. ,  17.5,  18. ,  18.5,  19. ,  19.5,
              20. ,  20.5,  21. ,  21.5,  22. ,  22.5,  23. ,  23.5,  24. ,  24.5,
              25. ,  25.5,  26. ,  26.5,  27. ,  27.5,  28. ,  28.5,  29. ,  29.5,
              30. ,  30.5,  31. ,  31.5,  32. ,  32.5,  33. ,  33.5,  34. ,  34.5,
              35. ,  35.5,  36. ,  36.5,  37. ,  37.5,  38. ,  38.5,  39. ,  39.5,
              40. ])
    • latitude
      (latitude)
      float64
      71.0 70.5 70.0 ... 36.0 35.5 35.0
      long_name :
      latitude
      standard_name :
      latitude
      stored_direction :
      decreasing
      units :
      degrees_north
      array([71. , 70.5, 70. , 69.5, 69. , 68.5, 68. , 67.5, 67. , 66.5, 66. , 65.5,
             65. , 64.5, 64. , 63.5, 63. , 62.5, 62. , 61.5, 61. , 60.5, 60. , 59.5,
             59. , 58.5, 58. , 57.5, 57. , 56.5, 56. , 55.5, 55. , 54.5, 54. , 53.5,
             53. , 52.5, 52. , 51.5, 51. , 50.5, 50. , 49.5, 49. , 48.5, 48. , 47.5,
             47. , 46.5, 46. , 45.5, 45. , 44.5, 44. , 43.5, 43. , 42.5, 42. , 41.5,
             41. , 40.5, 40. , 39.5, 39. , 38.5, 38. , 37.5, 37. , 36.5, 36. , 35.5,
             35. ])
    • u10
      (latitude, longitude)
      float32
      -0.3091 -0.3228 ... -0.6733 -0.4858
      GRIB_NV :
      0
      GRIB_Nx :
      1440
      GRIB_Ny :
      721
      GRIB_cfName :
      unknown
      GRIB_cfVarName :
      u10
      GRIB_dataType :
      an
      GRIB_gridDefinitionDescription :
      Latitude/Longitude Grid
      GRIB_gridType :
      regular_ll
      GRIB_iDirectionIncrementInDegrees :
      0.25
      GRIB_iScansNegatively :
      0
      GRIB_jDirectionIncrementInDegrees :
      0.25
      GRIB_jPointsAreConsecutive :
      0
      GRIB_jScansPositively :
      0
      GRIB_latitudeOfFirstGridPointInDegrees :
      90.0
      GRIB_latitudeOfLastGridPointInDegrees :
      -90.0
      GRIB_longitudeOfFirstGridPointInDegrees :
      0.0
      GRIB_longitudeOfLastGridPointInDegrees :
      359.75
      GRIB_missingValue :
      3.4028234663852886e+38
      GRIB_name :
      10 metre U wind component
      GRIB_numberOfPoints :
      1038240
      GRIB_paramId :
      165
      GRIB_shortName :
      10u
      GRIB_stepType :
      instant
      GRIB_stepUnits :
      1
      GRIB_totalNumber :
      0
      GRIB_typeOfLevel :
      surface
      GRIB_units :
      m s**-1
      long_name :
      10 metre U wind component
      standard_name :
      unknown
      units :
      m s**-1
      array([[-0.309082, -0.322754, -0.282715, ..., -5.925781, -5.917969, -5.878906],
             [ 0.214478,  0.283691,  0.368652, ..., -7.101562, -7.039062, -7.09375 ],
             [ 0.679199,  0.565918,  0.415527, ..., -9.03125 , -9.007812, -8.6875  ],
             ...,
             [ 5.117188,  6.742188,  5.863281, ..., -3.421875, -4.035156, -4.445312],
             [ 6.246094,  6.183594,  4.605469, ..., -1.575195, -1.876953, -2.320312],
             [ 5.339844,  4.261719,  3.935547, ..., -0.382324, -0.67334 , -0.48584 ]],
            shape=(73, 101), dtype=float32)
    • v10
      (latitude, longitude)
      float32
      -9.922 -10.06 ... 1.724 1.663
      GRIB_NV :
      0
      GRIB_Nx :
      1440
      GRIB_Ny :
      721
      GRIB_cfName :
      unknown
      GRIB_cfVarName :
      v10
      GRIB_dataType :
      an
      GRIB_gridDefinitionDescription :
      Latitude/Longitude Grid
      GRIB_gridType :
      regular_ll
      GRIB_iDirectionIncrementInDegrees :
      0.25
      GRIB_iScansNegatively :
      0
      GRIB_jDirectionIncrementInDegrees :
      0.25
      GRIB_jPointsAreConsecutive :
      0
      GRIB_jScansPositively :
      0
      GRIB_latitudeOfFirstGridPointInDegrees :
      90.0
      GRIB_latitudeOfLastGridPointInDegrees :
      -90.0
      GRIB_longitudeOfFirstGridPointInDegrees :
      0.0
      GRIB_longitudeOfLastGridPointInDegrees :
      359.75
      GRIB_missingValue :
      3.4028234663852886e+38
      GRIB_name :
      10 metre V wind component
      GRIB_numberOfPoints :
      1038240
      GRIB_paramId :
      166
      GRIB_shortName :
      10v
      GRIB_stepType :
      instant
      GRIB_stepUnits :
      1
      GRIB_totalNumber :
      0
      GRIB_typeOfLevel :
      surface
      GRIB_units :
      m s**-1
      long_name :
      10 metre V wind component
      standard_name :
      unknown
      units :
      m s**-1
      array([[ -9.921875, -10.0625  , -10.40625 , ...,  -3.642578,  -4.125   ,
               -4.46875 ],
             [-10.304688, -10.453125, -10.546875, ...,  -5.507812,  -5.378906,
               -5.417969],
             [-10.5     , -10.773438, -10.953125, ...,  -6.261719,  -6.164062,
               -6.109375],
             ...,
             [ -0.700195,   3.212891,   5.417969, ...,   2.412109,   3.802734,
                4.5     ],
             [  2.572266,   5.183594,   5.734375, ...,   4.757812,   3.976562,
                3.285156],
             [  5.210938,   5.300781,   4.519531, ...,   3.947266,   1.723633,
                1.663086]], shape=(73, 101), dtype=float32)
    • t2m
      (latitude, longitude)
      float32
      ...
      GRIB_NV :
      0
      GRIB_Nx :
      1440
      GRIB_Ny :
      721
      GRIB_cfName :
      unknown
      GRIB_cfVarName :
      t2m
      GRIB_dataType :
      an
      GRIB_gridDefinitionDescription :
      Latitude/Longitude Grid
      GRIB_gridType :
      regular_ll
      GRIB_iDirectionIncrementInDegrees :
      0.25
      GRIB_iScansNegatively :
      0
      GRIB_jDirectionIncrementInDegrees :
      0.25
      GRIB_jPointsAreConsecutive :
      0
      GRIB_jScansPositively :
      0
      GRIB_latitudeOfFirstGridPointInDegrees :
      90.0
      GRIB_latitudeOfLastGridPointInDegrees :
      -90.0
      GRIB_longitudeOfFirstGridPointInDegrees :
      0.0
      GRIB_longitudeOfLastGridPointInDegrees :
      359.75
      GRIB_missingValue :
      3.4028234663852886e+38
      GRIB_name :
      2 metre temperature
      GRIB_numberOfPoints :
      1038240
      GRIB_paramId :
      167
      GRIB_shortName :
      2t
      GRIB_stepType :
      instant
      GRIB_stepUnits :
      1
      GRIB_totalNumber :
      0
      GRIB_typeOfLevel :
      surface
      GRIB_units :
      K
      last_restart_dim_updated :
      747288
      long_name :
      2 metre temperature
      standard_name :
      unknown
      units :
      K
      [7373 values with dtype=float32]
    • wind_speed
      (latitude, longitude)
      float32
      9.927 10.07 10.41 ... 1.85 1.733
      long_name :
      Wind Speed calculated from u10 and v10
      units :
      m s**-1
      array([[ 9.926688 , 10.067675 , 10.4100895, ...,  6.9558077,  7.2137356,
               7.3845286],
             [10.306919 , 10.456974 , 10.553316 , ...,  8.987112 ,  8.8589525,
               8.926124 ],
             [10.521944 , 10.788291 , 10.961004 , ..., 10.989658 , 10.91496  ,
              10.620599 ],
             ...,
             [ 5.16487  ,  7.4685845,  7.9832606, ...,  4.186586 ,  5.544662 ,
               6.3254094],
             [ 6.755016 ,  8.068858 ,  7.3548217, ...,  5.011788 ,  4.397272 ,
               4.0219526],
             [ 7.461086 ,  6.8015094,  5.9928865, ...,  3.965738 ,  1.8504856,
               1.7325978]], shape=(73, 101), dtype=float32)
    • longitude
      PandasIndex
      PandasIndex(Index([-10.0,  -9.5,  -9.0,  -8.5,  -8.0,  -7.5,  -7.0,  -6.5,  -6.0,  -5.5,
             ...
              35.5,  36.0,  36.5,  37.0,  37.5,  38.0,  38.5,  39.0,  39.5,  40.0],
            dtype='float64', name='longitude', length=101))
    • latitude
      PandasIndex
      PandasIndex(Index([71.0, 70.5, 70.0, 69.5, 69.0, 68.5, 68.0, 67.5, 67.0, 66.5, 66.0, 65.5,
             65.0, 64.5, 64.0, 63.5, 63.0, 62.5, 62.0, 61.5, 61.0, 60.5, 60.0, 59.5,
             59.0, 58.5, 58.0, 57.5, 57.0, 56.5, 56.0, 55.5, 55.0, 54.5, 54.0, 53.5,
             53.0, 52.5, 52.0, 51.5, 51.0, 50.5, 50.0, 49.5, 49.0, 48.5, 48.0, 47.5,
             47.0, 46.5, 46.0, 45.5, 45.0, 44.5, 44.0, 43.5, 43.0, 42.5, 42.0, 41.5,
             41.0, 40.5, 40.0, 39.5, 39.0, 38.5, 38.0, 37.5, 37.0, 36.5, 36.0, 35.5,
             35.0],
            dtype='float64', name='latitude'))
In [ ]:
Copied!
Animation.preview_config()
Animation.preview_config()
Out[ ]:
{'main': {'output_file': 'wind_stream_plot',
  'pixel_width': 854,
  'pixel_height': 480,
  'preview_frames': 30,
  'transparent': False,
  'quality': 'medium_quality'},
 'baseplot': {'image_height': 7},
 'title': {'show_title': True,
  'title_text': 'My Visualization',
  'title_font_size': 36,
  'title_color': ManimColor('#FFFFFF')},
 'suptitle': {'show_suptitle': True,
  'suptitle_text': '2023-03-05 10:00:00',
  'suptitle_font_size': 24,
  'suptitle_color': ManimColor('#FFFFFF')},
 'streamplot': {'delta_y': 0.15,
  'resize_factor': 0.05,
  'stroke_width': 1.5,
  'flow_speed': 2.5,
  'time_width': 0.3,
  'animation_duration': 3,
  'dt': 0.01,
  'max_anchors_per_line': 100,
  'color': ManimColor('#FFFFFF'),
  'virtual_time': 4}}
In [ ]:
Copied!


Copyright © 2023 Emanuel Goulart
Documentation built with MkDocs.

Keyboard Shortcuts

Keys Action
? Open this help
n Next page
p Previous page
s Search