Skip to main content

Radar Data

This is a collection of radar data readers, a CF-Radial radar data writer, and charting routines.

Supported input formats:

  • WDSS-II
  • CF-Radial 1.3 / CF-1.6
  • CF-Radial 1.4 / CF-1.6
  • CF-Radial 1.4 / CF-1.7
  • CF-Radial 2.0 (draft)
  • NEXRAD Level II

Supported output format:

  • CF-Radial 1.4

Installation

pip install radar-data

Examples

import radar

# Get the absolute path of the .nc file, reader automatically gets -V, -W, etc.
file = os.path.expanduser("~/Downloads/data/PX-20240529-150246-E4.0-Z.nc")
sweep = radar.read(file)

# It also works with providing the original .tar.xz or .txz archive
file = os.path.expanduser("~/Downloads/data/PX-20240529-150246-E4.0.txz")
sweep = radar.read(file)

# NEXRAD LDM data feed, simply supply any of the files, the reader reads sweep_index=0 by default
file = os.path.expanduser("~/Downloads/data/KTLX/861/KTLX-20250503-122438-861-1-S")
sweep = radar.read(file)

# The reader finds others in ~/Downloads/data/KTLX/861/ to get to sweep_index=1
file = os.path.expanduser("~/Downloads/data/KTLX/861/KTLX-20250503-122438-861-7-I")
sweep = radar.read(file, sweep_index=1)

# NEXRAD complete volume
file = os.path.expanduser("~/Downloads/data/KTLX/20250503/KTLX20250503_122438_V06")
sweep = radar.read(file, sweep_index=1)

# Writing a CF-Radial file
radar.write("output-file.nc", sweep)

To draw a chart:

import radar

# Read a sweep as before
sweep = radar.read(file)

# You can initialize a chart without data
chart = radar.chart.ChartPPI()

# You can also pass it the sweep
chart = radar.chart.ChartPPI(sweep)

# You can replace the content of the chart
chart.set_data(sweep)

# Some customizations:
chart.set_data(sweep, rmax=60, xoff=-10, yoff=-10)

# If, for some reasons, the chart does not show up, the figure is
chart.fig

# You can save the figure as an image using the matplotlib figure.savefig
chart.fig.savefir(FILENAME)

Figure

DataShop

A data server for multi-threaded reading. An example use case would be to abstract the file reading backend to this service so that multiple requests can be pipelined.

usage: datashop [-h] [-c COUNT] [-d DIR] [-H HOST] [-p PORT] [-t TEST] [-v] [--delay] [--version] [source ...]

Datashop

Examples:
    datashop -v settings.yaml
    datashop -v -H 10.197.14.52 -p 50001 -c 4 -t /mnt/data/PX1000/2024/20241219/_original

positional arguments:
  source                configuration

options:
  -h, --help            show this help message and exit
  -c COUNT, --count COUNT
                        count
  -d DIR, --dir DIR     directory
  -H HOST, --host HOST  host
  -p PORT, --port PORT  port
  -t TEST, --test TEST  test using directory
  -v                    increases verbosity
  --delay               simulate request delays
  --version             show program's version number and exit

Example Configuration

host: 0.0.0.0
port: 50000
count: 8
cache: 3000
logfile: /var/log/radarhub/datashop.log
utc: true

Unit Tests

Make a symbolic link to a subfolder data under this repository. If the folder data has no data, the test will download the test data from our server.

To run a set of reading tests through pytest:

mkdir ~/Downloads/test-data
ln -s ~/Downloads/test-data data
pytest -s

Metadata

Release files for radar-data 1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for radar-data 1.6
File Size Uploaded
radar_data-1.6.tar.gz 3.5 MB Details

Release files / radar_data-1.6.tar.gz

Download URL radar_data-1.6.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
0e9dedcd60e903d9868237e1e4136ea85491084a4809e7a81164fc06c7763896
BLAKE2b-256 checksum
How to use checksums
1e1d12b1d8297db4ae48e4fd3921b66a9ae8a6c8652f60cc48736fc29e371814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.6 This release

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0.0

1 release file

0.9.24

1 release file

0.9.23

1 release file

0.9.22

1 release file

0.9.21

1 release file

0.9.20

1 release file

0.9.19

1 release file

0.9.18

1 release file

0.9.17

1 release file

0.9.16

1 release file

0.9.15

1 release file

0.9.14

1 release file

0.9.13

1 release file

0.9.12

1 release file

0.9.11

1 release file

0.9.10

1 release file

0.9.9

1 release file

0.9.8

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9

1 release file

0.1

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page