Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Updated cftime import as suggested in issue #738 #799

Merged
merged 2 commits into from Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions pyart/aux_io/sinarame_h5.py
Expand Up @@ -19,11 +19,10 @@
from datetime import datetime
import glob
import os
import sys

if sys.version_info[:2] == (3, 4):
try:
from netcdftime import utime
else:
except ImportError:
from cftime import utime

import numpy as np
Expand Down
8 changes: 3 additions & 5 deletions pyart/retrieve/gate_id.py
Expand Up @@ -10,11 +10,9 @@

"""

import sys

if sys.version_info[:2] == (3, 4):
try:
from netCDF4 import num2date, datetime
else:
except ImportError:
from cftime import num2date, datetime

import numpy as np
Expand Down Expand Up @@ -58,7 +56,7 @@ def map_profile_to_gates(profile, heights, radar, toa=None,
rg, azg = np.meshgrid(radar.range['data'], radar.azimuth['data'])
rg, eleg = np.meshgrid(radar.range['data'], radar.elevation['data'])
_, _, z = antenna_to_cartesian(rg / 1000.0, azg, eleg)

# Check that z is not a MaskedArray
if type(z) is np.ma.core.MaskedArray:
z = z.filled(np.NaN)
Expand Down