def movie(self, di=10, coord='latlon', land="nice"): mv = anim.Movie() for jd in self.jdvec: print self.jdvec[-1] - jd if jd / di == float(jd) / di: self.scatter(jd=jd, coord=coord, land=land) mv.image() mv.video(self.projname + self.casename + "_mov.mp4")
def saltmovie(tr): mv = anim.Movie() ints = np.sort(np.unique(tr.ints)) for i in ints[:40]: pl.pcolormesh(miv(tr.traj2grid('z',tr.jd==i)),cmap=cm.Paired) pl.clim(28,33) print i mv.image() mv.video(tr.projname+tr.casename+"_salt_mov.mp4")
def double_movie(tr1, tr2, di=10): mv = anim.Movie() ints = np.intersect1d(tr1.ints, tr2.ints).sort() for i in ints: if i / di == float(i) / di: tr1.scatter(ints=i, c="b", clf=True) tr2.scatter(ints=i, c="r", clf=False) mv.image() mv.video(tr1.projname + tr1.casename + "_" + tr2.projname + tr2.casename + "_mov.mp4")
def movie(self, di=10, coord='latlon', land="nice"): mv = anim.Movie() jdvec = np.sort(self.jdvec) for jd in jdvec: if len(self.jd[self.jd == jd]) <= 1: continue print jdvec[-1] - jd if jd / di == float(jd) / di: self.scatter(jd=jd, coord=coord, land=land) mv.image() mv.video(self.projname + self.casename + "_mov.mp4")
def movie(self, jd1, jd2, field='chl'): """Create a movie of the daily changes in tracer""" mv = anim.Movie() for jd in np.arange(jd1,jd2+1): t1 = dtm.now() print "Images left: ", jd2-jd self.map2grid(field=field, jd=jd) self.pcolor(self.dfld, jd) mv.image() print "Delta time: ", dtm.now() - t1 mv.video(self.projname + "_" + field + "_mov.mp4",r=2)
def movie(self,fld, jdvec, k=0, c1=0,c2=10): """Create a movie of a field """ import anim mv = anim.Movie() for n,jd in enumerate(jdvec): self.load(fld,jd=jd) pl.clf() self.pcolor(self.__dict__[fld][k,:,:]) pl.clim(c1, c2) pl.colorbar(pad=0,aspect=40) pl.title('%s %s' % (fld, pl.num2date(jd) .strftime('%Y-%m-%d %H:%M'))) mv.image() mv.video()