FileFolder,
                                                        Parameter=abundance,
                                                        Assumption='float')

            #If the abundance was measure store it
            if Empty_Array[j + 1] == None:
                All_observed = False

        if All_observed:
            Valid_objects.append(array(Empty_Array, copy=True))

    return array(Valid_objects)


pv = myPickle()
dz = Plot_Conf()
ct = Cloudy_Tools()
diags = pn.Diagnostics()

#Define data type and location
Catalogue_Dic = DataToTreat()
Pattern = Catalogue_Dic['Datatype'] + '.fits'

#Define figure format
dz.FigConf(n_colors=6)

#Define script name and location
# ScriptFolder    = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Few_Models/'
ScriptFolder = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Complete_Model/'
ScriptPrefix = 'S_Ar_test'
        for j in range(len(List_Abundances)):
            abundance = List_Abundances[j]
            Empty_Array[j + 1] = pv.GetParameter_ObjLog(CodeName, FileFolder, Parameter=abundance, Assumption="float")

            # If the abundance was measure store it
            if Empty_Array[j + 1] == None:
                All_observed = False

        if All_observed:
            Valid_objects.append(array(Empty_Array, copy=True))

    return array(Valid_objects)


pv = myPickle()
dz = Plot_Conf()
ct = Cloudy_Tools()
diags = pn.Diagnostics()

# Define data type and location
Catalogue_Dic = DataToTreat()
Pattern = Catalogue_Dic["Datatype"] + ".fits"

# Define figure format
dz.FigConf(n_colors=6)

# Define script name and location
# ScriptFolder    = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Few_Models/'
ScriptFolder = "/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Complete_Model/"
ScriptPrefix = "S_Ar_test"
from CodeTools.PlottingManager              import myPickle
from Plotting_Libraries.dazer_plotter       import Plot_Conf
from numpy                                  import linspace
import seaborn as sns
import pyneb as pn

#Declare Classes
pv      = myPickle()
dz      = Plot_Conf() 

#Define figure format
dz.FigConf()

# Atom creation and definition of physical conditions
H1      = pn.RecAtom('H',1)
HeI     = pn.RecAtom('He', 1)

#Define physical conditions
tem = 10000
tem_range = linspace(10000, 25000, 100)
 
den = 0
den_range = linspace(0, 300, 200)

# Comment the second if you want all the lines to be plotted
HeI_Lines=[3889.0, 4026.0, 4471.0, 5876.0, 6678.0, 7065.0, 10830.0]


print 'Emissivity', HeI.getEmissivity(tem, 1, wave=3889.0)

#--------------------------Density case----------------------------------
import uncertainties.unumpy as unumpy
from CodeTools.PlottingManager import myPickle
from Math_Libraries.FittingTools import NumpyRegression
from Math_Libraries.linfit_script import LinfitLinearRegression
from ManageFlow import DataToTreat
from Astro_Libraries.Reddening_Corrections import ReddeningLaws
from numpy import concatenate
from Plotting_Libraries.dazer_plotter import Plot_Conf

#Declare coding classes
pv = myPickle()
Reddening = ReddeningLaws()
dz = Plot_Conf()

#Declare data location and type
Catalogue_Dic = DataToTreat()
Pattern = Catalogue_Dic['Datatype'] + '.fits'
DataLog_Extension = '_' + Catalogue_Dic[
    'Datatype'] + '_LinesLog_v3.txt'  #/First batch process for untreated spectra

#Define figure format
dz.FigConf(FigWidth=16, FigHeight=9)

#Find and organize files from terminal command or .py file
FilesList = pv.Folder_Explorer(Pattern,
                               Catalogue_Dic['Obj_Folder'],
                               CheckComputer=False)

Object_Giving_errors = []

# Loop through files
from numpy                               import linspace, ones, log10
from collections                         import OrderedDict
from Plotting_Libraries.dazer_plotter    import Plot_Conf
import pyneb as pn

#Declare Classes
dz  = Plot_Conf() 
  
#Define figure format
dz.FigConf()
 
#Atom creation and definition of physical conditions
HI  = pn.RecAtom('H', 1)
S3  = pn.Atom('O', 3)
 
#Define lines:
Wave_dict               = OrderedDict()
Wave_dict['Hbeta']      = '4_2' 
Wave_dict['O3_4959A']   = 4959 
Wave_dict['O3_5007A']   = 5007 

#Define physical conditions
tem         = 10000
tem_range   = linspace(5000, 25000, 1000)
den         = 100
 
#Emissivities ranges
Hbeta_emis              = HI.getEmissivity(tem = tem_range,   den = den, label = Wave_dict['Hbeta'])
S3_9069A_emis           = S3.getEmissivity(tem = tem_range, den = den, wave = Wave_dict['O3_4959A'])
S3_9531A_emis           = S3.getEmissivity(tem = tem_range, den = den, wave = Wave_dict['O3_5007A'])
t4_range                = tem_range/10000
        x_combine = hstack([x_combine, x[indices_list[i]]])
        y_combine = hstack([y_combine, y[indices_list[i]]])

    Lineal_parameters = lineal_mod.guess(y_combine, x=x_combine)

    x_lineal = linspace(np_min(x_combine), np_max(x_combine), 100)
    y_lineal = Lineal_parameters[
        'lineal_slope'].value * x_lineal + Lineal_parameters[
            'lineal_intercept'].value

    return x_lineal, y_lineal, Lineal_parameters


#Import the classes
pv = myPickle()
dz = Plot_Conf()

#Define figure format
dz.FigConf()

#Declare the data
FilesFolder = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Total_Grid_with_continua/'
File_con = 'S_Ar_Test_age5.0_zStar-2.4_zGas0.1_u-1.5.con'
File_trans_punch = 'S_Ar_Test_age5.0_zStar-2.4_zGas0.31_u-1.5.transContinuum'
File_inci_punch = 'S_Ar_Test_age5.0_zStar-2.4_zGas0.31_u-1.5.inciContinuum'

#Importing the .con columns
lambda_angs, incident, trans, diff_Out, net_trans, reflc, total = loadtxt(
    FilesFolder + File_con,
    skiprows=0,
    usecols=(0, 1, 2, 3, 4, 5, 6),
from CodeTools.PlottingManager              import myPickle
from Plotting_Libraries.dazer_plotter       import Plot_Conf
from numpy                                  import array, power, savetxt, transpose, unique, where, zeros,ones
from Math_Libraries                         import sigfig
from Scientific_Lib.IrafMethods             import Pyraf_Workflow 
from collections                            import OrderedDict
from os                                     import mkdir

#Declare Classes
pv      = myPickle()
dz      = Plot_Conf() 
py_w    = Pyraf_Workflow('WHT')

# #-----------------------------------------STARBURST EQUIVALENT WIDTH EVOLUTION----------------------------------------
FilesFolder     = '/home/vital/Dropbox/Astrophysics/Data/Starburst_Spectra_z0.004/' 
FilesPattern    = '_txt_LinesLog_v3.txt'
   
#Locate files on hard drive
FilesList       = pv.Folder_Explorer(FilesPattern, FilesFolder, CheckComputer=False)
     
# #Define figure format
dz.FigConf()
   
#Lines to plot
# H_Lines         = ['H1_3970A','H1_4102A','H1_4340A', 'H1_4861A', 'H1_6563A']
H_Lines       = ['He1_3188A','He1_4026A','He1_4471A','He2_4686A','He1_5016A','He1_5876A','He1_6678A']
 
#Define dictionary to store the data
Age_dict = OrderedDict() 
Eqw_dict = OrderedDict() 
   
Beispiel #8
0
    x_axis = nplog10(S2_S3_ratio)
    y_axis = nplog10(Ar2_Ar3_ratio)

    if (x_axis < threshold):

        print 'values', x_axis, y_axis

        return x_axis, y_axis

    else:

        return None, None


dz = Plot_Conf()
ct = Cloudy_Tools()

#Declare the number of colors
dz.FigConf(n_colors=7)

#Define script name and location
ScriptFolder = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Total_Grid_SAL2/'

#Orion nebula has a metallicity of 2/3 solar
Grid_Values = OrderedDict()

Grid_Values['age'] = [
    '5.0', '5.25', '5.5', '5.75', '6.0', '6.25', '6.5', '6.75', '7.0', '7.5'
]
Grid_Values['zStars'] = ['-2.1']
from astropy.coordinates                    import EarthLocation
from pytz                                   import timezone
from astroplan                              import Observer
from astropy.coordinates                    import SkyCoord
from astroplan                              import FixedTarget
from astropy.time                           import Time
from astroplan.plots                        import plot_airmass
import matplotlib.pyplot                    as plt
from astropy                                import coordinates as coords


favoured_objects = ['72', '44', 'IZw18_b', '20', '43', '67', '59', '65', '48', '51', '62', '39', '66', '54', 'Mrk475']

#Generate dazer object
pv = myPickle()
dz = Plot_Conf()

#Define figure format
dz.FigConf(n_colors = 2)
cmap = dz.cmap_pallete()

#Define operation
Catalogue_Dic   = DataToTreat('WHT_CandiatesObjects_2016A')
Pattern         = '_log'

FilesList = pv.Folder_Explorer(Pattern,  Catalogue_Dic['Obj_Folder'], CheckComputer=False)
Hbeta_values, Flux_values, names, sn_values, z_values = [], [], [], [], []
g_mags, r_mags = [], []
Declination_values  = []

for i in range(len(FilesList)):
#!/usr/bin/env python

from numpy                                      import hstack, linspace, vstack, zeros, log10
from CodeTools.PlottingManager                  import myPickle
from    ManageFlow                              import DataToTreat
from Astro_Libraries.Nebular_Continuum          import NebularContinuumCalculator
from Plotting_Libraries.dazer_plotter           import Plot_Conf
from matplotlib                                 import image
from scipy.interpolate                          import interp1d
from matplotlib._png                            import read_png
from matplotlib.offsetbox                       import OffsetImage, AnnotationBbox

#---------------------Spectrum Continuum comparisons------------------------------
pv                      = myPickle()
dz                      = Plot_Conf() 
nebCalc                 = NebularContinuumCalculator()
nebCalc.DataRoot        = '/home/vital/Dropbox/Astrophysics/Lore/NebularContinuum/'
 
#Define operation
Catalogue_Dic           = DataToTreat()
Pattern                 = Catalogue_Dic['Datatype'] + '_dered.fits'
Lineslog_extension      = '_' + Catalogue_Dic['Datatype'] + '_dered_LinesLog_v3.txt' 
 
#Find and organize files from terminal command or .py file
FilesList               = pv.Folder_Explorer(Pattern, Catalogue_Dic['Obj_Folder'], CheckComputer=False)
 
#Define figure format
dz.FigConf(FigWidth =16 , FigHeight = 9)
 
for i in range(len(FilesList)):
 
        Line_dict['4740.12A'] / Line_dict['4861.36A']
    ) + 5.705 + 1.246 / TOIII_4 - 0.156 * nplog10(TOIII_4) - 12
    logAr2HI = nplog10(
        Line_dict['7135A'] / Line_dict['4861.36A']
    ) + 6.157 + 0.808 / TSIII_4 - 0.508 * nplog10(TSIII_4) - 12

    x_axis = logS2HI - logS3HI
    y_axis = logAr2HI - logAr3HI

    indexes = x_axis > 0.0

    return x_axis[indexes], y_axis[indexes], TSIII[indexes], TOIII[indexes]


pv = myPickle()
dz = Plot_Conf()
ct = Cloudy_Tools()
diags = pn.Diagnostics()

#Define data type and location
Catalogue_Dic = DataToTreat()
Pattern = Catalogue_Dic['Datatype'] + '.fits'

FilesList = pv.Folder_Explorer(Pattern,
                               Catalogue_Dic['Obj_Folder'],
                               CheckComputer=False)

Abundances_Matrix = import_data_from_objLog_triple(FilesList, pv)

Objects = Abundances_Matrix[:, 0]
ArIII_HII_array = Abundances_Matrix[:, 1]
Beispiel #12
0
from collections import OrderedDict

from numpy import log10 as nplog10, zeros, min, max, linspace, array, concatenate, isfinite, greater
from pandas import Series

from Math_Libraries.bces_script import bces
from Plotting_Libraries.dazer_plotter import Plot_Conf
from cloudy_library.cloudy_methods import Cloudy_Tools

dz = Plot_Conf()
ct = Cloudy_Tools()

#Define script name and location
ScriptFolder = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Ionization_Models_Hbeta_trans/'

#Orion nebula has a metallicity of 2/3 solar

Grid_Values = OrderedDict()
Grid_Values['age'] = ['5.0', '5.5', '6.0', '6.5', '7.0', '7.5']
Grid_Values['zStars'] = ['-2.4', '-2.1', '-1.7', '-1.31']
Grid_Values['zGas'] = ['0.1', '0.31', '0.62']
Grid_Values['u'] = ['-4.0', '-3.5', '-3.0', '-2.5', '-2.0', '-1.5']

#Dictionary of dictionaries
Grid_frame = ({k: Series(v) for k, v in Grid_Values.iteritems()})

#Trick to create a frame with different lengths
# Grid_frame = DataFrame({k : Series(v) for k, v in Grid_Values.iteritems()})

#Generate the scripts with the lines we want to print the flux
ct.lines_to_extract(ScriptFolder)
Beispiel #13
0
def fetch_image(RA, DEC, folder, Name):

    filename = os.path.join(folder + Name)
    if not os.path.exists(filename):
        _fetch(filename, RA, DEC)

    return image.imread(filename)


#Generate dazer object

pv = myPickle()

#Generate dazer object
dz = Plot_Conf()

#Define figure format
dz.FigConf(n_colors=2)

#Define operation
Catalogue_Dic = DataToTreat('WHT_CandiatesObjects_2016A')

#Generate the catalogue folders
pv.generate_catalogue_tree(Catalogue_Dic)

#Recover objects list
Table_Address = Catalogue_Dic['Data_Folder'] + 'WHT_Candidate_Objects_List'
Candiates_frame = pd.read_csv(Table_Address,
                              delimiter='; ',
                              header=0,
        Empty_Array[0]  = CodeName
        for j in range(len(List_Abundances)):
            abundance           = List_Abundances[j]
            Empty_Array[j+1]    = pv.GetParameter_ObjLog(CodeName, FileFolder, Parameter = abundance, Assumption = 'float')
            
            #If the abundance was measure store it 
            if Empty_Array[j+1] == None:
                All_observed = False
                
        if All_observed:
            Valid_objects.append(array(Empty_Array, copy=True))
            
    return array(Valid_objects)

pv  = myPickle()
dz  = Plot_Conf()
ct  = Cloudy_Tools()

#Define figure format
dz.FigConf(n_colors=6)

#Define data type and location
Catalogue_Dic                   = DataToTreat()
Pattern                         = Catalogue_Dic['Datatype'] + '.fits'

#Define script name and location
ScriptFolder    = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/'
ScriptPrefix    = 'S_Ar_test'

#4 metallicities 0.004, 0.008, 0.02, 0.05
#5 ages 5.0, 5.5, 6.0, 6.5, 7.0, 7.5
    
    return p_1, conv_curFit

def Emissivity_parametrization_backup(Temp_Range, A, B, C):
        
    return 12 + A + B/Temp_Range + C * log10(Temp_Range)


# SULFUR III 9069--------------------------------
   
A_0 = -6.5768
B_0 = - 0.6293
C_0 = + 0.6463
  
#Declare Classes
dz = Plot_Conf() 
    
#Define figure format
dz.FigConf()
  
print 'Tell me the files', pn.atomicData.getAllAvailableFiles('S4')
  
#Line codes to solve the slow pyneb issue
pn.atomicData.setDataFile('h_i_rec_SH95.hdf5', 'H1', 'rec')
pn.atomicData.setDataFile('he_ii_rec_SH95.hdf5', 'He2', 'rec')
  
#Change atomic data for Sulfur
# pn.atomicData.includeFitsPath()
pn.atomicData.setDataFile('s_iii_coll_HRS12.dat')
  
#Atom creation and definition of physical conditions
from CodeTools.PlottingManager              import myPickle
from Plotting_Libraries.dazer_plotter       import Plot_Conf
from numpy                                  import linspace
import seaborn as sns
import pyneb as pn

# pn.atomicData.setDataFile('h_i_rec_SH95.hdf5', 'H1', 'rec')
# pn.atomicData.setDataFile('he_ii_rec_SH95.hdf5', 'He2', 'rec')

#Declare Classes
pv      = myPickle()
dz      = Plot_Conf() 

#Define figure format
dz.FigConf()

# Atom creation and definition of physical conditions
S4     = pn.Atom('S', 4)

#Define physical conditions
tem = 10000
tem_range = linspace(10000, 25000, 100)
 
den = 100
den_range = linspace(10, 300, 100)

# Comment the second if you want all the lines to be plotted
# S_Lines=[105100, 1404.81, 1423.84, 1398.04, 1416.89, 290100.0, 1387.46, 1406.02, 112300, 183200]
# S_Lines=[1404.81, 1423.84, 1416.89, 1406.02, 112300]
S_Lines=[105000]
Beispiel #17
0
from CodeTools.PlottingManager import myPickle
from Plotting_Libraries.dazer_plotter import Plot_Conf
from numpy import array, power, savetxt, transpose, unique, where, zeros, ones
from Math_Libraries import sigfig
from Scientific_Lib.IrafMethods import Pyraf_Workflow
from collections import OrderedDict
from os import mkdir

#Declare Classes
pv = myPickle()
dz = Plot_Conf()
py_w = Pyraf_Workflow('WHT')

# #-----------------------------------------STARBURST EQUIVALENT WIDTH EVOLUTION----------------------------------------
FilesFolder = '/home/vital/Dropbox/Astrophysics/Data/Starburst_Spectra_z0.004/'
FilesPattern = '_txt_LinesLog_v3.txt'

#Locate files on hard drive
FilesList = pv.Folder_Explorer(FilesPattern, FilesFolder, CheckComputer=False)

# #Define figure format
dz.FigConf()

#Lines to plot
# H_Lines         = ['H1_3970A','H1_4102A','H1_4340A', 'H1_4861A', 'H1_6563A']
H_Lines = [
    'He1_3188A', 'He1_4026A', 'He1_4471A', 'He2_4686A', 'He1_5016A',
    'He1_5876A', 'He1_6678A'
]

#Define dictionary to store the data
                                       den=NSII_2,
                                       wave=105000.,
                                       Hbeta=Line_dict['4861.36A'])

    #Calculate the logaritmic axis for the plot
    x_axis = nplog10(Ar4_abund / Ar3_abund)
    y_axis = nplog10(S4_abund / S3_abund)

    if (isinf(x_axis) == False) & (isinf(y_axis) == False):
        return x_axis, y_axis

    else:
        return None, None


dz = Plot_Conf()
ct = Cloudy_Tools()
diags = pn.Diagnostics()

#Set atomic data and objects
pn.atomicData.setDataFile('s_iii_coll_HRS12.dat')
diags = pn.Diagnostics()
Ar3 = pn.Atom('Ar', 3)
Ar4 = pn.Atom('Ar', 4)
S3 = pn.Atom('S', 3)
S4 = pn.Atom('S', 4)

colors_list = [
    '#0072B2', '#009E73', '#D55E00', '#CC79A7', '#F0E442', '#56B4E9',
    '#bcbd22', '#7f7f7f', '#FFB5B8'
]
        Empty_Array[0]  = CodeName
        for j in range(len(List_Abundances)):
            abundance           = List_Abundances[j]
            Empty_Array[j+1]    = pv.GetParameter_ObjLog(CodeName, FileFolder, Parameter = abundance, Assumption = 'float')
            
            #If the abundance was measure store it 
            if Empty_Array[j+1] == None:
                All_observed = False
                
        if All_observed:
            Valid_objects.append(array(Empty_Array, copy=True))
            
    return array(Valid_objects)

pv                              = myPickle()
dz                              = Plot_Conf()
ct                              = Cloudy_Tools()
diags                           = pn.Diagnostics()

#Define data type and location
Catalogue_Dic                   = DataToTreat()
Pattern                         = Catalogue_Dic['Datatype'] + '.fits'

#Define figure format
dz.FigConf(n_colors=3)

print 'Colors initial'
print dz.ColorVector[2], len(dz.ColorVector[2])

#Define script name and location
# ScriptFolder    = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Few_Models/'
#!/usr/bin/env python

from numpy import hstack, linspace, vstack, zeros, log10
from CodeTools.PlottingManager import myPickle
from ManageFlow import DataToTreat
from Astro_Libraries.Nebular_Continuum import NebularContinuumCalculator
from Plotting_Libraries.dazer_plotter import Plot_Conf
from matplotlib import image
from scipy.interpolate import interp1d
from matplotlib._png import read_png
from matplotlib.offsetbox import OffsetImage, AnnotationBbox

#---------------------Spectrum Continuum comparisons------------------------------
pv = myPickle()
dz = Plot_Conf()
nebCalc = NebularContinuumCalculator()
nebCalc.DataRoot = '/home/vital/Dropbox/Astrophysics/Lore/NebularContinuum/'

#Define operation
Catalogue_Dic = DataToTreat()
Pattern = Catalogue_Dic['Datatype'] + '_dered.fits'
Lineslog_extension = '_' + Catalogue_Dic['Datatype'] + '_dered_LinesLog_v3.txt'

#Find and organize files from terminal command or .py file
FilesList = pv.Folder_Explorer(Pattern,
                               Catalogue_Dic['Obj_Folder'],
                               CheckComputer=False)

#Define figure format
dz.FigConf(FigWidth=16, FigHeight=9)
import uncertainties.unumpy                             as unumpy  
from CodeTools.PlottingManager                          import myPickle
from Math_Libraries.FittingTools                        import NumpyRegression
from Math_Libraries.linfit_script                       import LinfitLinearRegression
from ManageFlow                                         import DataToTreat
from Astro_Libraries.Reddening_Corrections              import ReddeningLaws    
from numpy                                              import concatenate
from Plotting_Libraries.dazer_plotter           import Plot_Conf

#Declare coding classes
pv                          = myPickle()
Reddening                   = ReddeningLaws()
dz                          = Plot_Conf() 

#Declare data location and type
Catalogue_Dic               = DataToTreat()
Pattern                     = Catalogue_Dic['Datatype'] + '.fits'
DataLog_Extension           = '_' + Catalogue_Dic['Datatype'] + '_LinesLog_v3.txt'       #/First batch process for untreated spectra

#Define figure format
dz.FigConf(FigWidth =16 , FigHeight = 9)


#Find and organize files from terminal command or .py file
FilesList                   = pv.Folder_Explorer(Pattern,  Catalogue_Dic['Obj_Folder'], CheckComputer=False)

Object_Giving_errors = []

# Loop through files
for i in range(len(FilesList)):
Beispiel #22
0
    Ar4_abund = Ar4_atom.getIonAbundance(int_ratio = Line_dict['4740.12A'] + Line_dict['4711.26A'], tem=TOIII, den=NSII_2, to_eval = 'L(4740) + L(4711)', Hbeta = Line_dict['4861.36A'])                             
           
    S3_abund  = S3_atom.getIonAbundance(int_ratio = (Line_dict['9068.62A'] + Line_dict['9532A']), tem=TSIII, den=NSII, to_eval = 'L(9069)+L(9531)', Hbeta = Line_dict['4861.36A'])
    S4_abund  = S4_atom.getIonAbundance(int_ratio = (Line_dict['10.51m']), tem=TOIII, den=NSII_2, wave = 105000., Hbeta = Line_dict['4861.36A'])
     
    #Calculate the logaritmic axis for the plot
    x_axis          = nplog10(Ar4_abund/Ar3_abund)
    y_axis          = nplog10(S4_abund/S3_abund)
     
    if (isinf(x_axis) == False) & (isinf(y_axis) == False):   
        return x_axis, y_axis
 
    else:
        return None, None
     
dz     = Plot_Conf()
ct     = Cloudy_Tools()
diags  = pn.Diagnostics()
 
#Set atomic data and objects
pn.atomicData.setDataFile('s_iii_coll_HRS12.dat')
diags  = pn.Diagnostics()
Ar3 = pn.Atom('Ar', 3)
Ar4 = pn.Atom('Ar', 4)
S3 = pn.Atom('S', 3)
S4 = pn.Atom('S', 4)
 
#Declare the number of colors
dz.FigConf(n_colors = 7)
  
#Define script name and location
        Empty_Array[0]  = CodeName
        for j in range(len(List_Abundances)):
            abundance           = List_Abundances[j]
            Empty_Array[j+1]    = pv.GetParameter_ObjLog(CodeName, FileFolder, Parameter = abundance, Assumption = 'float')
            
            #If the abundance was measure store it 
            if Empty_Array[j+1] == None:
                All_observed = False
                
        if All_observed:
            Valid_objects.append(array(Empty_Array, copy=True))
            
    return array(Valid_objects)

pv  = myPickle()
dz  = Plot_Conf()
ct  = Cloudy_Tools()

#Define data type and location
Catalogue_Dic                   = DataToTreat()
Pattern                         = Catalogue_Dic['Datatype'] + '.fits'

#Define figure format
dz.FigConf(n_colors=6)

#Define script name and location
ScriptFolder    = '/home/vital/Dropbox/Astrophysics/Tools/Cloudy/S_Ar_test/Few_Models/'
ScriptPrefix    = 'S_Ar_test'

#4 metallicities 0.004, 0.008, 0.02, 0.05
#5 ages 5.0, 5.5, 6.0, 6.5, 7.0, 7.5
from    CodeTools.PlottingManager               import myPickle
from    Math_Libraries.bces_script              import bces
from    Plotting_Libraries.dazer_plotter        import Plot_Conf
from scipy.odr import *
from scipy import stats

def Linear_Func(p, x):
    m, c = p
    return m*x + c

# Create a model for fitting.
linear_model = Model(Linear_Func)

#Generate dazer object
pv = myPickle()
dz = Plot_Conf()

#Define figure format
dz.FigConf(n_colors=7)

#Define data type and location
Catalogue_Dic                   = DataToTreat()
Pattern                         = Catalogue_Dic['Datatype'] + '.fits'
database_extension              = '_extandar_30000_5000_10_Revision3'
globalfile_extension            = '_global_30000_5000_10_Revision3.csv'
Method_index                    = 3

#Import the plots format
Titles_wording, colors_dict     = import_plots_wording(pv)

#Set the log file
Beispiel #25
0
from CodeTools.PlottingManager import myPickle
from Plotting_Libraries.dazer_plotter import Plot_Conf
from numpy import linspace
import seaborn as sns
import pyneb as pn

# pn.atomicData.setDataFile('h_i_rec_SH95.hdf5', 'H1', 'rec')
# pn.atomicData.setDataFile('he_ii_rec_SH95.hdf5', 'He2', 'rec')

#Declare Classes
pv = myPickle()
dz = Plot_Conf()

#Define figure format
dz.FigConf()

# Atom creation and definition of physical conditions
S4 = pn.Atom('S', 4)

#Define physical conditions
tem = 10000
tem_range = linspace(10000, 25000, 100)

den = 100
den_range = linspace(10, 300, 100)

# Comment the second if you want all the lines to be plotted
# S_Lines=[105100, 1404.81, 1423.84, 1398.04, 1416.89, 290100.0, 1387.46, 1406.02, 112300, 183200]
# S_Lines=[1404.81, 1423.84, 1416.89, 1406.02, 112300]
S_Lines = [105000]
Beispiel #26
0
from astroplan import Observer
from astropy.coordinates import SkyCoord
from astroplan import FixedTarget
from astropy.time import Time
from astroplan.plots import plot_airmass
import matplotlib.pyplot as plt
from astropy import coordinates as coords

favoured_objects = [
    '72', '44', 'IZw18_b', '20', '43', '67', '59', '65', '48', '51', '62',
    '39', '66', '54', 'Mrk475'
]

#Generate dazer object
pv = myPickle()
dz = Plot_Conf()

#Define figure format
dz.FigConf(n_colors=2)
cmap = dz.cmap_pallete()

#Define operation
Catalogue_Dic = DataToTreat('WHT_CandiatesObjects_2016A')
Pattern = '_log'

FilesList = pv.Folder_Explorer(Pattern,
                               Catalogue_Dic['Obj_Folder'],
                               CheckComputer=False)
Hbeta_values, Flux_values, names, sn_values, z_values = [], [], [], [], []
g_mags, r_mags = [], []
Declination_values = []