cinrad.io package

cinrad.io.base module

class cinrad.io.base.RadarBase[source]

Bases: ABC

Base class for readers in cinrad.io. Only used when subclassed

available_product(tilt: int) list[source]

Get all available products in given tilt

cinrad.io.level2 module

class cinrad.io.level2.CinradReader(file: Any, radar_type: Optional[str] = None)[source]

Bases: RadarBase

Class reading old-version CINRAD data.

Args:

file (str, IO): Path points to the file or a file object.

radar_type (str): Type of the radar.

file_name (str): Name of the file, only used when file argument is a file object.

get_azimuth_angles(scans: Optional[int] = None) ndarray[source]

Get index of input azimuth angle (radian)

get_data(tilt: int, drange: Union[int, float], dtype: str) Dataset[source]

Get radar data with extra information

Args:

tilt (int): Index of elevation angle starting from zero.

drange (float): Radius of data.

dtype (str): Type of product (REF, VEL, etc.)

Returns:

xarray.Dataset: Data.

get_nrays(scan: int) int[source]

Get number of radials in certain scan

get_raw(tilt: int, drange: Union[int, float], dtype: str) Union[ndarray, tuple][source]

Get radar raw data

Args:

tilt (int): Index of elevation angle starting from zero.

drange (float): Radius of data.

dtype (str): Type of product (REF, VEL, etc.)

Returns:

numpy.ndarray or tuple of numpy.ndarray: Raw data

projection(reso: float, h_offset: bool = False) tuple[source]

Calculate the geographic coordinates of the requested data range.

class cinrad.io.level2.PhasedArrayData(file)[source]

Bases: RadarBase

get_data(tilt: int, drange: Union[int, float], dtype: str) Dataset[source]

Get radar data with extra information

Args:

tilt (int): Index of elevation angle starting from zero.

drange (float): Radius of data.

dtype (str): Type of product (REF, VEL, etc.)

Returns:

xarray.Dataset: Data.

get_raw(tilt: int, drange: Union[int, float], dtype: str) Union[ndarray, tuple][source]

Get radar raw data

Args:

tilt (int): Index of elevation angle starting from zero.

drange (float): Radius of data.

dtype (str): Type of product (REF, VEL, etc.)

Returns:

numpy.ndarray or tuple of numpy.ndarray: Raw data

class cinrad.io.level2.StandardData(file: Any)[source]

Bases: RadarBase

Class reading data in standard format.

Args:

file (str, IO): Path points to the file or a file object.

available_tilt(product: str) List[int][source]

Get all available tilts for given product

get_data(tilt: int, drange: Union[int, float], dtype: str) Dataset[source]

Get radar data with extra information

Args:

tilt (int): Index of elevation angle starting from zero.

drange (float): Radius of data.

dtype (str): Type of product (REF, VEL, etc.)

Returns:

xarray.Dataset: Data.

get_raw(tilt: int, drange: Union[int, float], dtype: str) Union[ndarray, tuple][source]

Get radar raw data

Args:

tilt (int): Index of elevation angle starting from zero.

drange (float): Radius of data.

dtype (str): Type of product (REF, VEL, etc.)

Returns:

numpy.ndarray or tuple of numpy.ndarray: Raw data

classmethod merge(files: List[str], output: str)[source]

Merge single-tilt standard data into a volumetric scan

Args:

files (List[str]): List of path of data to be merged

output (str): The file path to store the merged data

cinrad.io.level3 module

class cinrad.io.level3.PUP(file: Any)[source]

Bases: RadarBase

Class handling PUP data (Nexrad Level III data)

Args:

file (str, IO): Path points to the file or a file object.

get_data() Dataset[source]

Get radar data with extra information.

Returns:

xarray.Dataset: Data.

class cinrad.io.level3.SWAN(file: Any, product: Optional[str] = None)[source]

Bases: object

Class reading SWAN grid data.

Args:

file (str, IO): Path points to the file or a file object.

get_data(level: int = 0) Dataset[source]

Get radar data with extra information

Args:

level (int): The level of reflectivity data. Only used in 3DREF data.

Returns:

xarray.Dataset: Data.

class cinrad.io.level3.StandardPUP(file)[source]

Bases: RadarBase

cinrad.io.export module