irfpy.swim.ace

This module is for ACE data to compare with SWIM.

ACE data, both non-shifted and shifted to the Moon position, is supported by this module. The non-shifted data was obtained from the web, and the class Ace is for it. The shifted data can be generated by ace2moon.py program in the script folder, and the program dumps it to ace2moon.dat file. The class AceMoon is for the shifted data.

The simplest way of retrieving the solar wind condition at the Moon is as follows.

>>> acemoon = AceMoon()
>>> dat = acemoon.getAverage(datetime.datetime(2009,1,25,13,0,0), datetime.datetime(2009,1,25,14,0,0))
class irfpy.swim.ace.AceElem(line)[source]

Bases: object

Class for ACE data at a time.

getJulday()[source]
classmethod getContents()[source]
getNp()[source]
getTp()[source]
getAlpha_ratio()[source]
getVp()[source]
getV_gse_x()[source]
getV_gse_y()[source]
getV_gse_z()[source]
getB_gse_x()[source]
getB_gse_y()[source]
getB_gse_z()[source]
getBmag()[source]
getpos_gse_x()[source]
getpos_gse_y()[source]
getpos_gse_z()[source]
class irfpy.swim.ace.AceElemAtMoon(aceElem)[source]

Bases: object

Ace data at Moon at an instance. Using AceElem class, the time of the Moon is calculated.

Initialize the data. ValueError is thrown if the data is not available.

getJulday()[source]
getNp()[source]
getTp()[source]
getAlpha_ratio()[source]
getVp()[source]
getV_gse_x()[source]
getV_gse_y()[source]
getV_gse_z()[source]
getB_gse_x()[source]
getB_gse_y()[source]
getB_gse_z()[source]
getBmag()[source]
getpos_gse_x()[source]
getpos_gse_y()[source]
getpos_gse_z()[source]
class irfpy.swim.ace.AceMoonData(data_tuple)[source]

Bases: object

getJulday()[source]
getNp()[source]
getTp()[source]
getAlpha_ratio()[source]
getVp()[source]
getV_gse_x()[source]
getV_gse_y()[source]
getV_gse_z()[source]
getB_gse_x()[source]
getB_gse_y()[source]
getB_gse_z()[source]
getBmag()[source]
getpos_gse_x()[source]
getpos_gse_y()[source]
getpos_gse_z()[source]
class irfpy.swim.ace.AceMoon(rcfile=None)[source]

Bases: object

Class for ACE Moon data.

The shifted ACE data is generated by ace2moon.py in script folder from the non-shifted ACE data. The ACE data can be infered to the Moon position considering the ACE and Moon position, and ace2moon.py will dump the result to shifted ace2moon.dat file. The file location can be specified by .irfpyrc, where [swim] section acemoon property.

clearCache()[source]
read(year, month, day)[source]

Read a data from cache for the specified day.

get(t)[source]
getList(start_time, stop_time)[source]

Get ACE data at Moon between start_time and stop_time. Data format is JdSeries with AceMoonData class.

getAverage(t0, t1)[source]

Returns the average and the standard deviation of the solar wind parameter.

The returned value is a tuple ( ave_np, std_np, ave_vx, std_vx, ave_vy, std_vy, ave_vz, std_vz, ave_Tp, std_Tp, ave_rHe, std_rHe, ave_bx, std_bx, ave_by, std_by, ave_bz, std_bz ) where rHe is the helium ratio.

class irfpy.swim.ace.Ace(rcfile=None)[source]

Bases: object

Class for ACE L2 MERGE data.

Data is set by irfpyrc setup file, from the entry [swim] acemerge.

read(year, month, day)[source]

Read a data from segmented ‘AceMerge.txt_yyyy_doi.gz’ file.

get(t)[source]

Get ACE data at the time of t. Data format is a JdObject with AceElem class.

getList(start_time, stop_time)[source]

Get ACE data between start_time and stop_time. Data format is JdSeries with AceElem class.

getAverage(t0, t1)[source]

Returns the average and the standard deviation of the solar wind parameter.

The returned value is a tuple ( ave_np, std_np, ave_vx, std_vx, ave_vy, std_vy, ave_vz, std_vz, ave_Tp, std_Tp, ave_rHe, std_rHe, ave_bx, std_bx, ave_by, std_by, ave_bz, std_bz ) where rHe is the helium ratio.

class irfpy.swim.ace.AceData[source]

Bases: object

Class for ACE Browse data. For L2 data, use Ace class.

You can refer to the data index by class varibales of (YEAR_F, DOY, BX, BY, BZ, BT, BP, B, NPROTON, HEPRATIO, VSW, TSW).

DEFAULT_BROWSE_URI = '/Volumes/scidata/data/moon/support/ACE/Browse/PARAM/ACE_Browse_Data.txt'
YEAR_F = 0
DOY = 1
BX = 2
BY = 3
BZ = 4
BT = 5
BP = 6
B = 7
NPROTON = 8
HEPRATIO = 9
VSW = 10
TSW = 11
LABEL = ('YEAR', 'DOY', 'Bx', 'By', 'Bz', 'Bt', 'Bp', '|B|', 'NH+', 'NHe++/NH+', 'Vsw', 'Tsw')
setFromUri(uri=None)[source]
getData(dt)[source]
getTimeseries(datetime0, datetime1, value=(2, 3, 4, 8, 10))[source]

Returns the JdObject of the dataset (subdataset) for the specified time interval.

@param[in] value Array-like to specify which values are retrieved. Default is (BX,BY,BZ,NPROTON,VSW).