Insert text here
git clone [email protected]:njcuk9999/scarvs.git
Create a conda or python environment
e.g.
conda create --name scarvs-env python=3.10
conda activate scarvs-env
cd {SCARVS_ROOT}
pip install -U -e .
Note on can also use venv (instead of conda)
Note {SCARVS_ROOT}
is the path to the cloned github repository (i.e. /path/to/scarvs)
First install scarvs.
Once you've done this activate the environment you installed scarvs in.
(e.g. conda activate scarvs-env
)
To setup SCARVS, you need to run the following command:
scarvs_setup {yaml_file}
where yaml_file
is the yaml file you wish to create (if left blank you
will be asked for one).
To run SCARVS, you need activate the environemnt you installed scarvs in.
(e.g. conda activate scarvs-env
)
Then you need to run the following command:
scarvs_run {yaml_file}
To run SCARVS inside python, you need to import the scarvs module:
from scarvs.recipes import scarvs_run
# define the path to your yaml file
yaml_file = '/path/to/yaml_file.yaml'
# run scarvs
scarvs_run.main(yaml_file)
If you wish to override the yaml file, you can do so by passing in a dictionary as follows:
from scarvs.core import startup
from scarvs.core import general
# define the path to your yaml file
yaml_file = '/path/to/yaml_file.yaml'
# get parameters
params = startup.get_params(yaml_file)
# Define data path
params['DATA_DIR'] = '/path/to/data'
# Define plot path
params['PLOT_DIR'] = '/path/to/plots'
# --------------------------------------------------------------
# Then use the following to run scarvs
# ---------------------------------------------------------------
# run science functions
for science_func in params['SCIFUNCS']:
# check whether we should run this function then run it
if general.check_run(params, science_func, 'SCIENCE'):
# log the we are running a function
general.log_run(params, science_func, 'SCIENCE')
# run the science function
params['SCIFUNCS'][science_func](params)
# run plotting functions
for plot_func in params['PLOTFUNCS']:
# check whether we should run this function then run it
if general.check_run(params, plot_func, 'PLOTTING'):
# log the we are running a function
general.log_run(params, plot_func, 'PLOTTING')
# run the plotting function
params['PLOTFUNCS'][plot_func](params)
To run an individual function, you can call the dictionary and run the function
from scarvs.core import startup
# define the path to your yaml file
yaml_file = '/path/to/yaml_file.yaml'
# get parameters
params = startup.get_params(yaml_file)
# run the science "TEST" function
params['SCIFUNCS']['TEST'](params)
# run the plotting "TEST" function
params['PLOTFUNCS']['TEST'](params)
A note book and yaml example are provided in the scarvs/docs directory.