def cache_underlying_models(self, cacheDir): self._main_se = CachedStellarEvolution(self._main_se, cacheDir) self._fallback_se = CachedStellarEvolution(self._fallback_se, cacheDir)
dest="plot_filename", help="Name of the file to plot to" ) return result if __name__ == '__main__': if not is_mpd_running(): print("There is no mpd server running. Please do 'mpd &' first.") sys.exit() parser = new_commandline_option_parser() (options, arguments) = parser.parse_args() if arguments: parser.error("unknown arguments '{0}'".format(arguments)) mass_list = [0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0] | units.MSun code = new_code(options.code, len(mass_list)) if not (options.cacheDir is None): print("Using cache directory: %s" % (options.cacheDir)) # As a special case, we use caching of the underlying models instead of # the model output for EVtwin2SSE if (options.code == "evtwin2sse"): code.cache_underlying_models(options.cacheDir) else: code = CachedStellarEvolution(code, options.cacheDir) simulate_evolution_tracks( code, masses=mass_list, name_of_the_figure=options.plot_filename )
def cache_underlying_models(self, cacheDir): self._EVtwin = CachedStellarEvolution(self._EVtwin, cacheDir) self._SSE = CachedStellarEvolution(self._SSE, cacheDir)