diff --git a/scripts/SPIE/data/file_descriptions.md b/scripts/SPIE/data/file_descriptions.md index 41128ed..dc65694 100644 --- a/scripts/SPIE/data/file_descriptions.md +++ b/scripts/SPIE/data/file_descriptions.md @@ -2,6 +2,46 @@ Most of the files contained in this folder are intermediate results that I later used for plotting a figure or - in some cases - continuing an analysis. +The files are pickle files. Be careful with opening pickle files if you don't trust the source! If you do trust me, then go ahead. The following functions were used during this work and can be used to save and load the variables: +```python +def save_variable(filename, variable): + ''' + Dumps the given variable to a binary pickle file + for later use. + + Parameters + ---------- + filename : string + Filename, possibly including the location + where it needs to be saved. + variable : TYPE + The variable to be saved. + ''' + with open(filename, 'wb') as f: + pickle.dump(variable, f, protocol=-1 ) + + +def load_variable(filename): + ''' + Loads a binary pickle file for use. + + Parameters + ---------- + filename : string + Description + + Returns + ------- + TYPE + variable + ''' + with open(filename, 'rb') as f: + variable = pickle.load(f) + return variable + +``` + + ## `/ADC rotation` Contains the "nominal" and "perturbed" geometric distortion points for various rotation angles of the ADC.