Пример #1
0
    def new_from_file(file):
        core_desc = CoreOffsetPositions()
        data = np.loadtxt(file, dtype=object)

        for epoch, i, r, pa in data:
            epoch = datetime.datetime.strptime(epoch, "%Y-%m-%d")
            x, y = nputils.coord_rtheta_to_xy(float(r), np.radians(float(pa)))
            core_desc.set(epoch, [x, y])
        return core_desc
Пример #2
0
 def get_coord(self):
     ''' Return coord as index: yx'''
     return nputils.coord_rtheta_to_xy(self.radius, np.radians(self.theta))[::-1]