pydarn.radar.radStruct

Module: pydarn.radar.radStruct

Radar structures

Classes:
class pydarn.radar.radStruct.network[source]

This class stores information from all radars according to their hdw.dat and radar.dat This information is read from the radar.sqlite files provided with the pydarn module.

Members:
  • nradar (int): number of radars in class
  • radars (list): list of radar objects
Methods:
  • network.getRadarById()
  • network.getRadarByName()
  • network.getRadarByCode()
  • network.getRadarsByPosition()
  • network.getAllCodes()
Example:
obj = pydarn.radar.network()

Note

To add your own radar information to this class you can use the radInfoIO.radarRead() and the radInfoIO.hdwRead(). Then, manually append the output of these functions to this object.

written by Sebastien, 2012-08

getAllCodes(datetime=None, hemi=None)[source]

Get a list of all active radar codes

Belongs to: network

Args:
  • [datetime]: python datetime object (defaults to today)
  • [hemi]: ‘north’ or ‘south’ defaults to both
Returns:
  • codes (list): A list of 3-letter codes

written by Sebastien, 2012-08

getRadarBy(radN, by)[source]

Get a specific radar from its name/code/id This method is the underlying function behing getRadarByCode, getRadarByName and getRadarById

Belongs to: network

Args:
  • radN (str/int): radar identifier (either code, name or id)
  • by (str): look-up method: ‘code’, ‘name’, ‘id’
Returns:
  • radar (radar)

written by Sebastien, 2012-08

getRadarByCode(code)[source]

Get a specific radar from its 3-letter code

Belongs to: network

Args:
  • code (str): radar 3-letter code
Returns:
  • radar (radar)
Example:
# To get the Blackstone radar by its code
radar = obj.getRadarById('bks')

written by Sebastien, 2012-08

getRadarById(id)[source]

Get a specific radar from its ID

Belongs to: network

Args:
  • id (int): radar ID
Returns:
  • radar (radar)
Example:
# To get the Blackstone radar by its ID
radar = obj.getRadarById(33)

written by Sebastien, 2012-08

getRadarByName(name)[source]

Get a specific radar from its name

Belongs to: network

Args:
  • name (str): radar full name
Returns:
  • radar (radar)
Example:
# To get the Blackstone radar by its name
radar = obj.getRadarById('Blackstone')

written by Sebastien, 2012-08

getRadarsByPosition(lat, lon, alt, distMax=4000.0, datetime=None)[source]

Get a list of radars able to see a given point on Earth

Belongs to: network

Args:
  • lat: latitude of given point in geographic coordinates
  • lon: longitude of given point in geographic coordinates
  • alt: altitude of point above the Earth’s surface in km
  • [distMax]: maximum distance of given point from radar
  • [datetime]: python datetime object (defaults to today)
Returns:
  • A dictionnary with keys:
    • ‘radars’: a list of radar objects (radar)
    • ‘dist’: a list of distance from radar to given point (1 per radar)
    • ‘beam’: a list of beams (1 per radar) seeing the given point
Example:
radars = obj.getRadarsByPosition(67., 134., 300.)

written by Sebastien, 2012-08

class pydarn.radar.radStruct.radar(code=None, radId=None)[source]

Reads radar.dat file and hdw.dat for a given radar and fills a radar structure

Members:
  • id (int): radar ID
  • status (int): radar status (active, inactive or planned)
  • cnum (int): number of code names (usually 2, a 3-letter and 1-letter)
  • code (list): list of radar codes (usually 2, a 3-letter and 1-letter)
  • name (str): radar name
  • operator (str): PI institution
  • hdwfname (str): hdw.dat file name
  • stTime (datetime.datetime): date of first lights
  • edTime (datetime.datetime): last day of operations
  • snum (int): number of site objects (i.e. number of updates to the hdw.dat)
  • sites (list): list of site objects
Methods:
  • radar.fillFromSqlite()
  • radar.getSiteByDate()
Example:
obj = pydarn.radar.radar()

written by Sebastien, 2012-08

fillFromSqlite(dbname, radId)[source]

fill radar structure from sqlite DB

Belongs to: radar

Args:
  • dbname (str): sqlite database path/name
  • radID (int): radar ID
Returns:
  • None

written by Sebastien, 2013-02

getSiteByDate(datetime)[source]

Get a specific radar site at a given date

Belongs to: network

Args:
  • datetime (datetime.datetime)
Returns:
  • site (site)
Example:
# To get the Blackstone radar configuration today
site = obj.getSiteByDate(datetime.datetime.utcnow())

written by Sebastien, 2012-08

class pydarn.radar.radStruct.site(radId=None, code=None, dt=None)[source]

Reads hdw.dat for a given radar and fills a SITE structure

Members:
  • tval (datetime.datetime): last date and time operating with these parameters
  • geolat (float): main array latitude [deg]
  • geolon (float): main array longitude [deg]
  • alt (float): main array altitude [km]
  • boresite (float): boresight azimuth [deg]
  • bmsep (float): beam separation [deg]
  • vdir (int): velocity sign
  • atten (float): Analog Rx attenuator step [dB]
  • tdiff (float): Propagation time from interferometer array antenna to phasing matrix [us]
  • phidiff (float): phase sign for interferometric calculations
  • interfer (list): Interferometer offset [x, y, z]
  • recrise (float): Analog Rx rise time [us]
  • maxatten (int): maximum number of analog attenuation stages
  • maxgate (int): maximum number of range gates (assuming 45km gates)
  • maxbeam (int): maximum number of beams
Methods:
  • site.fillFromSqlite()
  • site.beamToAzim()
  • site.azimToBeam()
Example:
obj = pydarn.radar.site()

written by Sebastien, 2012-08

azimToBeam(azim)[source]

Get azimuth of given beam

Args:
  • azim (float): beam azimuth [deg. East]
Returns:
  • beam (int): beam number
beamToAzim(beam)[source]

Get azimuth of given beam

Args:
  • beam (int): beam number
Returns:
  • azim (float): beam azimuth
fillFromSqlite(dbname, radId, ind=-1, dt=None)[source]

fill site structure from sqlite databse

Belongs to: site

Args:
  • dbname (str): sqlite database path/name
  • radID (int): radar ID
  • [ind] (int): site index; defaults to most recent configuration
  • [dt] (datetime.datetime)
Returns:
  • None

written by Sebastien, 2013-02

pydarn.radar.radStruct

alias of pydarn.radar.radStruct

Previous topic

pydarn.radar

Next topic

pydarn.radar.radFov

This Page