Skip to content

Commit

Permalink
feat: interpolation between models supported
Browse files Browse the repository at this point in the history
Interpolations between Kurucz format models are now available, and the code will judge autometically
whether interpolation is required based on Delaunay triangulation.

fix #9
  • Loading branch information
MingjieJian committed Jul 5, 2020
1 parent d4bff85 commit 8641d5d
Show file tree
Hide file tree
Showing 27 changed files with 8,064 additions and 8,888 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gfortran: fatal error: no input files
compilation terminated.
```

then gfortran is already installed and please go to [Install pymoog](#install-pumoog).
then gfortran is already installed and please go to [Install pymoog](#install-pymoog).

If you get:

Expand Down
Binary file modified docs/img/grid_points_kurucz/m_h+0.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h+0.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h+0.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/grid_points_kurucz/m_h+0.3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h+0.5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h+1.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/grid_points_kurucz/m_h-0.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/grid_points_kurucz/m_h-0.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-0.3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-0.5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-1.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-1.5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-2.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-2.5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-3.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-3.5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-4.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-4.5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/grid_points_kurucz/m_h-5.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pymoog/__pycache__/synth.cpython-38.pyc
Binary file not shown.
49 changes: 49 additions & 0 deletions pymoog/deprecated.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/python
# The deprecate functions are stored here.
# WARNING: the depandence of the functions here are not supported.
from PyAstronomy import pyasl
import os

MOOG_path = '{}/.pymoog/moog_nosm/moog_nosm_FEB2017/'.format(os.environ['HOME'])
MOOG_run_path = '{}/.pymoog/rundir/'.format(os.environ['HOME'])
MOOG_file_path = '{}/.pymoog/files/'.format(os.environ['HOME'])

def KURUCZ_download(teff, logg, m_h, save_name=None):
'''
Download the Kurucz ATLAS9 model using pyasl.
Parameters
----------
teff : int
The effective temperature of the model
logg : float
logg value of the model
m_h : float
[M/H] value (overall metallicity) of the model
save_name : str
The path to save the model file (including the name).
Returns
----------
self.model_path : str
The path and name of saved model.
'''

# The model is invoked here
model = pyasl.getKuruczModel(teff, logg, m_h)

# Save the model file to specified position
if save_name == None:
output_file_name = MOOG_run_path + 'model.mod'
else:
output_file_name = save_name
output_file = open(output_file_name,"w")

for line in model:
output_file.write(line + "\n")

output_file.close()

model_path = output_file_name
return model_path
Loading

0 comments on commit 8641d5d

Please sign in to comment.