Skip to content

Commit

Permalink
updates to examples and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tamarervin committed Nov 15, 2021
1 parent d16fcb7 commit e241b73
Show file tree
Hide file tree
Showing 62 changed files with 43 additions and 36,904 deletions.
16 changes: 7 additions & 9 deletions build/lib/sdo_hmi_rvs/tools/plotting_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,21 @@ def vert_comp_timeseries(x, y_list, title, xlabel=None, ylabel_list=None, save_f
plt.style.use(plot_style)

# set up figure
fig, axs = plt.subplots(len(y_list), 1, sharex='all', figsize=[12, 3*len(y_list)], gridspec_kw={'hspace': 0.0})
fig, axs = plt.subplots(len(y_list), 1, sharex='all', figsize=[6, 1.5 * len(y_list)], gridspec_kw={'hspace': 0})
if title is not None:
fig.suptitle(title)

# set up axes labels
# set up axes labels
for i in range(0, len(axs)):
if i == len(axs) - 1:
axs[i].set(xlabel=xlabel, ylabel=ylabel_list[i])
else:
axs[i].set(ylabel=ylabel_list[i])
axs[i].set(ylabel=ylabel_list[i])
axs[i].set(xlabel=xlabel)

# plot data
color_list = ['lightcoral', 'lightblue', 'plum', 'pink', 'navajowhite']
for i in range(0, len(axs)):
axs[i].scatter(x, y_list[i], color=color_list[i], edgecolors='k', linewidths=1.0)
# axs[i].locator_params(axis="y", nbins=5)
# axs[1].scatter(x, y_list[1], color='lightblue', edgecolors='k', linewidths=1.0)
axs[i].scatter(x, y_list[i], color='thistle', s=30, edgecolors='k', linewidths=0.8,
label='rms: ' + str(np.round(np.std(y_list[i]), 3)))
axs[i].locator_params(axis="y", nbins=5)

# set axes tick marks
axs[i].tick_params(labelbottom=True)
Expand Down
15 changes: 13 additions & 2 deletions build/lib/sdo_hmi_rvs/tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

class BaseDir:
"""
Base directory. Update this and follow same file structure and all will be well :)
Base directory.
Update this if you want to save the files outside the repo and follow same file structure and all will be well :)
"""
BASE_DIR = ''
BASE_DIR = os.path.realpath('../products/')


class CsvDir:
Expand All @@ -31,15 +32,24 @@ class ImgDir:
IMG_DIR = os.path.join(BaseDir.BASE_DIR, 'images')


class PlotDir:
"""
Directories that hold plotting style files
"""
MPL = os.path.join(BaseDir.BASE_DIR, 'mplstyle')


class Scaling:
"""
Class that holds scaling coefficients for RV calculations.
"""
pass


class HARPSN(Scaling):
"""
Class that holds HARPS-N scaling coefficients for RV calculations.
Fit using linear regression on HARPS-N data from 2015.
"""

A = 2.101
Expand All @@ -50,6 +60,7 @@ class HARPSN(Scaling):
class NEID(Scaling):
"""
Class that holds NEID scaling coefficients for RV calculations.
Fit using linear regression on NEID data from Dec 2020 - June 2021.
"""

A = 1.0983
Expand Down
21 changes: 21 additions & 0 deletions build/lib/sdo_hmi_rvs/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import os
import csv
import datetime

Expand Down Expand Up @@ -228,4 +229,24 @@ def check_date_format(date):
return date


def check_dir(dir_path):
"""
function to check if a directory exists and if not create one
Parameters
----------
dir_path : string
path to directory we are checking
Returns
-------
"""

# check that directory exist
exist_dir = os.path.isdir(dir_path)

# create directory if it does not exist
if not exist_dir:
os.makedirs(dir_path)
print("Created directory", dir_path)
Binary file added dist/sdo_hmi_rvs-0.1.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/sdo_hmi_rvs-0.1.1.tar.gz
Binary file not shown.
Loading

0 comments on commit e241b73

Please sign in to comment.