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 bff01bf commit 3f1aa2e
Show file tree
Hide file tree
Showing 32 changed files with 1,709 additions and 800 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,22 @@ Pipeline to independently derive 'sun-as-a-star' radial velocity variations.
* ``conda env create -f conda_env.yml``
* to add new dependencies, update conda_env.yml [file](conda_env.yml)
* run the following from the folder containing the .yml file
* ``conda env update -f conda_env.yml``
* ``conda env update -f conda_env.yml``

# Examples
Examples are hosted [here](https://github.com/tamarervin/sdo_hmi_rvs/tree/main/sdo_hmi_rvs/examples):

1. [Sunpy Example](https://github.com/tamarervin/sdo_hmi_rvs/blob/main/sdo_hmi_rvs/examples/sunpy_example.ipynb):
outlines how to use basic Sunpy functions and usages for this package

2. [Component Calculations](https://github.com/tamarervin/sdo_hmi_rvs/blob/main/sdo_hmi_rvs/examples/component_calculations.ipynb):
outlines the corrections and component calculation pipeline
* creates CSV with calculations of magnetic observables and velocity components

3. [RV Calculations](https://github.com/tamarervin/sdo_hmi_rvs/blob/main/sdo_hmi_rvs/examples/rv_calculation.ipynb):
outlines calculation of full model RV from velocity components
* requires input CSV with velocity components from [example 2](https://github.com/tamarervin/sdo_hmi_rvs/blob/main/sdo_hmi_rvs/examples/component_calculations.ipynb)

4. [Full Pipeline](https://github.com/tamarervin/sdo_hmi_rvs/blob/main/sdo_hmi_rvs/examples/full_pipeline.ipynb):
full end-to-end pipeline to calculate 'sun-as-a-star' RVs and magnetic observables

21 changes: 18 additions & 3 deletions build/lib/sdo_hmi_rvs/source/rv_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys

import time
import pytz
import datetime
import numpy as np

Expand All @@ -34,8 +35,23 @@

# dates and querying cadence
cadence = 60*60 # querying cadence in seconds
start_date = datetime.datetime(2021, 8, 26, 8, 00, 0)
end_date = datetime.datetime(2021, 9, 3, 0, 00, 0)
start_date = datetime.datetime(2021, 8, 26, 8, 00, 0, pytz.UTC)
end_date = datetime.datetime(2021, 9, 3, 0, 00, 0, pytz.UTC)

### ----- do not update anything below ----- ###
# check date formats
start_date = utils.check_date_format(start_date)
end_date = utils.check_date_format(end_date)

# check cadence format
if type(cadence) != int:
raise ('Calculation cadence must be an integer value in seconds.')

# create file names
if csv_name is None:
csv_name = str(start_date)
if type(csv_name) != str:
raise ('The csv name must be a string.')

# print out csv title
print("Beginning calculation of values for csv file: " + csv_name)
Expand Down Expand Up @@ -81,7 +97,6 @@
utils.append_list_as_row(bad_dates_csv, save_vals)
# print that the files are missing
print('\nNot three good files: ' + date_str + ' index: ' + str(i))

pass
else:
# convert to map sequence
Expand Down
Loading

0 comments on commit 3f1aa2e

Please sign in to comment.