def draw_gif():
    for name in names:

        sp_fin = open(dir + '/%s.spec.f8'%name)
        sp = np.fromfile(sp_fin, dtype='<f8')
        sp = sp.reshape((sp.shape[0]/120, 120))
        sp = Image.fromarray(sp * 1000)
        sp.save(dir + '/%s.sp.gif'%name)

        mgc_fin = open(dir + '/%s.mgc'%name)
        mgc = np.fromfile(mgc_fin, dtype='<f4')
        mgc = mgc.reshape((mgc.shape[0]/120, 120))
        mgc = Image.fromarray(mgc * 1000)
        mgc.save(dir + '/%s.mgc.gif'%name)
dataset/ETHPy150Open hycis/Pynet/scripts/tmp.py/draw_gif/original