Пример #1
0
    def to_file(self, filename, projection, coord_mode='com'):
        '''Format is: epoch, x, y, intensity, snr, scale'''
        l = []
        for ms_segments in self:
            epoch = float(nputils.datetime_to_epoch(ms_segments.get_epoch()))
            for segments in ms_segments:
                scale = projection.mean_pixel_scale() * segments.get_scale()
                for feature in segments:
                    x, y = projection.p2s(p2i(feature.get_coord(mode=coord_mode)))
                    intensity = feature.get_intensity()
                    snr = feature.get_snr()
                    l.append([epoch, x, y, intensity, snr, scale])

        np.savetxt(filename, l, ["%f", "%.5f", "%.5f", "%.6f", "%.6f", "%f"], delimiter=' ')
        print "Saved MultiScaleImageSet @ %s" % filename
Пример #2
0
    def to_file(self, filename, projection, coord_mode='com'):
        '''Format is: epoch, x, y, intensity, snr, scale'''
        l = []
        for ms_segments in self:
            epoch = float(nputils.datetime_to_epoch(ms_segments.get_epoch()))
            for segments in ms_segments:
                scale = projection.mean_pixel_scale() * segments.get_scale()
                for feature in segments:
                    x, y = projection.p2s(
                        p2i(feature.get_coord(mode=coord_mode)))
                    intensity = feature.get_intensity()
                    snr = feature.get_snr()
                    l.append([epoch, x, y, intensity, snr, scale])

        np.savetxt(filename,
                   l, ["%f", "%.5f", "%.5f", "%.6f", "%.6f", "%f"],
                   delimiter=' ')
        print "Saved MultiScaleImageSet @ %s" % filename