1 # Copyright (C) 2011 W. Trevor King <wking@drexel.edu>
3 # This file is part of unfold_protein.
5 # Unfold_protein is free software: you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation, either
8 # version 3 of the License, or (at your option) any later version.
10 # Unfold_protein is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with unfold_protein. If not, see
17 # <http://www.gnu.org/licenses/>.
19 """Define some variables to configure the package for a particular lab
22 import os.path as _os_path
25 from FFT_tools import window_hann as _window_hann
26 import h5config.config as _config
27 import h5config.tools as _h5config_tools
28 import numpy as _numpy
29 from calibcant.config import TemperatureConfig
32 class PackageConfig (_h5config_tools.PackageConfig):
33 "Configure `unfold_protein` module operation"
34 settings = _h5config_tools.PackageConfig.settings + [
35 _config.BooleanSetting(
37 help='Plot piezo motion using `matplotlib`.',
41 help=('Default temperature for unfolding in degrees '
46 class ApproachConfig (_config.Config):
47 "Configure `unfold_protein` approach operation"
50 name='relative setpoint',
51 help=('Maximum relative deflection in volts to achieve the bind '
56 help='Approach velocity in meters/second.',
60 help='Step size in meters.',
62 _config.IntegerSetting(
64 help=('Approximate distance in meters to move away to get "far" '
65 'from the surface. For possible stepper adjustments while '
66 'initially locating the surface.'),
70 class UnfoldConfig (_config.Config):
71 "Configure `unfold_protein` unfold operation"
75 help='Unfolding distance in meters.',
79 help='Unfolding velocity in meters/second.',
83 help='Sampling frequency in Hz.',
87 class SaveConfig (_config.Config):
88 "Configure `unfold_protein` unfold operation"
91 name='base directory',
92 help='Root directory for saving data.',
93 default=_os_path.expanduser('~/rsrch/data/unfold/')),
96 class UnfoldCycleConfig (_config.Config):
97 "Configure a full `unfold_protein` approach-bind-unfold cycle"
99 _config.ConfigSetting(
101 help='Configure the temperature measurements',
102 config_class=TemperatureConfig),
103 _config.ConfigSetting(
105 help=('Configure the approach for an approach-bind-unfold '
107 config_class=ApproachConfig),
108 _config.FloatSetting(
110 help=('Binding time in seconds for an approach-bind-unfold '
113 _config.ConfigSetting(
115 help=('Configure the unfolding for an approach-bind-unfold '
117 config_class=UnfoldConfig),
118 _config.ConfigSetting(
120 help='Configure saving.',
121 config_class=SaveConfig),
124 class VelocityScanConfig (_config.Config):
125 "Configure `unfold_config` unfolding velocity scan"
127 _config.FloatListSetting(
128 name='unfolding velocities',
129 help='Unfolding velocities in meters per second.',
130 default=_numpy.exp(_numpy.linspace(
131 _numpy.log(20e-9), _numpy.log(2e-6), 10))),
132 _config.IntegerSetting(
134 help='Number of loops through the scanned velocities.',
138 class PositionScanConfig (_config.Config):
139 "Configure `unfold_config` contact position scan"
141 _config.FloatSetting(
143 help=('Distance in meters along the x axis between successive '
146 _config.FloatSetting(
148 help='Maximum sampled x position in meters.',
150 _config.FloatSetting(
152 help='Minimum sampled x position in meters.',
156 class ScanConfig (_config.Config):
157 "Configure a full `unfold_protein` approach-bind-unfold cycle"
159 _config.ConfigSetting(
161 help='Configure unfolding velocity scan pattern.',
162 config_class=VelocityScanConfig),
163 _config.ConfigSetting(
165 help='Configure unfolding position scan pattern.',
166 config_class=PositionScanConfig),