Skip to main content

mandelbrot dynamically generated xarray backend

Project description

pypi version

xarrayfrac

A dynamic generative mandelbrot custom backend for xarray

pip install xarrayfrac
import numpy as np
import xarray as xr
from matplotlib import pyplot as plt

# request a 10 billion pixel lazy xarray fractal
ds = xr.open_dataset(None, engine="xarrayfrac", resolution=100000, chunks={"x": 2000, "y": 2000})
# sample 1 in every 10000 pixels
sampled = ds.frac.isel(x=slice(0, 100000, 100), y=slice(0, 100000, 100))
# compute and display
plt.imshow(sampled)

mandelbrot fractal in xarray

# request a 10 billion pixel lazy xarray fractal
ds = xr.open_dataset(None, engine="xarrayfrac", resolution=100000, chunks={"x": 2000, "y": 2000})
# zoom 
window = ds.sel(x=slice(-0.1, 0.1), y=slice(0.9, 1.0))
# plot every hundredth pixel of the window
plt.imshow(window.frac[::10, ::10])

zoomed mandelbrot fractal in xarray

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

xarrayfrac-0.0.6.tar.gz (3.2 kB view hashes)

Uploaded Source

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