...
 
Commits (114)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
......@@ -22,7 +22,7 @@ import scipy.constants as cst
from astropy.table import Table
from pcigale.data import (Database, Filter, M2005, BC03, Fritz2006,
Dale2014, DL2007, DL2014, NebularLines,
NebularContinuum, Schreiber2016, THEMIS)
NebularContinuum, SKIRTOR2016, Schreiber2016, THEMIS)
def read_bc03_ssp(filename):
......@@ -140,11 +140,16 @@ def read_bc03_ssp(filename):
def build_filters(base):
filters = []
filters_dir = os.path.join(os.path.dirname(__file__), 'filters/')
for filter_file in glob.glob(filters_dir + '*.dat'):
for filter_file in glob.glob(filters_dir + '**/*.dat', recursive=True):
with open(filter_file, 'r') as filter_file_read:
filter_name = filter_file_read.readline().strip('# \n\t')
filter_type = filter_file_read.readline().strip('# \n\t')
filter_description = filter_file_read.readline().strip('# \n\t')
# Make the name dynamic for filters in subdirectories
tmp_name = filter_file.replace(filters_dir, '')[:-4]
if '/' in tmp_name:
filter_name = tmp_name.replace('/', '.')
filter_table = np.genfromtxt(filter_file)
# The table is transposed to have table[0] containing the wavelength
# and table[1] containing the transmission.
......@@ -689,6 +694,55 @@ def build_fritz2006(base):
base.add_fritz2006(models)
def build_skirtor2016(base):
models = []
skirtor2016_dir = os.path.join(os.path.dirname(__file__), 'skirtor2016/')
files = glob.glob(skirtor2016_dir + '/*')
files = [file.split('/')[-1] for file in files]
params = [f.split('_')[:-1] for f in files]
# Parameters of SKIRTOR 2016
t = list({param[0][1:] for param in params})
p = list({param[1][1:] for param in params})
q = list({param[2][1:] for param in params})
oa = list({param[3][2:] for param in params})
R = list({param[4][1:] for param in params})
Mcl = list({param[5][3:] for param in params})
i = list({param[6][1:] for param in params})
iter_params = ((p1, p2, p3, p4, p5, p6, p7)
for p1 in t
for p2 in p
for p3 in q
for p4 in oa
for p5 in R
for p6 in Mcl
for p7 in i)
for params in iter_params:
filename = skirtor2016_dir + \
"t{}_p{}_q{}_oa{}_R{}_Mcl{}_i{}_sed.dat".format(*params)
print("Importing {}...".format(filename))
wl, disk, scatt, dust = np.genfromtxt(filename, unpack=True,
usecols=(0, 2, 3, 4))
wl *= 1e3
disk += scatt
disk /= wl
dust /= wl
# Normalization of the lumin_therm to 1W
norm = np.trapz(dust, x=wl)
disk /= norm
dust /= norm
models.append(SKIRTOR2016(params[0], params[1], params[2], params[3],
params[4], params[5], params[6], wl, disk,
dust))
base.add_skirtor2016(models)
def build_nebular(base):
models_lines = []
models_cont = []
......@@ -706,7 +760,7 @@ def build_nebular(base):
# Convert wavelength from Å to nm
wave_lines *= 0.1
wave_cont = cont[:1600, 0] * 0.1
wave_cont = cont[:3729, 0] * 0.1
# Get the list of metallicities
metallicities = np.unique(lines[:, 1])
......@@ -736,7 +790,7 @@ def build_nebular(base):
# Import continuum
for idx, metallicity in enumerate(metallicities):
spectra = cont[1600 * idx: 1600 * (idx+1), :]
spectra = cont[3729 * idx: 3729 * (idx+1), :]
for logU, spectrum in zip(np.around(np.arange(-4., -.9, .1), 1),
spectra.T):
models_cont.append(NebularContinuum(metallicity, logU, wave_cont,
......@@ -879,22 +933,27 @@ def build_base(bc03res='lr'):
print("\nDONE\n")
print('#' * 78)
print("7- Importing Dale et al (2014) templates\n")
print("7- Importing SKIRTOR 2016 models\n")
build_skirtor2016(base)
print("\nDONE\n")
print('#' * 78)
print("8- Importing Dale et al (2014) templates\n")
build_dale2014(base)
print("\nDONE\n")
print('#' * 78)
print("8- Importing nebular lines and continuum\n")
print("9- Importing nebular lines and continuum\n")
build_nebular(base)
print("\nDONE\n")
print('#' * 78)
print("9- Importing Schreiber et al (2016) models\n")
print("10- Importing Schreiber et al (2016) models\n")
build_schreiber2016(base)
print("\nDONE\n")
print('#' * 78)
print("10- Importing Jones et al (2017) models)\n")
print("11- Importing Jones et al (2017) models)\n")
build_themis(base)
print("\nDONE\n")
print('#' * 78)
......
# F1000W
# photon
# Includes Nominal transmission of the JWST OTE is not included. Source: http://svo2.cab.inta-csic.es/svo/theory/fps3/index.php?mode=browse&gname=JWST&gname2=MIRI
87430 0.0004
87490 0.0012
87550 0.002
87600 0.0029
87660 0.0056
87720 0.0082
87780 0.0109
87840 0.0127
87890 0.0139
87950 0.0151
88010 0.0156
88070 0.013
88130 0.0104
88180 0.0078
88240 0.0062
88300 0.005
88360 0.0038
88420 0.0029
88470 0.0029
88530 0.0029
88590 0.0029
88650 0.0033
88710 0.0038
88760 0.0043
88820 0.0052
88880 0.0065
88940 0.0078
89000 0.0092
89050 0.0119
89110 0.0147
89170 0.0174
89230 0.0211
89290 0.0258
89340 0.0305
89400 0.0352
89460 0.0416
89520 0.0481
89580 0.0545
89630 0.0623
89690 0.0711
89750 0.0799
89810 0.0894
89870 0.1029
89920 0.1163
89980 0.1298
90040 0.1482
90100 0.1687
90160 0.1893
90210 0.2109
90270 0.2357
90330 0.2605
90390 0.2853
90450 0.3036
90500 0.3202
90560 0.3369
90620 0.3482
90680 0.3494
90740 0.3506
90790 0.3518
90850 0.347
90910 0.3414
90970 0.3358
91030 0.3312
91080 0.3277
91140 0.3242
91200 0.3208
91260 0.3223
91320 0.3239
91370 0.3255
91430 0.3292
91490 0.3347
91550 0.3401
91610 0.3457
91660 0.3518
91720 0.358
91780 0.3641
91840 0.3693
91900 0.374
91950 0.3787
92010 0.383
92070 0.3855
92130 0.388
92190 0.3905
92240 0.3916
92300 0.3922
92360 0.3928
92420 0.393
92480 0.3926
92530 0.3921
92590 0.3917
92650 0.3908
92710 0.3898
92770 0.3889
92820 0.3878
92880 0.3867
92940 0.3856
93000 0.3845
93060 0.3835
93110 0.3825
93170 0.3815
93230 0.3807
93290 0.38
93350 0.3793
93400 0.3786
93460 0.3784
93520 0.3782
93580 0.3779
93640 0.378
93690 0.3783
93750 0.3786
93810 0.379
93870 0.3798
93930 0.3806
93980 0.3814
94040 0.3823
94100 0.3833
94160 0.3843
94220 0.3853
94270 0.3862
94330 0.3871
94390 0.388
94450 0.3887
94510 0.3894
94560 0.39
94620 0.3906
94680 0.391
94740 0.3915
94800 0.3919
94850 0.3923
94910 0.3927
94970 0.393
95030 0.3934
95090 0.3938
95140 0.3942
95200 0.3946
95260 0.3951
95320 0.3955
95380 0.396
95430 0.3964
95490 0.3968
95550 0.3972
95610 0.3976
95670 0.3978
95720 0.398
95780 0.3982
95840 0.3981
95900 0.3979
95960 0.3977
96010 0.3974
96070 0.3968
96130 0.3963
96190 0.3957
96250 0.3951
96300 0.3944
96360 0.3937
96420 0.3931
96480 0.3925
96540 0.392
96590 0.3914
96650 0.3911
96710 0.3908
96770 0.3905
96830 0.3903
96880 0.3903
96940 0.3904
97000 0.3904
97060 0.3907
97120 0.391
97170 0.3913
97230 0.3917
97290 0.3922
97350 0.3927
97410 0.3932
97460 0.3937
97520 0.3941
97580 0.3946
97640 0.3949
97700 0.3952
97750 0.3955
97810 0.3957
97870 0.3958