irfpy.swim.swimio

This is a packet that treats the SWIM data (counts, flux, and so on).

class irfpy.swim.swimio.SwimCounterData[source]

Bases: object

Abstract class for SWIM counter data.

class irfpy.swim.swimio.SwimCounterDataV1[source]

Bases: irfpy.swim.swimio.SwimCounterData

The implementation, version 1.

Version 1 only contains the observation time (datetime object) and the count rate (E=16xD=16 numpy array). Only 16x16 data is processed. If there are no data available, -1 is recorded.

The data can be accessed by the attribute of utc and cnt. You can also even set the cnt directly through the attribute.

setData(ut, arr16x16)[source]
setFromPacket(packet, counter=0)[source]

Set the contents of the instance from the packet.

The packet contents are directly loaded to the instance. This is a specialized method, and no manipulation of the count data is possible. Youmay use setData() method to make general way of setting data to the instance.

setFromString(str)[source]

Set the contents of the instance from the string.

The string, which is formatted by __str__() method, is analyzed and the contents of the string is loaded to the string. In this sense, this is the inverse function of __str__().

irfpy.swim.swimio.dump_v1(arrSwimCounterDataV1, file, header=None)[source]

Dump the array of SwimCounterData into the

irfpy.swim.swimio.load_v1(file)[source]

Loader of the file, version 1.

irfpy.swim.swimio.dump(arrSwimCounterData, file, version=1, *arg, **kwds)[source]

Dump swim packet to the specified file.

swimpacket is an object of SWIM packet. file is the file descripter, i.e. instance which has write() method. If version is specified, the corresponding version of the dump method is used.

irfpy.swim.swimio.load(file, *arg, **kwds)[source]

Load swim packet to the specified file.