Skip to content

Commit

Permalink
update version nb
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfidan committed Feb 22, 2024
2 parents c257160 + 9bb40a0 commit 8fe1eb1
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 224 deletions.
8 changes: 8 additions & 0 deletions doc/source/changelog.md
@@ -1,5 +1,13 @@
# Changelog

## v1.8.6

**Bug fixes:**
- [fixed argument warning in np.linalg.lstsq in wind.py](https://github.com/MeteoSwiss/pyart/commit/91d6f18b3ea35e9d409b77108ef5c72b76b6d58c)
- [fix matplotlib deprecation warning in pyart/config.py](https://github.com/MeteoSwiss/pyart/commit/04828552b6de62fc9343bc19f1c596f49795f6f8)
- [fixed error in bias_and_noise.py in case of missing radar.instrument_parameters](https://github.com/MeteoSwiss/pyart/commit/6d91a1f61c0a9decba458490ad316cc917a429f0)
- [fixed error in attenuation.py in case of missing radar.instrument_parameters](https://github.com/MeteoSwiss/pyart/commit/f18c0c5d64ca269604acee8c38ec4a1575aad67a)

## v1.8.5

**Bug fixes:**
Expand Down
1 change: 1 addition & 0 deletions pyart/aux_io/__init__.py
Expand Up @@ -102,6 +102,7 @@
from .mf_png_reader import read_png #noqa
from .mf_grib_reader import read_grib #noqa
from .mf_dat_reader import read_dat_mf #noqa
from .mch_dat_reader import read_mch_vad #noqa
from .hpl_reader import read_hpl #noqa

from .swissbirdradar import read_swissbirdradar_spectra #noqa
Expand Down
6 changes: 2 additions & 4 deletions pyart/aux_io/dn_to_float.py
Expand Up @@ -112,10 +112,7 @@ def float_mapping_m(moment, momhead, time, radar, nyquist_vel=None,
for every DN value
"""
if moment == 'PHI':
prd_data_level = np.arange(256 * 256, dtype=np.float32) # 2 bytes
else:
prd_data_level = np.arange(256, dtype=np.float32) # 1 byte
prd_data_level = np.arange(256 ** momhead['num_bytes'], dtype=np.float32) # 2 bytes

scale_type = momhead['scale_type']
factor_a = momhead['a']
Expand Down Expand Up @@ -155,6 +152,7 @@ def float_mapping_m(moment, momhead, time, radar, nyquist_vel=None,
prd_data_level[0] = np.nan
elif moment == 'VEL':
prd_data_level *= nyquist_vel
prd_data_level[128] = 0
prd_data_level[0] = np.nan
elif moment == 'WID':
prd_data_level *= 2 * nyquist_vel
Expand Down
42 changes: 42 additions & 0 deletions pyart/aux_io/mch_dat_reader.py
@@ -0,0 +1,42 @@
"""
pyart.aux_io.mch_dat_reader
==========================
Routines for reading MeteoSwiss operational radar data contained in text
files.
.. autosummary::
:toctree: generated/
read_mch_vad
"""

import xml.etree.ElementTree as ET

import pyart


def read_mch_vad(file_path):
tree = ET.parse(file_path)
root = tree.getroot()

header_element = root.find('HEADER')
data_element = root.find('DATA')

header_data = {}
for child in header_element:
header_data[child.tag] = child.text

data_slices = []
for slice_element in data_element.findall('slice'):
slice_data = {}
for child in slice_element:
slice_data[child.tag] = child.text
data_slices.append(slice_data)

speed = [float(slic['speed']) for slic in data_slices]
direction = [float(slic['direction']) for slic in data_slices]
height = [float(slic['height']) for slic in data_slices]

return pyart.core.HorizontalWindProfile(height, speed, direction)
2 changes: 2 additions & 0 deletions pyart/aux_io/metranet_reader.py
Expand Up @@ -121,6 +121,8 @@ def read_metranet(filename, field_names=None, rmax=0.,
supported_file = (bfile.startswith('PM') or bfile.startswith('PH') or
bfile.startswith('PL') or bfile.startswith('MS') or
bfile.startswith('MH') or bfile.startswith('ML'))
if reader == 'c':
reader = 'C'

if not supported_file:
raise ValueError(
Expand Down
212 changes: 0 additions & 212 deletions pyart/aux_io/mfile_structure_info.py

This file was deleted.

4 changes: 2 additions & 2 deletions pyart/aux_io/odim_h5_writer.py
Expand Up @@ -520,7 +520,7 @@ def write_odim_h5(filename, radar, field_names=None, physical=True,

# How variables
# General
how_var_general = ['system', 'software', 'sw_verison']
how_var_general = ['system', 'software', 'sw_version']

# Individual radar
how_var_instrument = [
Expand All @@ -538,7 +538,7 @@ def write_odim_h5(filename, radar, field_names=None, physical=True,
how_var_gen.append('system')
if 'software' in radar.metadata:
how_var_gen.append('software')
if 'sw_verison' in radar.metadata:
if 'sw_version' in radar.metadata:
how_var_gen.append('sw_version')
how1_gen_dict = _map_radar_to_how_dict(radar.metadata)
for name in how_var_gen:
Expand Down
2 changes: 1 addition & 1 deletion pyart/correct/attenuation.py
Expand Up @@ -10,7 +10,7 @@
from warnings import warn

import numpy as np
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid as cumtrapz

from ..config import get_field_name, get_fillvalue, get_metadata
from ..filters import GateFilter, iso0_based_gate_filter, temp_based_gate_filter
Expand Down

0 comments on commit 8fe1eb1

Please sign in to comment.