Skip to content

Commit

Permalink
mv read_auto function to io/__init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
YvZheng committed Dec 16, 2020
1 parent 02f4e01 commit d447566
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
21 changes: 20 additions & 1 deletion pycwr/io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
from . import SCFile, WSR98DFile, SABFile, CCFile
from .auto_io import read_auto
from .util import radar_format

__all__ = ["read_auto", "CCFile", "SCFile", "WSR98DFile", "SABFile"]

def read_auto(filename, station_lon=None, station_lat=None, station_alt=None):
"""
:param filename: radar basedata filename
:param station_lon: radar station longitude //units: degree east
:param station_lat: radar station latitude //units:degree north
:param station_alt: radar station altitude //units: meters
"""
radar_type = radar_format(filename)
if radar_type == "WSR98D":
return WSR98DFile.WSR98D2NRadar(WSR98DFile.WSR98DBaseData(filename, station_lon, station_lat, station_alt)).ToPRD()
elif radar_type == "SAB":
return SABFile.SAB2NRadar(SABFile.SABBaseData(filename, station_lon, station_lat, station_alt)).ToPRD()
elif radar_type == "CC":
return CCFile.CC2NRadar(CCFile.CCBaseData(filename, station_lon, station_lat, station_alt)).ToPRD()
elif radar_type == "SC":
return SCFile.SC2NRadar(SCFile.SCBaseData(filename, station_lon, station_lat, station_alt)).ToPRD()
else:
raise TypeError("unsupported radar type!")
22 changes: 0 additions & 22 deletions pycwr/io/auto_io.py

This file was deleted.

0 comments on commit d447566

Please sign in to comment.