Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cigale
CIGALE
Commits
9f4c2df4
Commit
9f4c2df4
authored
Oct 21, 2016
by
Médéric Boquien
Browse files
Update the database storage format to follow the convention for the bc03 and m2005 modules.
parent
2311afd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
pcigale/data/__init__.py
View file @
9f4c2df4
...
@@ -83,7 +83,7 @@ class _M2005(BASE):
...
@@ -83,7 +83,7 @@ class _M2005(BASE):
metallicity
=
Column
(
Float
,
primary_key
=
True
)
metallicity
=
Column
(
Float
,
primary_key
=
True
)
time_grid
=
Column
(
PickleType
)
time_grid
=
Column
(
PickleType
)
wavelength_grid
=
Column
(
PickleType
)
wavelength_grid
=
Column
(
PickleType
)
mass
_table
=
Column
(
PickleType
)
info
_table
=
Column
(
PickleType
)
spec_table
=
Column
(
PickleType
)
spec_table
=
Column
(
PickleType
)
def
__init__
(
self
,
ssp
):
def
__init__
(
self
,
ssp
):
...
@@ -91,7 +91,7 @@ class _M2005(BASE):
...
@@ -91,7 +91,7 @@ class _M2005(BASE):
self
.
metallicity
=
ssp
.
metallicity
self
.
metallicity
=
ssp
.
metallicity
self
.
time_grid
=
ssp
.
time_grid
self
.
time_grid
=
ssp
.
time_grid
self
.
wavelength_grid
=
ssp
.
wavelength_grid
self
.
wavelength_grid
=
ssp
.
wavelength_grid
self
.
mass
_table
=
ssp
.
mass
_table
self
.
info
_table
=
ssp
.
info
_table
self
.
spec_table
=
ssp
.
spec_table
self
.
spec_table
=
ssp
.
spec_table
...
@@ -105,16 +105,16 @@ class _BC03(BASE):
...
@@ -105,16 +105,16 @@ class _BC03(BASE):
metallicity
=
Column
(
Float
,
primary_key
=
True
)
metallicity
=
Column
(
Float
,
primary_key
=
True
)
time_grid
=
Column
(
PickleType
)
time_grid
=
Column
(
PickleType
)
wavelength_grid
=
Column
(
PickleType
)
wavelength_grid
=
Column
(
PickleType
)
color
_table
=
Column
(
PickleType
)
info
_table
=
Column
(
PickleType
)
lumin
_table
=
Column
(
PickleType
)
spec
_table
=
Column
(
PickleType
)
def
__init__
(
self
,
ssp
):
def
__init__
(
self
,
ssp
):
self
.
imf
=
ssp
.
imf
self
.
imf
=
ssp
.
imf
self
.
metallicity
=
ssp
.
metallicity
self
.
metallicity
=
ssp
.
metallicity
self
.
time_grid
=
ssp
.
time_grid
self
.
time_grid
=
ssp
.
time_grid
self
.
wavelength_grid
=
ssp
.
wavelength_grid
self
.
wavelength_grid
=
ssp
.
wavelength_grid
self
.
color
_table
=
ssp
.
color
_table
self
.
info
_table
=
ssp
.
info
_table
self
.
lumin
_table
=
ssp
.
lumin
_table
self
.
spec
_table
=
ssp
.
spec
_table
class
_Dale2014
(
BASE
):
class
_Dale2014
(
BASE
):
...
@@ -339,7 +339,7 @@ class Database(object):
...
@@ -339,7 +339,7 @@ class Database(object):
.
first
()
.
first
()
if
result
:
if
result
:
return
M2005
(
result
.
imf
,
result
.
metallicity
,
result
.
time_grid
,
return
M2005
(
result
.
imf
,
result
.
metallicity
,
result
.
time_grid
,
result
.
wavelength_grid
,
result
.
mass
_table
,
result
.
wavelength_grid
,
result
.
info
_table
,
result
.
spec_table
)
result
.
spec_table
)
else
:
else
:
raise
DatabaseLookupError
(
raise
DatabaseLookupError
(
...
@@ -403,8 +403,8 @@ class Database(object):
...
@@ -403,8 +403,8 @@ class Database(object):
.
first
()
.
first
()
if
result
:
if
result
:
return
BC03
(
result
.
imf
,
result
.
metallicity
,
result
.
time_grid
,
return
BC03
(
result
.
imf
,
result
.
metallicity
,
result
.
time_grid
,
result
.
wavelength_grid
,
result
.
color
_table
,
result
.
wavelength_grid
,
result
.
info
_table
,
result
.
lumin
_table
)
result
.
spec
_table
)
else
:
else
:
raise
DatabaseLookupError
(
raise
DatabaseLookupError
(
"The BC03 SSP for imf <{0}> and metallicity <{1}> is not in "
"The BC03 SSP for imf <{0}> and metallicity <{1}> is not in "
...
@@ -996,4 +996,4 @@ class Database(object):
...
@@ -996,4 +996,4 @@ class Database(object):
"""Generator to parse the Maraston 2005 SSP database."""
"""Generator to parse the Maraston 2005 SSP database."""
for
ssp
in
self
.
session
.
query
(
_M2005
):
for
ssp
in
self
.
session
.
query
(
_M2005
):
yield
M2005
(
ssp
.
imf
,
ssp
.
metallicity
,
ssp
.
time_grid
,
yield
M2005
(
ssp
.
imf
,
ssp
.
metallicity
,
ssp
.
time_grid
,
ssp
.
wavelength_grid
,
ssp
.
mass
_table
,
ssp
.
spec_table
)
ssp
.
wavelength_grid
,
ssp
.
info
_table
,
ssp
.
spec_table
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment