<jupyter_start><jupyter_text>Visualizing a PPI<jupyter_code>import os
import datetime
import numpy as np

from netCDF4 import Dataset

import chart
# file = os.path.expanduser('~/Downloads/PX-20170220-050706-E2.4-Z.nc')
file = 'blob/PX-20170220-050706-E2.4-Z.nc'

with Dataset(file, mode='r') as nc:
    name = nc.getncattr('TypeName')
    elev = np.array(nc.variables['Elevation'][:], dtype=np.float32)
    azim = np.array(nc.variables['Azimuth'][:], dtype=np.float32)
    gatewidth = np.array(nc.variables['GateWidth'][:], dtype=np.float32)
    values = np.array(nc.variables[name][:], dtype=np.float32)
    values[values < -90] = np.nan
    longitude = nc.getncattr('Longitude')
    latitude = nc.getncattr('Latitude')
    sweepElev = nc.getncattr('Elevation')
    sweepTime = nc.getncattr('Time')
    symbol = file.split('.')[-2].split('-')[-1]<jupyter_output><empty_output><jupyter_text>Overlay for the Plot<jupyter_code>overlay = chart.atlas.Overlay((longitude, latitude))
radii = np.concatenate(([1.0], np.arange(10.0, 61.0, 10.0)))
overlay.setRingRadii(radii)
overlay.load()
r = 1.0e-3 * np.arange(values.shape[1]) * gatewidth[0]
a = np.deg2rad(azim)
t = datetime.datetime.utcfromtimestamp(sweepTime)
timestr = t.strftime('%Y/%m/%d %H:%M:%S')
title = f'{timestr} UTC  EL: {sweepElev:.2f}°'
symbol = 'Z'<jupyter_output><empty_output><jupyter_text>Chart with Overlay<jupyter_code>ppi = chart.chart.Image(a, r, values, style=symbol, overlay=overlay, title=title, figsize=(800, 640), maxrange=50.0)
ppi.image()<jupyter_output><empty_output><jupyter_text>Another Product<jupyter_code>file = 'blob/PX-20170220-050706-E2.4-W.nc'

with Dataset(file, mode='r') as nc:
    name = nc.getncattr('TypeName')
    values = np.array(nc.variables[name][:], dtype=np.float32)
    values[values < -90] = np.nan
    symbol = file.split('.')[-2].split('-')[-1]
ppi.set_data(values, style=symbol)
ppi.image()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18607068607068608, 'fraction_numerical': 0.04885654885654886, 'mean_word_length': 5.438127090301004, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '550774', 'license': 'MIT', 'n_tokens_mistral': 836, 'n_tokens_neox': 791, 'n_words': 114, 'path': 'Visualizing a PPI.ipynb', 'repo_name': 'OURadar/Chart', 'size': '1924'}