1 # Copyright (C) 2012 W. Trevor King <wking@tremily.us>
3 # This file is part of unfold_protein.
5 # unfold_protein is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option) any
10 # unfold_protein is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 # You should have received a copy of the GNU General Public License along with
16 # unfold_protein. If not, see <http://www.gnu.org/licenses/>.
18 """Define some variables to configure the package for a particular lab
21 import os.path as _os_path
24 from FFT_tools import window_hann as _window_hann
25 import h5config.config as _config
26 import h5config.tools as _h5config_tools
27 import numpy as _numpy
30 class PackageConfig (_h5config_tools.PackageConfig):
31 "Configure `unfold_protein` module operation"
32 settings = _h5config_tools.PackageConfig.settings + [
33 _config.BooleanSetting(
35 help='Plot piezo motion using `matplotlib`.',
39 class ApproachConfig (_config.Config):
40 "Configure `unfold_protein` approach operation"
43 name='relative setpoint',
44 help=('Maximum relative deflection in volts to achieve the bind '
49 help='Approach velocity in meters/second.',
53 help='Step size in meters.',
55 _config.IntegerSetting(
57 help=('Approximate distance in meters to move away to get "far" '
58 'from the surface. For possible stepper adjustments while '
59 'initially locating the surface.'),
63 class UnfoldConfig (_config.Config):
64 "Configure `unfold_protein` unfold operation"
68 help='Unfolding distance in meters.',
72 help='Unfolding velocity in meters/second.',
76 help='Sampling frequency in Hz.',
80 class SaveConfig (_config.Config):
81 "Configure `unfold_protein` unfold operation"
84 name='base directory',
85 help='Root directory for saving data.',
86 default=_os_path.expanduser('~/rsrch/data/unfold/')),
89 class UnfoldCycleConfig (_config.Config):
90 "Configure a full `unfold_protein` approach-bind-unfold cycle"
92 _config.ConfigSetting(
94 help=('Configure the approach for an approach-bind-unfold '
96 config_class=ApproachConfig),
99 help=('Binding time in seconds for an approach-bind-unfold '
102 _config.ConfigSetting(
104 help=('Configure the unfolding for an approach-bind-unfold '
106 config_class=UnfoldConfig),
107 _config.ConfigSetting(
109 help='Configure saving.',
110 config_class=SaveConfig),
113 class VelocityScanConfig (_config.Config):
114 "Configure `unfold_config` unfolding velocity scan"
116 _config.FloatListSetting(
117 name='unfolding velocities',
118 help='Unfolding velocities in meters per second.',
119 default=list(float(x) for x in _numpy.exp(_numpy.linspace(
120 _numpy.log(20e-9), _numpy.log(2e-6), 10)))),
121 _config.IntegerSetting(
123 help='Number of loops through the scanned velocities.',
127 class PositionScanConfig (_config.Config):
128 "Configure `unfold_config` contact position scan"
130 _config.FloatSetting(
132 help=('Distance in meters along the x axis between successive '
135 _config.FloatSetting(
137 help='Maximum sampled x position in meters.',
139 _config.FloatSetting(
141 help='Minimum sampled x position in meters.',
145 class ScanConfig (_config.Config):
146 "Configure a full `unfold_protein` approach-bind-unfold cycle"
148 _config.ConfigSetting(
150 help='Configure unfolding velocity scan pattern.',
151 config_class=VelocityScanConfig),
152 _config.ConfigSetting(
154 help='Configure unfolding position scan pattern.',
155 config_class=PositionScanConfig),