Пример #1
0
### import modules ###
#local module for project
from directory_master import Foldermap
folder = Foldermap()
folder.activate_environ()
#GCE calculation and local visualization module
from omega import omega
from visualize import visualize
#get some bestfit-value from 'Eris'
from bestfit_param_omega.find_bestfit_param_v0.set_param_from_eris import *
#get values and filename from document
from read_parameter_space import read_param

#Set cmdline arguments
try:
    from sys import argv
    n = int(argv[1])
except IndexError:
    n = 10

#Run calculations of GCE with 'Omega'
timesteps = n
loa_inflow_vals, save_name = read_param(
    "inflow_rate")  #get values from 'parameter_space.txt'
print "Using inflow values: ", loa_inflow_vals
bestfit_mgal = 1.0e+10
loa_omega_inst = [
    omega(special_timesteps=timesteps,
          in_out_control=True,
          inflow_rate=inflow,
          imf_type=bestfit_imf_type,
Пример #2
0
"""
Description:
-Make a class that inherits everything from omega or sygma
-change the functions that uses sygma to get yields
-add a funky factor to the yields of a single isotope
"""
######################################
### Various imports and structures ###
######################################
#get folder-handling-script
from directory_master import Foldermap
folder = Foldermap()
folder.activate_environ() #set environment for omega before importing
#NuPyCEE one-zone chemical evolution code
from omega import *
#use pandas for data-storage
import pandas as pd
#import namespace of the default bestfit-parameters
import bestfit_param_omega.bestfit_file as default_bestfit_namespace

#####################################################
### Class inheriting omega for experimental usage ###
#####################################################
class experiment(omega):
    def __init__(self, input_isotope='Re-187', input_factor=1.0,
                 input_timesteps=30, dt=0,
                 bestfit_namespace=default_bestfit_namespace):
        self.experiment_isotope = input_isotope
        self.experiment_factor = input_factor
        
        ### initialize omega ###
Пример #3
0
"""
Purpose:
Make a class that that inherits from 'Omega', 
takes a 'namespace' as argument and call on 'Omega' with all the 
parameters from 'namespace'.
Also add a function for saving relevant data to a 2D numpy-matrix.

Description:
"""

#get folder-handling-script
from directory_master import Foldermap
folder = Foldermap()
folder.activate_environ()  #set environment/directory for omega
#NuPyCEE one-zone chemical evolution code
from omega import omega


class child_omega(omega):
    def __init__(self, bestfit_namespace):
        omega.__init__(
            self,
            galaxy=bestfit_namespace.bestfit_galaxy,
            in_out_control=bestfit_namespace.bestfit_in_out_control,
            SF_law=bestfit_namespace.bestfit_SF_law,
            DM_evolution=bestfit_namespace.bestfit_DM_evolution,
            Z_trans=bestfit_namespace.bestfit_Z_trans,
            f_dyn=bestfit_namespace.bestfit_f_dyn,
            sfe=bestfit_namespace.bestfit_sfe,
            outflow_rate=bestfit_namespace.bestfit_outflow_rate,
            inflow_rate=bestfit_namespace.bestfit_inflow_rate,
Пример #4
0
"""
Plot the current bestfit-parameters, in 'current_bestfit.py'.
Then add the plots to a folder, 'current_bestfit_plots/'.

Input arguments:
  n: int
    Number of special-timesteps.
    A value of zero disables special timesteps, 
    meaning constant timesteps.
"""
### Get modules ###
import sys, time
from directory_master import Foldermap #structure of directory
folder = Foldermap()
folder.activate_environ() #set NuPyCEE-folder
from omega import omega #GCE
from visualize import visualize #visualization of Omega and Eris
from bestfit_param_omega.current_bestfit import *

### User-made exception ###
class Wtf(Exception):
    def __init__(self):
        print "What the F**K did you do?!"
        sys.exit("Exiting!")

### Set global parameters ###
n = 5
save_dir = "current_bestfit_plots/"
try:
    n = int(sys.argv[1])
except: