@classmethod<EOL><INDENT>def from_nds2(cls, nds2channel):<DEDENT>
<EOL>name = nds2channel.name<EOL>sample_rate = nds2channel.sample_rate<EOL>unit = nds2channel.signal_units<EOL>if not unit:<EOL><INDENT>unit = None<EOL><DEDENT>ctype = nds2channel.channel_type_to_string(nds2channel.channel_type)<EOL>dtype = {  <EOL>nds2channel.DATA_TYPE_INT16: numpy.int16,<EOL>nds2channel.DATA_TYPE_INT32: numpy.int32,<EOL>nds2channel.DATA_TYPE_INT64: numpy.int64,<EOL>nds2channel.DATA_TYPE_FLOAT32: numpy.float32,<EOL>nds2channel.DATA_TYPE_FLOAT64: numpy.float64,<EOL>nds2channel.DATA_TYPE_COMPLEX32: numpy.complex64,<EOL>}.get(nds2channel.data_type)<EOL>return cls(name, sample_rate=sample_rate, unit=unit, dtype=dtype,<EOL>type=ctype)<EOL>
Generate a new channel using an existing nds2.channel object