gme.ind.omni

Module: gme.ind.omni

Classes:
  • omniRec
Functions:
  • readOmni()
  • readOmniFtp()
  • mapOmniMongo()
gme.ind.omni.mapOmniMongo(sYear, eYear=None, res=5)[source]

This function reads omni data from the NASA SPDF FTP server via anonymous FTP connection and maps it to the 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
  • [res] (int): the time resolution for mapping data. Can be either 1 or 5. default=5
Returns:
  • Nothing.
Example:
gme.ind.mapOmniMongo(1997,res=1)

written by AJ, 20130123

class gme.ind.omni.omniRec(ftpLine=None, res=None, dbDict=None)[source]

a class to represent a record of omni data. Extends gmeBase.gmeData. Insight on the class members can be obtained from the NASA SPDF site. note that Omni data is available from 1995-present day (or whatever the latest NASA has uploaded is), in 1 and 5 minute resolution.

Warning

AE,AL,AU,SYM/H,SYM/D,ASYM/H,and ASYM/D are included in the omni files and thus are read into this class. I cannot verify the quality of these indices distributed with Omni data. For quality assurance on these indices, use the functions in the gme.mag.indices module.

Members:
  • time (datetime): an object identifying which time these data are for
  • dataSet (str): the name of the data set
  • res (int): the time resolution of the data, in minutes
  • timeshift (int): timeshift from ACE to bowshock
  • bMagAvg (float): average IMF B magnitude, nT
  • bx (float): IMF Bx, nT
  • bye (float): IMF By (GSE), nT
  • bze (float): IMF Bz (GSE), nT
  • bym (float): IMF By (GSM), nT
  • bzm (float): IMF Bz (GSM), nT
  • flowSpeed (float): plasma flow speed, km/s
  • vxe (float): velocity in x direction (GSE), km/s
  • vye (float): velocity in y direction (GSE), km/s
  • vze (float): velocity in z direction (GSE), km/s
  • np (float): proton density, n/cc
  • temp (float): temperature in K
  • pDyn (float): Flow pressure nPa
  • e (float): Electric field, mV/m
  • beta (float): Plasma Beta
  • machNum (float): Alfven mach number
  • ae (float): AE index, nT
  • al (float): AL index, nT
  • au (float): AU index, nT
  • symd (float): SYM/D index, nT
  • symh (float): SYM/H index, nT
  • asyd (float): ASY/D index, nT
  • asyh (float): ASY/H index, nT
  • info (str): information about where the data come from. Please be courteous and give credit to data providers when credit is due.

Note

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

Methods:
  • parseFtp()
Example:
emptyOmniObj = gme.ind.omniRec()

written by AJ, 20130128

parseFtp(line)[source]

This method is used to convert a line of omni data read from the NASA SPDF FTP site into a omniRec object.

Note

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

Belongs to: omniRec

Args:
  • line (str): the ASCII line from the FTP server
Returns:
  • Nothing.
Example:
myOmniObj.parseFtp(ftpLine)

written by AJ, 20130123

gme.ind.omni.readOmni(sTime, eTime=None, res=5, bx=None, bye=None, bze=None, bym=None, bzm=None, pDyn=None, ae=None, symh=None)[source]

This function reads omni data. First, it will try to get it from the mongodb, and if it can’t find it, it will look on the NASA SPDF FTP server using readOmniFtp()

Args:
  • sTime (datetime or None): the earliest time you want data for
  • [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
  • [res] (int): the time reolution of data desired. This can be either 1 or 5. default = 5
  • [bx] (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 bx values in the range [a,b] will be returned. default = None
  • [bx] (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 bx values in the range [a,b] will be returned. default = None
  • [bye] (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 bye values in the range [a,b] will be returned. default = None
  • [bze] (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 bze values in the range [a,b] will be returned. default = None
  • [bym] (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 bym values in the range [a,b] will be returned. default = None
  • [bzm] (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 bzm values in the range [a,b] will be returned. default = None
  • [pDyn] (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 pDyn values in the range [a,b] will be returned. default = None
  • [ae] (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 ae values in the range [a,b] will be returned. default = None
  • [symh] (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 symh values in the range [a,b] will be returned. default = None
Returns:
  • omniList (list or None): if data is found, a list of omniRec objects matching the input parameters is returned. If no data is found, None is returned.
Example:
import datetime as dt
omniList = gme.ind.readOmni(sTime=dt.datetime(2011,1,1),eTime=dt.datetime(2011,6,1),bx=[0,5.5],bye=[-1,3.5],bze=[-10,0],ae=[0,56.3])

written by AJ, 20130128

gme.ind.omni.readOmniFtp(sTime, eTime=None, res=5)[source]

This function reads omni data from the NASA SPDF server via anonymous FTP connection.

Warning

You should not use this. Use the general function readOmni() 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
  • [res] (int): the time resolution of the data you want. Must be either 1 or 5. default=5
Returns:
  • omniList (list or None): if data is found, a list of omniRec objects matching the input parameters is returned. If no data is found, None is returned.
Example:
import datetime as dt
omniList = gme.ind.readOmniFtp(dt.datetime(2011,1,1,1,50),eTime=dt.datetime(2011,1,1,10,0),res=5)

written by AJ, 20130128

gme.ind.omni

alias of gme.ind.omni

Previous topic

gme.ind.kp

Next topic

gme.ind.dst

This Page