gme.ind.dst

Module: gme.ind.dst

Classes:
Functions:
class gme.ind.dst.dstRec(webLine=None, dbDict=None)[source]

a class to represent a record of dst data. Extends gme.base.gmeBase.gmeData. Note that Dst data is available from 1980-present day (or whatever the latest WDC has uploaded is). The data are 1-hour values. Information about dst can be found here

Members:
  • time (datetime): an object identifying which time these data are for
  • dataSet (str): a string dicating the dataset this is from
  • info (str): information about where the data come from. Please be courteous and give credit to data providers when credit is due.
  • dst (float): the actual dst value

Note

If any of the members have a value of None, this means that they could not be read for that specific time

Methods:
  • parseWeb()
Example:
emptyDstObj = gme.ind.dstRec()

written by AJ, 20130131

parseWeb(line)[source]

This method is used to convert a line of dst data from the WDC to a dstRec object

Note

In general, users will not need to worry about this.

Belongs to: gme.ind.dst.dstRec

Args:
  • line (str): the ASCII line from the WDC data file
Returns:
  • Nothing.
Example:
myDstObj.parseWeb(webLine)

written by AJ, 20130131

gme.ind.dst.mapDstMongo(sYear, eYear=None)[source]

This function reads dst data from wdc and puts it in mongodb

Warning

In general, nobody except the database admins will need to use this function

Args:
  • sYear (int): the year to begin mapping data
  • [eYear] (int or None): the end year for mapping data. if this is None, eYear will be sYear
Returns:
  • Nothing.
Example:
gme.ind.mapDstMongo(1997)

written by AJ, 20130123

gme.ind.dst.readDst(sTime=None, eTime=None, dst=None)[source]

This function reads dst data from the mongodb.

Args:
  • [sTime] (datetime or None): the earliest time you want data for, default=None
  • [eTime] (datetime or None): the latest time you want data for. if this is None, end Time will be 1 day after sTime. default = None
  • [dst] (list or None): if this is not None, it must be a 2-element list of numbers, [a,b]. In this case, only data with dst values in the range [a,b] will be returned. default = None
Returns:
  • dstList (list or None): if data is found, a list of gme.ind.dst.dstRec objects matching the input parameters is returned. If no data is found, None is returned.
Example:
import datetime as dt
dstList = gme.ind.readDst(sTime=dt.datetime(2011,1,1),eTime=dt.datetime(2011,6,1),dst=[-50,50])

written by AJ, 20130131

gme.ind.dst.readDstWeb(sTime, eTime=None)[source]

This function reads dst data from the WDC kyoto website

Warning

You should not use this. Use the general function readDst() instead.

Args:
  • sTime (datetime): the earliest time you want data for
  • [eTime] (datetime or None): the latest time you want data for. if this is None, eTime will be equal to sTime. default = None
Example:
import datetime as dt
dstList = gme.ind.readDstWeb(dt.datetime(2011,1,1,1,50),eTime=dt.datetime(2011,1,1,10,0))

written by AJ, 20130131

gme.ind.dst

alias of gme.ind.dst

Previous topic

gme.ind.omni

Next topic

gme.ampere

This Page