API

simmer.add_dark_exp module

For ShARCS, the darks are often produced by an automated script at the end of a night. This module adds these frames to the log sheet.

simmer.add_dark_exp.add_dark_exp(inst, log, raw_dir, tab=None)[source]

Adds dark exposures to the end of log sheet if not specified.

Inputs:
tab

(string) tab of Excel sheet to be used.

inst

(Instrument object) instrument for which data is being reduced.

log

(string path of the logsheet.

raw_dir

(string) path of the directory containing the raw data.

simmer.add_dark_exp.find_itimes(inst, raw_dir)[source]

Read headers for all darks and make a list showing exposure times.

Inputs:
inst

(Instrument object) instrument for which data is being reduced.

raw_dir

(string) path of the directory containing the raw data.

simmer.check_logsheet module

Capability to check whether logsheet format is conducive to creating a config.

simmer.check_logsheet.check_logsheet(inst, log_name, tab=None, add_dark_times=False)[source]

Checks for common typos/type errors in the logsheet. Should be run if an Excel worksheet is sent.

Inputs:
inst

(Instrument object) instrument for which data is being reduced.

log_name

(string) path of the logsheet.

tab

(string) tab of interest,

add_dark_times

(bool) if true, runs the script within add_dark_exp to add the data from the automated dark script to the log sheet.

Outputs:
failed

(int) number of failed logsheet checks.

simmer.create_config module

Creates config file from logsheet. Will move into either utils or example folder.

exception simmer.create_config.LogsheetError[source]

Bases: ValueError

For incorrect values within a logsheet that can break create_config with opaque error messages.

simmer.create_config.create_config(log, config_file, tab=None)[source]

Create config csv file out of tab in logsheet.

Inputs:
log

(string) path of the logsheet.

config_file

(string) path of the desired concrete file, including the file name.

tab

(string) tab of logsheet to be turned into.

simmer.create_config.get_filenums(logdf)[source]
Inputs:

logdf: (pd.DataFrame) logsheet in Pandas DataFrame.

Outputs:
filenums: (list) numbers associated with each file

associated with each object.

simmer.create_config.isolate_columns(logdf)[source]

Isolates the subset of columns in a DataFrame log that are relevant to data reduction.

Inputs:

logdf: (pd.DataFrame) logsheet in Pandas DataFrame.

Outputs:

savedf: (pd.DataFrame) Pandas DataFrame to be used in reduction.

simmer.create_config.read_logsheet(log, tab=None)[source]

Reads in a user-defined logsheet, either in CSV or XLSX form.

Inputs:

log: (string) path to logsheet. tab: (string) sheet of a multiple-page logsheet

Outputs:

logdf: (pd.DataFrame) logsheet in Pandas DataFrame.

simmer.darks module

Functions to work with darks.

simmer.darks.create_darks(raw_dir, reddir, darklist, inst)[source]

creates the actual darks from a list of dark file numbers, taking the median and writing to a file. Returns the final dark.

Inputs:
reddir

(string) directory for the reduced data

darklist

string) list of dark file numbers

inst

(Instrument object) instrument for which data is being reduced.

simmer.darks.dark_driver(raw_dir, reddir, config, inst, plotting_yml=None)[source]

Night should be entered in format ‘yyyy_mm_dd’ as string. This will point toward a config file for the night with darks listed.flat

Inputs:
raw_dir

(string) directory for the raw data

reddir

(string) directory for the reduced data

config

(pandas DataFrame) dataframe corresponding to config sheet for data.

inst

(Instrument object) instrument for which data is being reduced.

plotting_yml

(string) path to the plotting configuration file.

simmer.drivers module

Module for driving reduction processes. Contains highest-level API.

simmer.drivers.all_driver(inst, config_file, raw_dir, reddir, plotting_yml=None, searchsize=10)[source]

Runs all drivers, performing an end-to-end reduction.

Inputs:
inst

(Instrument object) instrument for which data is being reduced.

config_file

(string) path of the config file containing plotting specifications. Optional.

raw_dir

(string) path of the directory containing the raw data.

reddir

(string) path of the directory to contain the raw data.

plotting_yml

(string) path to the plotting configuration file.

simmer.drivers.config_driver(inst, config_file, raw_dir, reddir)[source]

Runs all_drivers, terminating afrer running sky_driver.

Inputs:
inst

(Instrument object) instrument for which data is being reduced.

config_file

(string) path of the config file.

raw_dir

(string) path of the directory containing the raw data.

reddir

(string) path of the directory to contain the raw data.

simmer.drivers.image_driver(inst, config_file, raw_dir, reddir)[source]

Runs all_drivers, terminating afrer running image_drivers.

Inputs:
inst

(Instrument object) instrument for which data is being reduced.

config_file

(string) path of the config file.

raw_dir

(string) path of the directory containing the raw data.

reddir

(string) path of the directory to contain the raw data.

simmer.flats module

Functions to work with flats.

exception simmer.flats.DarkOpeningError[source]

Bases: FileNotFoundError

simmer.flats.create_flats(raw_dir, reddir, flatlist, darkfile, inst, filter_name=None, test=False)[source]

Create a flat from a single list of flat files.

Inputs:
raw_dir

(str) directory where the raw data is stored.

reddir

(str) directory where the reduced data is stored.

flatlist

(list) list of integers corresponding to flats.

inst

(inst object) instrument for which data is being reduced.

center

(tuple) two-element tuple dictating where the center of each image is.

npix

(int) number of pixels in image.

filter_name

(str) filter name given if head[‘FILT1NAM’] == ‘Unknown’

plotting_yml

(string) path to the plotting configuration file.

test

(bool) Boolean flag used for testing purposes.

Outputs:
final_flat

(array) median-filtered flat.

simmer.flats.flat_driver(raw_dir, reddir, config, inst, plotting_yml=None)[source]

Sets up and runs create_flats.

Inputs:
raw_dir

(string) directory for the raw data

reddir

(string) directory for the reduced data

config

(pandas DataFrame) dataframe corresponding to config sheet for data.

inst

(Instrument object) instrument for which data is being reduced.

plotting_yml

(string) path to the plotting configuration file.

simmer.flats.open_darks(darkfile)[source]

Opens dark files. Essentially a wrapper around pyfits.getdata that also includes a descriptive exception if the file doesn’t exist.

Inputs:
darkfile

(str) path to dark to be opened.

Outputs:
dark

(array) data from darks FITS file.

simmer.image module

Module to make the image stacking / production occur.

exception simmer.image.FlatOpeningError[source]

Bases: ValueError

simmer.image.create_im(s_dir, ssize1, plotting_yml=None, fdirs=None, method='default')[source]

Take the shifted, cut down images from before, then perform registration and combine. Tests should happen before this, as this is a per-star basis.

Inputs:
s_dir

(str) directory for the raw data

ssize1

(int) initial pixel search size of box.

plotting_yml

(str) path to the plotting configuration file.

fdirs

(list of str) file directories.

method

(str) image registration method.

simmer.image.create_imstack(raw_dir, reddir, s_dir, imlist, inst, plotting_yml=None, filter_name=None)[source]

Create the stack of images by performing flat division, sky subtraction.

Inputs:
raw_dir

(string) path to directory containing raw data

reddir

(string) path to directory containing reduced data

s_dir

(string) path to directory corresponding to a specific star.

imlist

(list) list of strings of paths pointing to image files.

inst

(Instrument object) instrument for which data is being reduced.

plot

(bool) determines whether or not intermediate plots should be produced.

filter_name

(string) name of the filter used for the images in question.

Outputs:
im_array

(3d array) array of 2d images.

shifts_all

recording of all the x-y shifts made

simmer.image.image_driver(raw_dir, reddir, config, inst, plotting_yml=None)[source]

Do flat division, sky subtraction, and initial alignment via coords in header. Returns Python list of each registration method used per star.

Inputs:
raw_dir

(string) directory for the raw data

reddir

(string) directory for the reduced data

config

(pandas DataFrame) dataframe corresponding to config sheet for data.

inst

(Instrument object) instrument for which data is being reduced.

plotting_yml

(string) path to the plotting configuration file.

simmer.image.open_flats(flatfile)[source]

Opens flats files. Essentially a wrapper around pyfits.getdata that also includes a descriptive exception if the file doesn’t exist.

Inputs:
flatfile

(str) path to dark to be opened.

Outputs:
dark

(array) data from darks FITS file.

simmer.insts module

Module for instrument class and subclasses.

class simmer.insts.Instrument(take_skies=False)[source]

Bases: object

Instantiates an object that implements instrument-specific reduction techniques.

bad_pix(image)[source]

Read in bad pixel file, cut down to size, and replace NaN pixels with median of surrounding pixels.

Inputs:
image

(2D numpy array) image to be filtered for bad pixels.

Outputs:
iamge

(2D numpy array) image, now filtered for bad pixels. Same dimensions as input image.

name = None
npix = 10
class simmer.insts.PHARO(take_skies=False)[source]

Bases: simmer.insts.Instrument

For use on the PHARO instrument at Palomar.

adjust_array(array, nims)[source]
adjust_im(image)[source]
adjust_thisimage(thisimage)[source]
center = nan
file_prefix = 'sph'
filt(nims, head, filter_name)[source]

Given the header of a FITS file, returns its filter.

Inputs:
nims

(int) number of images.

head

(astropy.io.fits header object) head of object of interest.

filter_name

(str) name of filter to use in the event that the filter is unknown in the header.

Outputs:
filt

(str) name of filter used to observe object of interest.

filter_headtolog = {'Br-gamma': 'BrG', 'J': 'J', 'K-short': 'Ks'}
filter_logtohead = {'BrG': 'Br-gamma', 'BrG+H2': 'Br-gamma', 'J': 'J', 'Ks': 'K_short'}
head(file)[source]

Returns the head of a FITS file.

Inputs:
file

(str) path to FITS file of interest.

itime(head)[source]

Given a FITS header, returns the true integration time for a file.

Inputs:
head

(astropy.io.fits header object) head of object of interest.

Outputs:
itime_val

(float) integration time for object of interest.

name = 'PHARO'
npix = nan
off = (-462, -462)
plate_scale = 0.025
plim = (462, 562)
read_data(raw_dir, new_dir)[source]

Reads data.

Inputs:
rawdir

(string) absolute path to directory containing raw data. File path should end with ‘/’.

newdir

(string) absolute path to directory that will contain 4-quadrant data. File path should end with ‘/’.

Outputs:

None

replace_filters = {'BrG-2.16': ['Ks', 'K'], 'H2-2.2122': ['Ks', 'K'], 'J+CH4-1.2': 'J', 'K+CH4-2.4': ['Ks', 'K']}
class simmer.insts.ShARCS(take_skies=False)[source]

Bases: simmer.insts.Instrument

For use on the ShARCS camera on the Shane 3m telescope at Lick observatory.

adjust_array(array, nims)[source]
adjust_im(image)[source]
adjust_thisimage(thisimage, rawfile)[source]
bad_pix(image)[source]

Read in bad pixel file, cut down to size, replace bad pixels with median of surrounding pixels.

Inputs:
image

(2D numpy array) image to be filtered for bad pixels.

Outputs:
iamge

(2D numpy array) image, now filtered for bad pixels. Same dimensions as input image.

center = (750, 1100)
file_prefix = 's'
filt(nims, head, filter_name)[source]

Given the header of a FITS file, returns its filter.

Inputs:
nims

(int) number of images.

head

(astropy.io.fits header object) head of object of interest.

filter_name

(str) name of filter to use in the event that the filter is unknown in the header.

Outputs:
filt

(str) name of filter used to observe object of interest.

filter_headtolog = {'BrG-2.16': 'BrG', 'J': 'J+CH4-1.2', 'Ks': 'K'}
filter_logtohead = {'BrG': 'BrG-2.16', 'J+CH4-1.2': 'J', 'K': 'Ks', 'Ks': 'Ks'}
head(file)[source]

Given a FITS file, returns its head.

Inputs:
file

(str) path to file.

itime(head)[source]

Given a FITS header, returns the true integration time for a file.

Inputs:
head

(astropy.io.fits header object) head of object of interest.

Outputs:
itime_val

(float) integration time for object of interest.

name = 'ShARCS'
npix = 600
off = (-250, -250)
plate_scale = 0.033
plim_inds = (250, 350)
read_data(night, rawfilename, newfilename)[source]
replace_filters = {'BrG-2.16': ['Ks', 'K'], 'H2-2.2122': ['Ks', 'K'], 'J+CH4-1.2': 'J', 'K+CH4-2.4': ['Ks', 'K']}

simmer.registration module

Module containing all functions related to image center-finding and stacking.

simmer.registration.calc_shifts(dat, x_initial, y_initial, xrad, yrad, find='max', method='radon')[source]

Do the radon search and then translate back to image coordinates.

simmer.registration.find_wide_binary(image)[source]

Performs the first step of image registration for a science image that contains a wide binary. User input selects which target is the primary star of interest in the first frame of the target.

inputs:
image

(2-d array) photon counts at each pixel of each science image.

outputs:
rough_center

(2-element tuple) rough center of image, as determined by the user.

simmer.registration.register_bruteforce(image, rough_center=None)[source]

Performs the default image registration scheme. Shifts the center of the image to the peak.

inputs:
image

(2-d array) photon counts at each pixel of each science image.

rough_center

(2-d array, default None) location of primary star. This argument is only passed in the wide binary case.

outputs:

image_centered : (2-d array) image cenered by the rotations method.

simmer.registration.register_saturated(image, searchsize1, newshifts1, rough_center=None)[source]

Performs image registration when a saturated star is present in the science image.

inputs:
image

(2-d array) photon counts at each pixel of each science image.

searchsize1

(int) initial size of search for center of image.

newshifts1

(list) keeps tracks of x-y shifts.

rough_center

(2-d array, default None) location of primary star. This argument is only passed in the wide binary case.

outputs:
image_centered

(2-d array) image centered by the rotations method.

rot

the rotation

newshifts1

(list) keeps tracks of x-y shifts.

simmer.registration.roll2d(dat, xshift, yshift)[source]

Essentially performs numpy roll function in 2 dimensions.

inputs:
dat

(2d array) image data.

xshift

(int) shift in the x direction.

yshift

(int) shift in the y direction.

simmer.registration.roll_shift(image, shifts, cval=0.0)[source]

Rolls and shifts image.

inputs:
image

(2-d array) photon counts at each pixel of each science image.

shifts

(1-d array of tuples) Enter shifts as (drow, dcol).

Perform rotational search of an image.

Inputs:
dat

(2d array) image data.

x_initial

(int) the initial guess for the x-coordinate of the center.

y_initial

(int) the initial guess for the y-coordinate of the center.

xrad

(int) radius in x to search.

yrad

(int) radius in y to search.

outputs:
(xshift, yshift)

(tuple) record of how much the image was shifted in x and y

out

(2d array) output shifted image

simmer.registration.rotate_sub(dat)[source]

Rotate the image about the center point, then subtract from original and record residuals. Does this at set angles.

inputs:
dat

(2d array) image data.

outputs:
total_residuals

(float) the summed total residuals.

simmer.registration.run_rot(image, searchsize, center, newsize)[source]

Runs all rotations.

simmer.registration.shift_bruteforce(image, base_position=None)[source]

This will shift the maximum pixel to base_position (i.e. the center of image). Make sure base_position is entered as (int,int).

simmer.registration.zoom_image(image, rough_center)[source]

Zooms in around a smaller portion of the image for further registration.

inputs:
image

(2-d array) photon counts at each pixel of each science image.

rough_center

(2-d array, default None) location of primary star. This argument is only passed in the wide binary case.

outputs:

zoomed_image : (2-d array) image zoomed around the provided center.

simmer.search_headers module

Search for issues in FITS file headers similar to s0512.fits from night 2015_10_26, which did not contain either/both DATAFILE or/and FRAMENUM in the header. These issues are only known to occur with ShARCS data.

simmer.search_headers.search_headers(raw_dir, write_dir=None)[source]

Function to perform search of FITS headers.

Inputs:
raw_dir

(string) absolute path to directory containing raw data.

write_dir

(string) absolute path to directory containing raw data. Defaults to None; if this is the case, it’s reassigned to the raw_dir directory.

simmer.sky module

Functions to work with skies.

simmer.sky.create_skies(raw_dir, reddir, s_dir, skylist, inst, plotting_yml=None, filter_name=None)[source]

Create a sky from a single list of skies. sf_dir is the reduced directory for the specific star and filter.

Inputs:
raw_dir

(string) directory for the raw data

reddir

(string) directory for the reduced data

s_dir

(string) directory corresponding to a specific star.

skylist

(list) list of strings of paths pointing to sky files.

inst

(Instrument object) instrument for which data is being reduced.

plotting_yml

(string) path to the plotting configuration file.

Outputs:
final_sky

(2D array) medianed sky image.

simmer.sky.sky_driver(raw_dir, reddir, config, inst, plotting_yml=None)[source]

Night should be entered in format ‘yyyy_mm_dd’ as string. This will point toward a config file for the night with flats listed.

Inputs:
raw_dir

(string) directory for the raw data

reddir

(string) directory for the reduced data

config

(pandas DataFrame) dataframe corresponding to config sheet for data.

inst

(Instrument object) instrument for which data is being reduced.

plotting_yml

(string) path to the plotting configuration file.

simmer.utils module

This module provides utility functions for the reduction pipeline.

simmer.utils.find_angle(loc1, loc2)[source]

Calculated the angle between two locations on a grid.

Inputs:
loc1

(tuple) first location.

relative

(tuple) second location.

Outputs:

:angle : (float) real-valued angle between loc1 and loc2.

simmer.utils.header_subsection(input_image_file, npix, center)[source]

Reads out the header of a subsection.

Inputs:
input_image

(2D array) image of which a subsection is desired.

center

(tuple) center of image, with format (x, y)

npix

(float) value for size of return image. If non-square image desired, enter as list.

Outputs:
header

(FITS header) header of the image file, adjusted accordingly.

simmer.utils.image_subsection(input_image, npix, center)[source]

reads in a full image array, selects the relevant subsection of the array, and returns the new array, transposed for use with Python. input_image must be 2D

Inputs:
input_image

(2D array) image of which a subsection is desired.

center

(tuple) center of image, with format (x, y)

npix

(float) value for size of return image. If non-square image desired, enter as list.

default

center = (750, 1100)

npix

= 600 for inscribed region or npix = 1000 for circumscribing region

transposed

= np.rot90(input_image.T,2)

transposed

= np.rot90(input_image,2)

center

= (2047-center[0],2047-center[1]

Outputs:
subsection

(2d array) subsection of original image.

)

simmer.utils.make_filelist(directory, numlist, inst)[source]

Turn a list of numbers into a list of properly formatted filenames.

Inputs:
directory

(string) path leading to directory of interest.

numlist

(list) list of numbers corresponding to fits files.

inst

(Instrument object) instrument for which data is being reduced.

Outputs:
filelist

(list) list of strings pertaining to files of interest

simmer.utils.read_imcube(filelist)[source]

Reads a stack of fits files into an image cube of dimensions (nims, xpix, ypix).

Inputs:
filelist

(list) list of strings pertaining to files of interest.

Outputs:
im_array

(3D array) array of 2D arrays pertaining to the files in filelist.

simmer.schemas.custom_validator module

Includes all custom (i.e., not provided by Cerberus) validators used by SImMER.

class simmer.schemas.custom_validator.SimmerValidator(*args, **kwargs)[source]

Bases: cerberus.validator.Validator

Validator class. Normalizes and/or validates any mapping against a validation-schema which is provided as an argument at class instantiation or upon calling the validate(), validated() or normalized() method. An instance itself is callable and executes a validation.

All instantiation parameters are optional.

There are the introspective properties types, validators, coercers, default_setters, rules, normalization_rules and validation_rules.

The attributes reflecting the available rules are assembled considering constraints that are defined in the docstrings of rules’ methods and is effectively used as validation schema for schema.

Parameters
  • schema (any mapping) – See schema. Defaults to None.

  • ignore_none_values (bool) – See ignore_none_values. Defaults to False.

  • allow_unknown (bool or any mapping) – See allow_unknown. Defaults to False.

  • require_all (bool) – See require_all. Defaults to False.

  • purge_unknown (bool) – See purge_unknown. Defaults to to False.

  • purge_readonly (bool) – Removes all fields that are defined as readonly in the normalization phase.

  • error_handler (class or instance based on BaseErrorHandler or tuple) – The error handler that formats the result of errors. When given as two-value tuple with an error-handler class and a dictionary, the latter is passed to the initialization of the error handler. Default: BasicErrorHandler.

checkers = ()
coercers = ()
default_setters = ()
normalization_rules = {'coerce': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'default': {'nullable': True}, 'default_setter': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}, 'purge_unknown': {'type': 'boolean'}, 'rename': {'type': 'hashable'}, 'rename_handler': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}}
rules = {'allof': {'logical': 'allof', 'type': 'list'}, 'allow_unknown': {'oneof': [{'type': 'boolean'}, {'type': ['dict', 'string'], 'check_with': 'bulk_schema'}]}, 'allowed': {'type': 'container'}, 'anyof': {'logical': 'anyof', 'type': 'list'}, 'check_with': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'coerce': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'contains': {'empty': False}, 'default': {'nullable': True}, 'default_setter': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}, 'dependencies': {'check_with': 'dependencies', 'type': ('dict', 'hashable', 'list')}, 'empty': {'type': 'boolean'}, 'excludes': {'schema': {'type': 'hashable'}, 'type': ('hashable', 'list')}, 'forbidden': {'type': 'list'}, 'items': {'check_with': 'items', 'type': 'list'}, 'keysrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}, 'max': {'nullable': False}, 'maxlength': {'type': 'integer'}, 'meta': {}, 'min': {'nullable': False}, 'minlength': {'type': 'integer'}, 'noneof': {'logical': 'noneof', 'type': 'list'}, 'nullable': {'type': 'boolean'}, 'oneof': {'logical': 'oneof', 'type': 'list'}, 'purge_unknown': {'type': 'boolean'}, 'readonly': {'type': 'boolean'}, 'regex': {'type': 'string'}, 'rename': {'type': 'hashable'}, 'rename_handler': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'require_all': {'type': 'boolean'}, 'required': {'type': 'boolean'}, 'schema': {'anyof': [{'check_with': 'schema'}, {'check_with': 'bulk_schema'}], 'type': ['dict', 'string']}, 'type': {'check_with': 'type', 'type': ['string', 'list']}, 'valuesrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}}
validation_rules = {'allof': {'logical': 'allof', 'type': 'list'}, 'allow_unknown': {'oneof': [{'type': 'boolean'}, {'type': ['dict', 'string'], 'check_with': 'bulk_schema'}]}, 'allowed': {'type': 'container'}, 'anyof': {'logical': 'anyof', 'type': 'list'}, 'check_with': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'contains': {'empty': False}, 'dependencies': {'check_with': 'dependencies', 'type': ('dict', 'hashable', 'list')}, 'empty': {'type': 'boolean'}, 'excludes': {'schema': {'type': 'hashable'}, 'type': ('hashable', 'list')}, 'forbidden': {'type': 'list'}, 'items': {'check_with': 'items', 'type': 'list'}, 'keysrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}, 'max': {'nullable': False}, 'maxlength': {'type': 'integer'}, 'meta': {}, 'min': {'nullable': False}, 'minlength': {'type': 'integer'}, 'noneof': {'logical': 'noneof', 'type': 'list'}, 'nullable': {'type': 'boolean'}, 'oneof': {'logical': 'oneof', 'type': 'list'}, 'readonly': {'type': 'boolean'}, 'regex': {'type': 'string'}, 'require_all': {'type': 'boolean'}, 'required': {'type': 'boolean'}, 'schema': {'anyof': [{'check_with': 'schema'}, {'check_with': 'bulk_schema'}], 'type': ['dict', 'string']}, 'type': {'check_with': 'type', 'type': ['string', 'list']}, 'valuesrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}}

simmer.schemas.read_yml module

simmer.schemas.read_yml.get_plotting_args(yml_filename=None)[source]

Gets plotting args.

Inputs:
yml_filename

(string) path of the plotting yml to be used. Defaults to None.

Outputs:
plotting_arg

(dictionary) all arguments that are related to plotting. See the plotting_schema.yml schema for documentation of keys and values.

simmer.schemas.read_yml.normalize(yml_dict, validator, schema, plot_types)[source]
Inputs:
yml_dict

(dictionary) the dictionary to be normalized against a schema

validator

(SimmerValidator) the validator object used.

schema

the schema against which the yml_dict is normalized.

plot_types

(list of strings) the basic plot_types that must be in the uppermost keys.

Outputs:
normalized

normalized dictionary.

simmer.schemas.read_yml.read_yml(yml_filename)[source]

Reads in a yaml file.

Inputs:
yml_filename

(string) path to the yml.

Outputs:
parsed_yml_file

(dictionary) key-value pairs as read from the yaml file.

simmer.schemas.read_yml.validate_yml(schema_filename, yml_filename)[source]

Ensures that a given yml file is in accordance with the provided schema. In essence, this ensures that no odd keys or fields are provided to the yml.

Inputs:
schema_filename

(string) path to schema yaml.

yml_filename

(string) path to yml yaml.

Outputs:
validated

(bool) whether or not the yaml was successfully validated.