Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn run_recipes into an importable class #52

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Conversation

JenniferKarr
Copy link
Contributor

Turned the script format of run_recipes in to an importable class, in preparation for allowing separate directories for different types of simulations (ESO, AIT).

The running of the simulations is unchanged but there is a fairly major reorganization of the code.

run_recipes.py has the same calling syntax as before, but now acts as a wrapper for the class in runRecipes.py.

The command line parameters are now stored in a dictionary in runRecipes.params, rather than a series of individual variables.

updateHeaders has been incorporated into the main routine.

The option --calibFile will write the calibration dictionary to a YAML file in the same form as the input YAML.

The DIT field in thex output file names has been removed as unneeded.

The validation has been updated to include the list of filter and ndfilter names.

There are now methods
parseCommandLine(args) - parse the command line options

loadYAML() - read in the YAML file and filter
   _load_yaml - load the YAML
   _filter_yaml - filter the dictionary

validateYAML() - validate the keywords

calcDark(props) - given a dictionary, determine the dark (if any) that is needed

calcSkyFlat(props) - given a dictionary, determine the sky flat (if any) that is needed

calcLampFlat(props) - given a dictionary, determine the lamp flat (if any) that is needed

calculateCalibs - generate a dictionary, in the same format as read from the YAML file, for flats and darks

generateFilename(dateobs,doCatg,dit,prefix) - generate a filename for the output file

dumpCalibsToFile(filename) - write the calibration dictionary to a YAML file (which could be used as input to run_recipes)

updateHeaders - update the headers for generate files

runSimulations(recipes) - wrapper to call the main _run method for the YAML file

runCalibraitons(recipes) - wrapper to call the main _run method for the calibrations

_run(recipes) - run simulations for the set of recipes

Copy link
Contributor

@hugobuddel hugobuddel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

… preparation for allowing separate directories for different types of simulations (ESO, AIT).

run_recipes.py has the same calling syntax as before, but now acts as a wrapper for the class in runRecipes.py.

The command line parameters are now stored in a dictionary in runRecipes.params, rather than a series of individual variables.

updateHeaders has been incorporated into the main routine.

The option --calibFile will write the calibration dictionary to a YAML file in the same form as the input YAML.

The DIT field in thex output file names has been removed as unneeded.

The validation has been updated to include the list of filter and ndfilter names.

There are now methods
    parseCommandLine(args)  - parse the command line options

    loadYAML() - read in the YAML file and filter
       _load_yaml - load the YAML
       _filter_yaml - filter the dictionary

    validateYAML() - validate the keywords

    calcDark(props) - given a dictionary, determine the dark (if any) that is needed

    calcSkyFlat(props) - given a dictionary, determine the sky flat (if any) that is needed

    calcLampFlat(props) - given a dictionary, determine the lamp flat (if any) that is needed

    calculateCalibs - generate a dictionary, in the same format as read from the YAML file, for flats and darks

    generateFilename(dateobs,doCatg,dit,prefix) - generate a filename for the output file

    dumpCalibsToFile(filename) - write the calibration dictionary to a YAML file (which could be used as input to run_recipes)

    updateHeaders - update the headers for generate files

    runSimulations(recipes) - wrapper to call the main _run method for the YAML file

    runCalibraitons(recipes) - wrapper to call the main _run method for the calibrations

    _run(recipes) - run simulations for the set of recipes
@JenniferKarr JenniferKarr merged commit ba6c720 into main Oct 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants