Condensate Movement
Condensate Movement Reference#
Contains class for storing condensate data. Condensates are defined as spherical always; defined by a center (x,y,z), radius (r), and time (t). The complete description of the condensate at any time (t) is: (x,y,z,r,t).
Usage:#
Initialize the class as follows:
condensate = Condensate(**{
"initial_position":np.array([0, 0, 0]),
"initial_time":0,
"diffusion_coefficient":0,
"hurst_exponent":0,
"units_time":'ms',
"units_position":'um',
"condensate_id":0,
"initial_scale":0,
"oversample_motion_time":20,
})
Call the class object as follows to get the position and scale of the condensate at a given time:
condensate(times, time_unit) -> dict{"Position":np.ndarray, "Scale":float}
Condensate
#
Condensate class for storing condensate data.
Parameters:#
initial_position: np.ndarray = np.array([0, 0, 0]) Initial position of the condensate. initial_time: float = 0 Initial time of the condensates. diffusion_coefficient: float = 0 Diffusion coefficient of the condensate. hurst_exponent: float = 0 Hurst exponent of the condensate. units_time: str = 's' Units of time. Units work as follows: in the class reference frame, start from 0 and iterate by 1 each time. For a units_time of "ms", 1 represents 1ms. For a units_time of "s", 1 represents 1s. For a units_time of "20ms", 1 represents 20ms. units_position: str = 'um' Units of position. condensate_id: int = 0 ID of the condensate. initial_scale: float = 0 Initial scale of the condensate. cell: BaseCell = None The cell that contains the condensates. oversample_motion_time: int = None motion resolution
Source code in SMS_BP/condensate_movement.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
condensate_positions
property
writable
#
Returns the positions of the condensate.
scale
property
writable
#
Returns the scale of the condensate.
times
property
writable
#
Returns the times of the condensate.
__call__(time, time_unit)
#
Returns the position and scale of the condensate at a given time.
Parameters:#
time: float Time at which to return the position of the condensate. User needs to convert to the reference frame of the condensate class. time_unit: str Units of time. Just to make sure the user is aware of the conversion they need to do to get into the reference frame of the condensate class.
Returns:#
Dict of the position and scale of the condensate at the given time. Keys: Position: np.ndarray Position of the condensate at the given time. Scale: float Scale of the condensate at the given time.
Source code in SMS_BP/condensate_movement.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
add_positions(time, position, scale)
#
Adds positions to the condensate.
Parameters:#
time: np.ndarray Times at which to add positions. position: np.ndarray Positions to add to the condensate. scale: np.ndarray Scale to add to the condensate.
Source code in SMS_BP/condensate_movement.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
calculate_scale(time, position)
#
Calculates the scale of the condensate at a given time.
Parameters:#
time: np.ndarray Times at which to calculate the scale. position: np.ndarray Positions at which to calculate the scale.
Source code in SMS_BP/condensate_movement.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
generate_condensate_positions(time)
#
Generates the condensate positions up to a given time.
Parameters:#
time: int Time up to which to generate the condensate positions.
Source code in SMS_BP/condensate_movement.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | |
create_condensate_dict(initial_centers, initial_scale, diffusion_coefficient, hurst_exponent, cell, **kwargs)
#
Creates a dictionary of condensates for simulation.
Parameters:#
initial_centers : np.ndarray
Array of shape (num_condensates, 2) representing the initial centers of the condensates.
initial_scale : np.ndarray
Array of shape (num_condensates, 2) representing the initial scales of the condensates.
diffusion_coefficient : np.ndarray
Array of shape (num_condensates, 2) representing the diffusion coefficients of the condensates.
hurst_exponent : np.ndarray
Array of shape (num_condensates, 2) representing the Hurst exponents of the condensates.
cell : BaseCell
The cell that contains the condensates.
**kwargs : dict
Additional arguments passed to Condensate class.
oversample_motion_time : int
smallest time unit for motion (time resolution for motion) (ms)
Returns:#
dict
A dictionary of Condensate objects with keys as condensate IDs.
Source code in SMS_BP/condensate_movement.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |