swirlspy.rad package

Submodules

swirlspy.rad.ascii module

swirlspy.rad.ascii.read_ascii(file, valid_time, path='')

Reads ASCII file. The data should already be in Cartesian coodinates in Regular LatLon Projection. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of ASCII file to read.
  • valid_time (str) – Time in [%Y%m%d%H%M] of the first timestep radar file.
Returns:

xr_dataarray – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.cinrad module

swirlspy.rad.cinrad.read_cinrad_sc_data(file, site, valid_time, band, area_def=None, coord_label=['x', 'y'], radar_radius=250000, xres=500, yres=500, minutize=True, path='')

Reads old version cinrad radar data (either in c-band or s-band). Returns reflectivity data as xarray.DataArray.

Parameters:
  • file (str) – Name of CINRAD file to read. Reflectivity data contained by this file should be in spherical coordinates.
  • site (tuple of floats) – (Longitude, Latitude) of radar site
  • valid_time (str) – %y%m%d%H%M of the first-timestep radar file.
  • band (str) – Band name, either “c-band” or “s-band”
  • area_def (pyresample.geometry.AreaDefinition) – Pyresample AreaDefinition of the target grid. Defaults to None.
  • coord_label (list of strings.) – [x_axis_label, y_axis_label]. Defaults to [‘x’, ‘y’].
  • radar_radius (float) – Radar radius in units of targeted projection. Default to 250000. Units in meters.
  • xres(optional) (int) – Only define if area_def is not defined. x-resolution of the default grid. Defaults to 500.
  • yres(optional) (int) – Only define if area_def is not defined. y-resolution of the default grid. Defaults to 500.
  • minutize(optional) (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
  • path (str, optional) – If provided, save the result as a NetCDF file to the path specified.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.cinrad.read_cinrad_standard_data(file, area_def=None, coord_label=['x', 'y'], radar_radius=250000, xres=500, yres=500, minutize=True, path='')

Reads cinrad standard data. Returns reflectivity data as xarray.DataArray.

Parameters:
  • file (str) – Name of CINRAD file to read. Reflectivity data contained by this file should be in spherical coordinates.
  • area_def (pyresample.geometry.AreaDefinition) – Pyresample AreaDefinition of the target grid. Defaults to None.
  • coord_label (list of strings.) – [x_axis_label, y_axis_label]. Defaults to [‘x’, ‘y’].
  • radar_radius (float) – Radar radius in units of targeted projection. Default to 250000. Units in meters.
  • xres(optional) (int) – Only define if area_def is not defined. x-resolution of the default grid. Defaults to 500.
  • yres(optional) (int) – Only define if area_def is not defined. y-resolution of the default grid. Defaults to 500.
  • minutize(optional) (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
  • path (str, optional) – If provided, save the result as a NetCDF file to the path specified.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.hdf5 module

swirlspy.rad.hdf5.read_hdf5(file, minutize=True, path='')

Reads hdf5 file. Reflectivity data should already be in Cartesian Coordinates in Azimuthal Equidistant Projection. Units are in metres for distance x and y from the radar site. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of the hdf5 file to read. Reflectivity data of this file should already be in Cartesian Coordinates.
  • minutize (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
  • path(optional) (str) – Directory to save output as a .nc file.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata. Coodinate vertices of grid can be accessed through DataArray attributes.

Return type:

xarray.DataArray

swirlspy.rad.iris module

swirlspy.rad.iris.read_iris(file, area_def=None, coord_label=['x', 'y'], radar_radius=250000, xres=500, yres=500, minutize=True, path='')

Reads Vaisala Sigmet IRIS RAW data file. Regrid radar reflectivity data from Spherical coordinates to Cartesian coordinates, in a projection specified with pyresample’s AreaDefinition. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of IRIS RAW file to read.
  • area_def (pyresample.geometry.AreaDefinition) – Pyresample AreaDefinition of the target grid. Defaults to None.
  • coord_label (list of strings.) – [x_axis_label, y_axis_label]. Defaults to [‘x’, ‘y’].
  • radar_radius (float) – Radar radius in units of targeted projection. Default to 250000. Units in meters.
  • xres(optional) (int) – Only define if area_def is not defined. x-resolution of the default grid. Defaults to 500.
  • yres(optional) (int) – Only define if area_def is not defined. y-resolution of the default grid. Defaults to 500.
  • minutize(optional) (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
  • path (str, optional) – If provided, save the result as a NetCDF file to the path specified.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.irisref module

swirlspy.rad.irisref.read_irisref(file, minutize=True, path='')

Reads Vaisala Sigmet IRIS REF data file. Data already in Cartesian Coordinates in Centered Azimuthal Projection. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of IRIS REF file to read.
  • minutize(optional) (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
  • path (str, optional) – If provided, save the result as a NetCDF file to the path specified.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.netcdf_ph module

swirlspy.rad.netcdf_ph.read_netcdf_ph(file, minutize=True)

Reads Philippine netCDF file and returns reflectivity data in xarray.DataArray. Reflectivity data should be in Cartesian Coordinates in Azimuthal Equidistant Projection. Units are in metres for distances x and y away from the radar site. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of Philippine netCDF file to read. Reflectivity should already be in Cartesian Coordinates. in Azimuthal Equidistant Projection.
  • minutize (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
Returns:

reflectivity – A labelled xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.netcdf_vn_dh module

swirlspy.rad.netcdf_vn_dh.read_netcdf_vn_dh(file, minutize=True)

Reads Vietnamese netCDF file (file name begins with “DH”). Data is already in LatLon Cartesian Coordinates. Returns an xarray.DataArray.

Parameters:
  • file (str) – Name of netCDF file to read.
  • minutize (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
Returns:

reflectivity – A labelled xarray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.netcdf_vn_don module

swirlspy.rad.netcdf_vn_don.read_netcdf_vn_don(file, area_def=None, coord_label=['x', 'y'], radar_radius=250000, xres=500, yres=500, minutize=True)

Reads Vietnamese netCDF file (file name begins with “DON”). Regrid reflectivity data from Polar coordinates to Cartesian coordinates in projection specified by AreaDefinition. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of netCDF file to read
  • area_def (pyresample.geometry.AreaDefinition) – Pyresample AreaDefinition of the target grid. Defaults to None.
  • coord_label (list of strings.) – [x_axis_label, y_axis_label]. Defaults to [‘x’, ‘y’].
  • radar_radius (float) – Radar radius in units of targeted projection. Defaults to 250000
  • xres(optional) (int) – Only define if area_def is not defined. x-resolution of the default grid. Defaults to 500.
  • yres(optional) (int) – Only define if area_def is not defined. y-resolution of the default grid. Defaults to 500.
  • minutize (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray

swirlspy.rad.uf_ph module

swirlspy.rad.uf_ph.read_uf_ph(file, area_def=None, coord_label=['x', 'y'], indicator='deg_ppi', elevation=0.5, radar_radius=250000, xres=500, yres=500, minutize=True, path='')

Reads Philippine UF file. Regrid reflectivity data from Polar coordinates to Cartesian coordinates in projection specified by AreaDefinition. Returns a labelled xarray.DataArray.

Parameters:
  • file (str) – Name of Philippine UF file to read.
  • area_def (pyresample.geometry.AreaDefinition) – Pyresample AreaDefinition of the target grid. Defaults to None.
  • coord_label (list of strings.) – [x_axis_label, y_axis_label]. Defaults to [‘x’, ‘y’].
  • indicator (str) – Plan position indicator to be visualised. Defaults to ‘deg_ppi’. Alternative is ‘cappi’.
  • elevation (float) – The elevation level in degrees to choose from. Related with parameter ‘indicator’. Units are in degrees if indicator == ‘deg_ppi’ and in km if indicator = cappi. Defaults to 0.5 degrees.
  • radar_radius (float) – Radar radius in units of targeted projection. Default is 250000. Units in meters.
  • xres(optional) (int) – Only define if area_def is not defined. x-resolution of the default grid. Defaults to 500.
  • yres(optional) (int) – Only define if area_def is not defined. y-resolution of the default grid. Defaults to 500.
  • minutize (bool) – If True, pandas.Timestamps are rounded down to the nearest minute. Defaults to True.
  • path(optional) (str) – Directory to save output as a .nc file.
Returns:

reflectivity – A xarray.DataArray populated with radar reflectivity and metadata.

Return type:

xarray.DataArray