def _read_centroid_from_ndk_string(self, ndk_string, hypocentre):
        """
        Reads the centroid data from the ndk string to return an
        instance of the GCMTCentroid class
        :param str ndk_string:
            String of data (line 3 of ndk format)
        :param hypocentre:
            Instance of the GCMTHypocentre class
        """
        centroid = GCMTCentroid(hypocentre.date,
                                hypocentre.time)

        data = ndk_string[:58].split()
        centroid.centroid_type = data[0].rstrip(':')
        data = [float(x) for x in data[1:]]
        time_diff = data[0]
        if fabs(time_diff) > 1E-6:
            centroid._get_centroid_time(time_diff)
        centroid.time_error = data[1]
        centroid.latitude = data[2]
        centroid.latitude_error = data[3]
        centroid.longitude = data[4]
        centroid.longitude_error = data[5]
        centroid.depth = data[6]
        centroid.depth_error = data[7]
        centroid.depth_type = ndk_string[59:63]
        centroid.centroid_id = ndk_string[64:]
        return centroid
def _read_centroid_from_ndk_string ( self , ndk_string , hypocentre ) : centroid = GCMTCentroid ( hypocentre . date , hypocentre . time ) data = ndk_string [ : 58 ] . split ( ) centroid . centroid_type = data [ 0 ] . rstrip ( ':' ) data = [ float ( x ) for x in data [ 1 : ] ] time_diff = data [ 0 ] if fabs ( time_diff ) > 1E-6 : centroid . _get_centroid_time ( time_diff ) centroid . time_error = data [ 1 ] centroid . latitude = data [ 2 ] centroid . latitude_error = data [ 3 ] centroid . longitude = data [ 4 ] centroid . longitude_error = data [ 5 ] centroid . depth = data [ 6 ] centroid . depth_error = data [ 7 ] centroid . depth_type = ndk_string [ 59 : 63 ] centroid . centroid_id = ndk_string [ 64 : ] return centroid
Reads the centroid data from the ndk string to return an
        instance of the GCMTCentroid class
        :param str ndk_string:
            String of data (line 3 of ndk format)
        :param hypocentre:
            Instance of the GCMTHypocentre class