irfpy.swim.swim_start

swim_start package is a collection for analyzing SWIM start counter. SWIM start counter is the most outer counter for SWIM. But since start counter is placed after the energy separation, the data is really useful for scientific analysis, while no mass analysis is available.

In this module, softwares providing SWIM start counter are implemented. Importing swim_start package, and use getdata(), getdeflux(), getvdf() functions. SwimEnergy, SwimFov, and SwimTime modules are also useful.

Problems: swim_start package has yet a problem. Main problem is memory leak. Multiple swim_start.getdata() causes a terrible memory leak. Most probably the problem occurs in Sadppac package or the interface with Python. I haven’t specified suspective point in the code… The work is progressed in the branch of memory_leak_swimstart.

irfpy.swim.swim_start.getobstime(orbit=None, timerange=None)[source]

Obtain the observation time of SWIM for specified orbit (primary) or specified time range (secondary).

@se SwimDataCache##getObstime() method.

irfpy.swim.swim_start.getdata(t, filter=[])[source]

Obtain SWIM start count rate data of the specified time.

If no data is available, RuntimeError is returned. @param t Time @param filter A list of callable to filter the data matrix. @retval JdObject instance with E=16xD=16 numpy.array object.

Filter:

Some useful filters are implemented in filter class. You can use it like getdata(datetime(2009,1,25,15,0,0), filter=[filter.remove_one_count, ])

Customized filter functions can be made. The callable have to have an argument of (16,16) shaped numpy-array, and returns (16,16) shaped numpy-array.

class irfpy.swim.swim_start.filter[source]

Bases: object

Collection of filters to be set to the count rate.

info = ''
classmethod remove_one_count(raw)[source]

All the bin with count ‘1’ is set to be ‘0’. Dark count can provide occasionally count=1.

classmethod remove_isolated_one_count(raw)[source]

A bin with count ‘1’ is set to be ‘0’ if the four-neighbors of the bin are 0.

This is more preferable way than self.remove_one_count, but takes computer time.

classmethod remove_background_5numsum(raw, factor=1.0)[source]

Remove a background using 5 value summary.

Median is considered as a background level. Maximum inner fence is considered as a threshold of the background level.

irfpy.swim.swim_start.getdeflux1cnt(strategy='draft_simple_gfactor', etblVersion=2)[source]

Returns the one count level for SWIM start counter.

@retval One count level in E=16xD=16 numpy array.

irfpy.swim.swim_start.getdeflux(time_dt, strategy='draft_simple_gfactor', etblVersion=2, filter=[])[source]

Obtain differential flux from SWIM start counter.

@param strategy You can specify the strategy to be used. Presently only “draft_simple_gfactor” is available and is the default. @param filter You can specify a list of ‘callable’ in this argument. This is called after getting the raw data to pre-process. Refer to self.getdata() method for details. @retval Differentian energy flux in the unit of [# / cm^2 sr s eV] for E=16xD=16 matrix. @exception If no data is available, RuntimeError is returned as self.getdata() returns. @exception If the obtained data is not in maximum mode(16x16), RuntimeError is returned.

Strategy:
“draft_simple_gfactor”:

Using draft values of g-factor. Relative efficiencies between looking directions are supported. But relative difference of g-factor in energy bin directions are not supported. It uses G0(avg) = 5e-5 [cm^2 sr eV/eV] for absolute value (SwimGfact.getSimpleAbsG0()). Anycase, G0(avg) is in the errors of G0 in the draft cal rep issued in July 2009.

irfpy.swim.swim_start.getvdf1cnt(strategy='draft_simple_gfactor', etblVersion=2)[source]

Returns the one count level for SWIM start counter.

@param strategy You can specify the strategy to be used. Presently only “draft_simple_gfactor” is available and is the default. Refer to self.getdeflux() method for details.

irfpy.swim.swim_start.getvdf(time_dt, strategy='draft_simple_gfactor', etblVersion=2, filter=[])[source]

Returns velocity distribution function from SWIM start counter.

@param strategy You can specify the strategy to be used. Presently only “draft_simple_gfactor” is available and is the default. Refer to self.getdeflux() method for details. @param filter You can specify a list of ‘callable’ in this argument. This is called after getting the raw data to pre-process. Refer to self.getdata() method for details. @retval Differentian energy flux in the unit of [ / m^6 s^3] for E=16xD=16 matrix. @exception If no data is available, RuntimeError is returned as self.getdata() returns. @exception If the obtained data is not in maximum mode(16x16), RuntimeError is returned.

irfpy.swim.swim_start.clearCache()[source]
irfpy.swim.swim_start.statusCache()[source]