Skip to main content

Visualization tool designed to analyze and illustrate the Lorenz Energy Cycle for atmospheric science.

Project description

PyPI CircleCI

Lorenz Phase Space Visualization

Overview

The Lorenz Phase Space (LPS) visualization tool is designed to analyze and illustrate the dynamics of the Lorenz Energy Cycle in atmospheric science.

This tool offers a unique perspective for studying the intricate processes governing atmospheric energetics and instability mechanisms. It visualizes the transformation and exchange of energy within the atmosphere, specifically focusing on the interactions between kinetic and potential energy forms as conceptualized by Edward Lorenz.

Key features of the tool include:

  • Mixed Mode Visualization: Offers insights into both baroclinic and barotropic instabilities, which are fundamental in understanding large-scale atmospheric dynamics. This mode is particularly useful for comprehensively analyzing scenarios where both instabilities are at play.

  • Baroclinic Mode: Focuses on the baroclinic processes, highlighting the role of temperature gradients and their impact on atmospheric energy transformations. This mode is vital for studying weather systems and jet stream dynamics.

  • Barotropic Mode: Concentrates on barotropic processes, where the redistribution of kinetic energy is predominant. This mode is essential for understanding the horizontal movement of air and its implications on weather patterns.

By utilizing the LPS tool, researchers and meteorologists can delve into the complexities of atmospheric energy cycles, gaining insights into how different energy forms interact and influence weather systems and climate patterns. The tool's ability to switch between different modes (mixed, baroclinic, and barotropic) allows for a multifaceted analysis of atmospheric dynamics, making it an invaluable resource in the field of meteorology and climate science.

Features

  • Visualization of data in Lorenz Phase Space.
  • Support for different types of Lorenz Phase Spaces: mixed, baroclinic, and barotropic.
  • Dynamic adjustment of visualization parameters based on data scale.
  • Customizable plotting options for detailed analysis.

Installation

To use this tool, ensure you have Python installed along with the required libraries: pandas, matplotlib, numpy, and cmocean. You can install these packages using pip:

pip install pandas matplotlib numpy cmocean

Usage

Simple Example with Zoom Disabled

This example demonstrates using the Lorenz Phase Space visualization tool for a single dataset.

from LPS import LorenzPhaseSpace
import pandas as pd
import matplotlib.pyplot as plt

# Load your data
data = pd.read_csv('your_data.csv')

# Initialize the Lorenz Phase Space plotter without zoom
lps = LorenzPhaseSpace(LPS_type='mixed', zoom=False)

# Plot your data
lps.plot_data(
    x_axis=data['Ck'],
    y_axis=data['Ca'],
    marker_color=data['Ge'],
    marker_size=data['Ke']
)

# Save the visualization
fname = 'samples/sample_1_LPS_mixed'
plt.savefig(f"{fname}.png", dpi=300)
print(f"Saved {fname}.png")

Using Two Datasets with Zoom Enabled

This example shows how to plot data from two datasets with zoom enabled for detailed analysis.

from LPS import LorenzPhaseSpace
import pandas as pd
import matplotlib.pyplot as plt

# Load your datasets
data1 = pd.read_csv('dataset1.csv')
data2 = pd.read_csv('dataset2.csv')

# Initialize the Lorenz Phase Space plotter with zoom
lps = LorenzPhaseSpace(LPS_type='mixed', zoom=True)

# Plot data from the first dataset
lps.plot_data(
    x_axis=data1['Ck'],
    y_axis=data1['Ca'],
    marker_color=data1['Ge'],
    marker_size=data1['Ke']
)

# Plot data from the second dataset
lps.plot_data(
    x_axis=data2['Ck'],
    y_axis=data2['Ca'],
    marker_color=data2['Ge'],
    marker_size=data2['Ke']
)

# Save the visualization
fname = 'samples/sample_1_LPS_mixed_zoom_multiple'
plt.savefig(f"{fname}.png", dpi=300)
print(f"Saved {fname}.png")

Using Multiple Datasets with Dynamically Updating Limits

This example demonstrates dynamically updating plot limits based on multiple datasets for enhanced visualization with zoom enabled.

from LPS import LorenzPhaseSpace
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Load your datasets
data1 = pd.read_csv('dataset1.csv')
data2 = pd.read_csv('dataset2.csv')

# Dynamically determine plot limits
x_min, x_max = np.min([data1['Ck'].min(), data2['Ck'].min()]), np.max([data1['Ck'].max(), data2['Ck'].max()])
y_min, y_max = np.min([data1['Ca'].min(), data2['Ca'].min()]), np.max([data1['Ca'].max(), data2['Ca'].max()])
color_min, color_max = np.min([data1['Ge'].min(), data2['Ge'].min()]), np.max([data1['Ge'].max(), data2['Ge'].max()])
size_min, size_max = np.min([data1['Ke'].min(), data2['Ke'].min()]), np.max([data1['Ke'].max(), data2['Ke'].max()])

# Initialize Lorenz Phase Space with dynamic limits
lps = LorenzPhaseSpace(
    LPS_type='mixed',
    zoom=True,
    x_limits=[x_min, x_max],
    y_limits=[y_min, y_max],
    color_limits=[color_min, color_max],
    marker_limits=[size_min, size_max]
)

# Plot data from both datasets
lps.plot_data(x_axis=data1['Ck'], y_axis=data1['Ca'], marker_color=data1['Ge'], marker_size=data1['Ke'])
lps.plot_data(x_axis=data2['Ck'], y_axis=data2['Ca'], marker_color=data2['Ge'], marker_size=data2['Ke'])

# Save the visualization
fname = 'samples/sample_1_LPS_mixed_zoom_multiple_dynamic'
plt.savefig(f"{fname}.png", dpi=300)
print(f"Saved {fname}.png")

These examples cover a range of scenarios from simple usage to more complex visualizations involving multiple datasets and dynamic adjustment of plot limits, showcasing the flexibility of the Lorenz Phase Space visualization tool.

Contributing

Contributions to the LPS project are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any queries or further assistance with the Lorenz Phase Space project, please reach out to danilo.oceano@gmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lorenz_phase_space-1.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

lorenz_phase_space-1.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file lorenz_phase_space-1.1.1.tar.gz.

File metadata

  • Download URL: lorenz_phase_space-1.1.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for lorenz_phase_space-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b6f4d036cd9d923bddd7abc398dcf4774853d1d4cde8609c66866d031d10fec4
MD5 31a62fc99216a5fdde012e0b859338fd
BLAKE2b-256 95d381ea916d8f0bb59170a156a7aecfdfa5b792dadc8402807e00c03de3b823

See more details on using hashes here.

File details

Details for the file lorenz_phase_space-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lorenz_phase_space-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb1b52f8159a7515f4321378c89a9a423b7c6c1fd0666c8c8cce4fb92ba2ffcd
MD5 442fa7691b7aa7e086f62c35288b4f99
BLAKE2b-256 f3eaab475be2807558da3a4d739d5ce7892a22d8e55ba9c0472fab246ebb9c9d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page