def choose_stars(self): for star in self.stars: star.plot_velocities(); star.plot_intensities(); isContinue = raw_input('Choose this star? (y/n/b/q)'); if isContinue == 'q': closefigs(); sys.exit(0); elif isContinue == 'b': break; elif isContinue == "y": isTryInputParameters = True; while (isTryInputParameters): param = raw_input("input your best guess for \ velocity model parameters as a list \ \"v_mean v_r P t_0\" s"); if param == "q": sys.exit(1); param = param.split(); for i in range(len(param)): param[i] = float(param[i]); print "Your input:"; print param; if isinstance(param, (list, tuple)) and len(param) == 4: star.guessedParameters = list(param); isTryInputParameters = False; else: print "Invalid parameters, try again" self.chosen_stars.append(star); elif isContinue == "n": print "Ok. Presenting next star"; closefigs(); print "No more stars";
def choose_stars(self): for star in self.stars: star.plot_velocities() star.plot_intensities() isContinue = raw_input('Choose this star? (y/n/b/q)') if isContinue == 'q': closefigs() sys.exit(0) elif isContinue == 'b': break elif isContinue == "y": isTryInputParameters = True while (isTryInputParameters): param = raw_input("input your best guess for \ velocity model parameters as a list \ \"v_mean v_r P t_0\" s") if param == "q": sys.exit(1) param = param.split() for i in range(len(param)): param[i] = float(param[i]) print "Your input:" print param if isinstance(param, (list, tuple)) and len(param) == 4: star.guessedParameters = list(param) isTryInputParameters = False else: print "Invalid parameters, try again" self.chosen_stars.append(star) elif isContinue == "n": print "Ok. Presenting next star" closefigs() print "No more stars"
def plotBySimulation(self): for i in range(len(self.simulations)): sim = self.simulations[i]; figure(i); for j in range(len(sim.states)): plot(sim.rho, sim.states[j]**2, legend=r"$\psi_{%d}, \lambda= %g$" % (j, sim.eigenvalues[j]), xlabel=r'$\frac{1}{\alpha}r$', ylabel=r'$\alpha|\psi_n|^2$') title("$\omega = %g$" %sim.omega) hold('on') raw_input("press enter") closefigs()
def plotByOmega(self, omegalimit = 0.1): for sim in self.simulations: for i in range(len(sim.states)): if sim.omega >= omegalimit: figure(i); plot(sim.rho, sim.states[i]**2, legend="$\omega= %g, \lambda= %g$" % (sim.omega, sim.eigenvalues[i]), xlabel=r'$\frac{1}{\alpha}r$', \ ylabel=r'$\alpha|\psi_n|^2$') title(r"$\psi_{%d}$" % i); hold('on') raw_input("press enter") closefigs();
def plotByOmega(self, omegalimit=0.1): for sim in self.simulations: for i in range(len(sim.states)): if sim.omega >= omegalimit: figure(i) plot(sim.rho, sim.states[i]**2, legend="$\omega= %g, \lambda= %g$" % (sim.omega, sim.eigenvalues[i]), xlabel=r'$\frac{1}{\alpha}r$', \ ylabel=r'$\alpha|\psi_n|^2$') title(r"$\psi_{%d}$" % i) hold('on') raw_input("press enter") closefigs()
def plotBySimulation(self): for i in range(len(self.simulations)): sim = self.simulations[i] figure(i) for j in range(len(sim.states)): plot(sim.rho, sim.states[j]**2, legend=r"$\psi_{%d}, \lambda= %g$" % (j, sim.eigenvalues[j]), xlabel=r'$\frac{1}{\alpha}r$', ylabel=r'$\alpha|\psi_n|^2$') title("$\omega = %g$" % sim.omega) hold('on') raw_input("press enter") closefigs()
def analyze_stars(self, destination): for star in self.chosen_stars: star.plot_fitted_velocities(destination+star.filename+".png"); star.output_data(destination+star.filename+".txt"); closefigs();
def analyze_stars(self, destination): for star in self.chosen_stars: star.plot_fitted_velocities(destination + star.filename + ".png") star.output_data(destination + star.filename + ".txt") closefigs()