lorenz-phase-space


Namelorenz-phase-space JSON
Version 1.2.1 PyPI version JSON
download
home_page
SummaryVisualization tool designed to analyze and illustrate the Lorenz Energy Cycle for atmospheric science.
upload_time2024-03-04 12:52:00
maintainer
docs_urlNone
authorDanilo Couto de Souza
requires_python
licenseMIT
keywords conversion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/lorenz-phase-space?label=pypi%20version)](https://pypi.org/project/lorenz-phase-space/)
[![CircleCI](https://circleci.com/gh/daniloceano/lorenz_phase_space.svg?style=shield)](https://app.circleci.com/pipelines/github/daniloceano/lorenz_phase_space)


# Lorenz Phase Space Visualization


<img src="https://github.com/daniloceano/lorenz_phase_space/assets/56005607/862e0916-4960-4658-b7eb-91f7ad57fe9f" width="550">


## 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 lorenz_phase_space.phase_diagrams import Visualizer
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 = Visualizer(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 lorenz_phase_space.phase_diagrams import Visualizer
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 = Visualizer(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 lorenz_phase_space.phase_diagrams import Visualizer
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 = Visualizer(
    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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "lorenz-phase-space",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "conversion",
    "author": "Danilo Couto de Souza",
    "author_email": "danilo.oceano@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/46/71/5d261109a8fc1cf94b82dc9e565aed94424c88948e23a3a7e731e40d68ab/lorenz_phase_space-1.2.1.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/lorenz-phase-space?label=pypi%20version)](https://pypi.org/project/lorenz-phase-space/)\n[![CircleCI](https://circleci.com/gh/daniloceano/lorenz_phase_space.svg?style=shield)](https://app.circleci.com/pipelines/github/daniloceano/lorenz_phase_space)\n\n\n# Lorenz Phase Space Visualization\n\n\n<img src=\"https://github.com/daniloceano/lorenz_phase_space/assets/56005607/862e0916-4960-4658-b7eb-91f7ad57fe9f\" width=\"550\">\n\n\n## Overview\n\nThe Lorenz Phase Space (LPS) visualization tool is designed to analyze and illustrate the dynamics of the Lorenz Energy Cycle in atmospheric science.\n\nThis tool offers a unique perspective for studying the intricate processes governing atmospheric energetics and instability mechanisms.\nIt 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.\n\nKey features of the tool include:\n\n- Mixed Mode Visualization: Offers insights into both baroclinic and barotropic instabilities, which are fundamental in understanding large-scale atmospheric dynamics. \nThis mode is particularly useful for comprehensively analyzing scenarios where both instabilities are at play.\n\n- Baroclinic Mode: Focuses on the baroclinic processes, highlighting the role of temperature gradients and their impact on atmospheric energy transformations.\nThis mode is vital for studying weather systems and jet stream dynamics.\n\n- Barotropic Mode: Concentrates on barotropic processes, where the redistribution of kinetic energy is predominant. \nThis mode is essential for understanding the horizontal movement of air and its implications on weather patterns.\n\n\nBy 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. \nThe 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.\n\n## Features\n\n- Visualization of data in Lorenz Phase Space.\n- Support for different types of Lorenz Phase Spaces: mixed, baroclinic, and barotropic.\n- Dynamic adjustment of visualization parameters based on data scale.\n- Customizable plotting options for detailed analysis.\n\n## Installation\n\nTo 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:\n\n\n```pip install pandas matplotlib numpy cmocean```\n\n## Usage\n\n# Simple Example with Zoom Disabled\n\nThis example demonstrates using the Lorenz Phase Space visualization tool for a single dataset.\n\n```\nfrom lorenz_phase_space.phase_diagrams import Visualizer\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# Load your data\ndata = pd.read_csv('your_data.csv')\n\n# Initialize the Lorenz Phase Space plotter without zoom\nlps = Visualizer(LPS_type='mixed', zoom=False)\n\n# Plot your data\nlps.plot_data(\n    x_axis=data['Ck'],\n    y_axis=data['Ca'],\n    marker_color=data['Ge'],\n    marker_size=data['Ke']\n)\n\n# Save the visualization\nfname = 'samples/sample_1_LPS_mixed'\nplt.savefig(f\"{fname}.png\", dpi=300)\nprint(f\"Saved {fname}.png\")\n```\n\n# Using Two Datasets with Zoom Enabled\n\nThis example shows how to plot data from two datasets with zoom enabled for detailed analysis.\n\n```\nfrom lorenz_phase_space.phase_diagrams import Visualizer\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# Load your datasets\ndata1 = pd.read_csv('dataset1.csv')\ndata2 = pd.read_csv('dataset2.csv')\n\n# Initialize the Lorenz Phase Space plotter with zoom\nlps = Visualizer(LPS_type='mixed', zoom=True)\n\n# Plot data from the first dataset\nlps.plot_data(\n    x_axis=data1['Ck'],\n    y_axis=data1['Ca'],\n    marker_color=data1['Ge'],\n    marker_size=data1['Ke']\n)\n\n# Plot data from the second dataset\nlps.plot_data(\n    x_axis=data2['Ck'],\n    y_axis=data2['Ca'],\n    marker_color=data2['Ge'],\n    marker_size=data2['Ke']\n)\n\n# Save the visualization\nfname = 'samples/sample_1_LPS_mixed_zoom_multiple'\nplt.savefig(f\"{fname}.png\", dpi=300)\nprint(f\"Saved {fname}.png\")\n```\n\n# Using Multiple Datasets with Dynamically Updating Limits\n\nThis example demonstrates dynamically updating plot limits based on multiple datasets for enhanced visualization with zoom enabled.\n\n```\nfrom lorenz_phase_space.phase_diagrams import Visualizer\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Load your datasets\ndata1 = pd.read_csv('dataset1.csv')\ndata2 = pd.read_csv('dataset2.csv')\n\n# Dynamically determine plot limits\nx_min, x_max = np.min([data1['Ck'].min(), data2['Ck'].min()]), np.max([data1['Ck'].max(), data2['Ck'].max()])\ny_min, y_max = np.min([data1['Ca'].min(), data2['Ca'].min()]), np.max([data1['Ca'].max(), data2['Ca'].max()])\ncolor_min, color_max = np.min([data1['Ge'].min(), data2['Ge'].min()]), np.max([data1['Ge'].max(), data2['Ge'].max()])\nsize_min, size_max = np.min([data1['Ke'].min(), data2['Ke'].min()]), np.max([data1['Ke'].max(), data2['Ke'].max()])\n\n# Initialize Lorenz Phase Space with dynamic limits\nlps = Visualizer(\n    LPS_type='mixed',\n    zoom=True,\n    x_limits=[x_min, x_max],\n    y_limits=[y_min, y_max],\n    color_limits=[color_min, color_max],\n    marker_limits=[size_min, size_max]\n)\n\n# Plot data from both datasets\nlps.plot_data(x_axis=data1['Ck'], y_axis=data1['Ca'], marker_color=data1['Ge'], marker_size=data1['Ke'])\nlps.plot_data(x_axis=data2['Ck'], y_axis=data2['Ca'], marker_color=data2['Ge'], marker_size=data2['Ke'])\n\n# Save the visualization\nfname = 'samples/sample_1_LPS_mixed_zoom_multiple_dynamic'\nplt.savefig(f\"{fname}.png\", dpi=300)\nprint(f\"Saved {fname}.png\")\n```\n\nThese 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.\n\n## Contributing\n\nContributions 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.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Contact\n\nFor any queries or further assistance with the Lorenz Phase Space project, please reach out to danilo.oceano@gmail.com.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Visualization tool designed to analyze and illustrate the Lorenz Energy Cycle for atmospheric science.",
    "version": "1.2.1",
    "project_urls": null,
    "split_keywords": [
        "conversion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4d74105afb96e800e0838f6df2bc265806edd03cd5416f0a67b2aa322b296b8",
                "md5": "575aa4694130bf95a915164167fe826f",
                "sha256": "018e7b4e18b32b0391b5172a79c207050794befa949ee38e52ef52e1c790f7a0"
            },
            "downloads": -1,
            "filename": "lorenz_phase_space-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "575aa4694130bf95a915164167fe826f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10756,
            "upload_time": "2024-03-04T12:51:59",
            "upload_time_iso_8601": "2024-03-04T12:51:59.480148Z",
            "url": "https://files.pythonhosted.org/packages/c4/d7/4105afb96e800e0838f6df2bc265806edd03cd5416f0a67b2aa322b296b8/lorenz_phase_space-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46715d261109a8fc1cf94b82dc9e565aed94424c88948e23a3a7e731e40d68ab",
                "md5": "64fb515f33a0a5db1cab20cc57ba4c0e",
                "sha256": "244288a86b44673dfa397dae8253571bc7bf99f2b23d883edb641f802165d32d"
            },
            "downloads": -1,
            "filename": "lorenz_phase_space-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "64fb515f33a0a5db1cab20cc57ba4c0e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11891,
            "upload_time": "2024-03-04T12:52:00",
            "upload_time_iso_8601": "2024-03-04T12:52:00.672268Z",
            "url": "https://files.pythonhosted.org/packages/46/71/5d261109a8fc1cf94b82dc9e565aed94424c88948e23a3a7e731e40d68ab/lorenz_phase_space-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-04 12:52:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "lorenz-phase-space"
}
        
Elapsed time: 0.19787s