-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change data directory to datsets, implement utility function for loading datasets with Pandas
- Loading branch information
1 parent
e7b085d
commit 3c22118
Showing
91 changed files
with
8,199 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
include src/astroedu/interactives/* | ||
include src/astroedu/data/* | ||
include src/astroedu/datasets/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Data | ||
|
||
Description of the data files kept in this directory. | ||
|
||
To keep this readme short you can find column descriptions in the csv's associated **.txt** file or linked below. (not all are complete) | ||
|
||
## mass16Abundant.csv | ||
|
||
Atomic data (mass, binding energy etc of isotopes) from the Atomic Mass Data Center ([AMDC](http://amdc.impcas.ac.cn/filel.html)). | ||
**mass16Abundant.csv** is the same but with only the most abundant isotope of each element. | ||
|
||
## atmospheres.csv | ||
|
||
Data from Rauf KM et al. (2015) Comparing the Atmospheric Compositions of All Planets and Giant Moons in Solar System [https://www.longdom.org/open-access/comparing-the-atmospheric-compositions-of-all-planets-and-giant-moons-in-solar-system-2332-2519-1000136.pdf](https://www.longdom.org/open-access/comparing-the-atmospheric-compositions-of-all-planets-and-giant-moons-in-solar-system-2332-2519-1000136.pdf) | ||
|
||
Contains percentage compositions for different gases in the atmospheres of the planets + Pluto. | ||
|
||
## earth_chem_crust.csv | ||
|
||
Chemical composition of the crust. | ||
Taken from: CRC Handbook of Chemistry and Physics, 97th Edition (2016-2017) | ||
|
||
## earth_chem_interior.csv | ||
|
||
The chemical compostion of the Earth. | ||
Only some elements included. Some Oxygen data is missing. Values in %. | ||
|
||
Rows for: Bulk, Core, Lower Mantle, Upper Mantle, and the Crust. | ||
|
||
Data taken from: | ||
Don L. Anderson (1998) Theory of the Earth, Chapter 8, [https://authors.library.caltech.edu/25018/9/TOE08.pdf](https://authors.library.caltech.edu/25018/9/TOE08.pdf) | ||
Claude J. Allegre et al (1995) The chemical composition of the Earth, [https://www.researchgate.net/publication/222035431_The_Chemical-Composition_of_the_Earth](https://www.researchgate.net/publication/222035431_The_Chemical-Composition_of_the_Earth) | ||
Frederick K. Lutgens and Edward J. Tarbuck (2000) Essentials of Geology 7th Edition | ||
|
||
## exobase.csv | ||
|
||
From A. Garcia Munoz et al - Upper Atmospheres and Ionospheres of Planets and Satellites [https://arxiv.org/ftp/arxiv/papers/1712/1712.02994.pdf](https://arxiv.org/ftp/arxiv/papers/1712/1712.02994.pdf) | ||
|
||
Contains data on the exobase (bottom layer of the exosphere) for the planets and Titan. | ||
Note the temperatures for Mercury are average surface temperatures since it has no appreciable atmosphere. | ||
|
||
## exoplanets.csv | ||
|
||
NASA exoplanet archive data. | ||
[https://exoplanetarchive.ipac.caltech.edu/docs/API_exoplanet_columns.html](https://exoplanetarchive.ipac.caltech.edu/docs/API_exoplanet_columns.html) | ||
|
||
## exoplanets_microlensing.csv | ||
|
||
NASA exoplanet archive data. Exoplanets discovered using microlensing. | ||
[https://exoplanetarchive.ipac.caltech.edu/docs/API_microlensing.html](https://exoplanetarchive.ipac.caltech.edu/docs/API_microlensing.html) | ||
|
||
## geotherm.csv | ||
|
||
Geothermal and pressure gradient for the Earth. Taken from [here - https://www.geo.arizona.edu/xtal/geos306/fall06-10.htm](https://www.geo.arizona.edu/xtal/geos306/fall06-10.htm) and adapted. Original is in geotherm_original.csv. | ||
|
||
## int_std_atm.csv | ||
|
||
Data to construct the international standard atmosphere model. | ||
Taken from the ISA wikipedia page [here](https://en.wikipedia.org/wiki/International_Standard_Atmosphere). | ||
|
||
## planets.csv | ||
|
||
Planetary data (including our Moon, the Galilean moons, and Pluto/Charon) taken from NASA Planetary factsheet [here](https://nssdc.gsfc.nasa.gov/planetary/factsheet/) and [here - https://www.noao.edu/jagi/sepo/education/plansat/table.html](https://www.noao.edu/jagi/sepo/education/plansat/table.html). | ||
|
||
## structure.csv | ||
|
||
Layers in planetary interiors and their thicknesses. | ||
Taken from [here - https://github.com/eleanorlutz/topography_atlas_of_space](https://github.com/eleanorlutz/topography_atlas_of_space) and adapted (see other sources in the file). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
''' | ||
astroedu.datasets - utilities for loading datasets | ||
''' | ||
|
||
from importlib_resources import files, is_resource | ||
import pandas as pd | ||
|
||
help_text = '''Pass the name of a dataset to load_data as a string.\n | ||
For instance to load the planets dataset run load_data('planets').\n | ||
The returned value is a Pandas dataframe.\n | ||
To see all available datasets go to https://github.com/astroDimitrios/astroedu/tree/main/src/astroedu/datasets''' | ||
|
||
def load_data(data, info=False): | ||
''' Loads a dataset as a Pandas dataframe | ||
Special case data == 'help' the help_text is printed to console | ||
All datasets visible at: | ||
https://github.com/astroDimitrios/astroedu/tree/main/src/astroedu/datasets | ||
Args: | ||
data -- string, name of the csv file to load (without extension) | ||
info -- boolean, default False - if True prints a short description | ||
of the data before loading the dataframe | ||
Returns: | ||
A pandas dataframe | ||
Example: | ||
>>> planets = load_data('planets') | ||
>>> load_data('help') | ||
''' | ||
if data == 'help': | ||
print(help_text) | ||
return | ||
data_csv = data+'.csv' | ||
if not is_resource('astroedu.datasets', data_csv): | ||
raise FileExistsError(f'No data file named {data_csv} found.') | ||
with files('astroedu.datasets').joinpath(data_csv) as p: | ||
if info: | ||
with files('astroedu.datasets').joinpath(data+'.txt') as i: | ||
InfoHandler = open(str(i), 'r') | ||
print(InfoHandler.read()) | ||
return pd.read_csv(str(p)) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
atmospheres.csv | ||
Data from Rauf KM et al. (2015) | ||
Atmospheric compositions of all Planets and Giant Moons in the Solar System | ||
Percentage compositions for the different gases and Pluto is included | ||
https://www.longdom.org/open-access/comparing-the-atmospheric-compositions-of-all-planets-and-giant-moons-in-solar-system-2332-2519-1000136.pdf |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
earth_chem_crust.csv | ||
Chemical composition of the crust. | ||
Taken from: CRC Handbook of Chemistry and Physics, 97th Edition (2016-2017) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
earth_chem_interior.csv | ||
The chemical compostion of the Earth. | ||
Only some elements included. Some Oxygen data is missing. Values in %. | ||
Rows for: Bulk, Core, Lower Mantle, Upper Mantle, and the Crust. | ||
Data taken from: | ||
Don L. Anderson (1998) Theory of the Earth, Chapter 8 | ||
https://authors.library.caltech.edu/25018/9/TOE08.pdf | ||
Claude J. Allegre et al (1995) The chemical composition of the Earth | ||
https://www.researchgate.net/publication/222035431_The_Chemical-Composition_of_the_Earth | ||
Frederick K. Lutgens and Edward J. Tarbuck (2000) Essentials of Geology 7th Edition |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
exobase.csv | ||
From A. Garcia Munoz et al - Upper Atmospheres and Ionospheres of Planets and Satellites | ||
https://arxiv.org/ftp/arxiv/papers/1712/1712.02994.pdf | ||
|
||
Contains data on the exobase (bottom layer of the exosphere) for the planets and Titan. | ||
|
||
object - name of the object | ||
exobase alt - altitude in the atmosphere of the exobase (km) | ||
exobase alt range - if the value in the paper was given as a range exobase alt is the center value | ||
and this column contains the range either side of possible values (similar to a +- error but I hesitate to call it that) in km | ||
exobase temp high - max temp of the exobase in K (daytime) | ||
exobase temp low - min temp of the exobase in K (nightime) - sometimes this is the same as the high value | ||
esc vel - the escape velocity of the planet in km/s | ||
|
||
Note the temperatures for Mercury are average surface temperatures since it has no appreciable atmosphere. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
geotherm.csv | ||
Data taken from - Professor Bob Downs, University of Arizona | ||
https://www.geo.arizona.edu/xtal/geos306/fall06-10.htm | ||
|
||
Used to construct/plot the Earth's geothermal gradient. | ||
r - depth (km) | ||
r*- distance from the center of the Earth (km) | ||
T - temperature at r (K) | ||
|
||
I have altered the T profile from the original to be consistent with the D" layer depth. | ||
In the original file the core mantle boundary temp change occurred at too low a depth. | ||
The original data is in geotherm_original.csv. The original also has pressure vs depth data. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
geotherm_original.csv | ||
Data taken from - Professor Bob Downs, University of Arizona | ||
https://www.geo.arizona.edu/xtal/geos306/fall06-10.htm | ||
|
||
Used to construct/plot the Earth's geothermal gradient. | ||
r - depth (km) | ||
r*- distance from the center of the Earth (km) | ||
T - temperature at r (K) | ||
|
||
This original data also has pressure vs depth data. | ||
I have adapted the data in geotherm.csv. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
int_std_atm.csv | ||
Taken from the ISA wikipedia page. | ||
https://en.wikipedia.org/wiki/International_Standard_Atmosphere | ||
|
||
layer - is the layer number 0 being closest to the surface | ||
level_name - is the layer name | ||
h - is the geopotential altitude in m | ||
z - is the geometric altitude in m | ||
lapse_rate - is the lapse rate in K/km of geopotential altitude | ||
T - is the base temperature for that layer | ||
P - is the base pressure for that layer | ||
rho - is the base density for that layer |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
src/astroedu/data/jupiter_moons.txt → ...d/lib/astroedu/datasets/jupiter_moons.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
jupiter_moons.csv | ||
Data from: https://pds-rings.seti.org/jupiter/jupiter_tables.html | ||
|
||
Most masses are missing | ||
|
Oops, something went wrong.