Synthetics Cross-Correlation Functions
Functions to generate synthetic cross-correlations from secondary microseisms sources.
It contains fourteen functions:
-
apply_delay_f_domain(s,d): Apply a delay d to the input signal s using Fourier domain. -
get_synthetic_info(path_file_axisem, comp): Get synthetic info from a specified h5 file and return fe, time, and N. -
open_axisem(dist, path_file_axisem, comp): Reads an AxiSEM .h5 archive in a 1D model given its path and a distance. -
taper_axisem_archive(time, distance, archive_name, umin, umax): Taper an AxiSEM .h5 archive in a 1D model given its path and a distance and minimum and maximum Rayleigh wave velocity. -
taper_axisem_archive_body_waves(time, distance, archive_name, phase1, phase2, model, **kwargs): Taper an AxiSEM .h5 archive around two body wave phases in a 1D model given its path and a distance. -
create_spectrum_archive(time, distance, tapered_archive, h5_name_spectrum): Create a Green's function archive in frequency domain from an AxiSEM archive. -
open_archive(h5_name): Open a Green's function archive in frequency domain. -
open_spectrum_axisem(path_file_axisem, comp): Reads an AxiSEM .h5 archive in a 1D model given its path and a distance, and returns sampling frequency, time vector and trace. -
create_date_vect(dates): Create a date vector from a list of dates. -
open_model(path_file_WW3, date_vect, N, fe, lon_slice, lat_slice): Open WW3 model for ambient noise sources at a specific time and date. -
distance_to_station(lon, lat, lon_s, lat_s, radius_earth): Computes the distance of every point of the model to station of coordinates (lonS, latS). -
matrix_GF(spectrum_axi, lon, lat, N, distance_s, comp, conjugate): Generates a synthetic seismogram (Green's Functions) matrix to a specific station in frequency domain using the given lon, lat, N, path_file_axisem, distance_s, and optional conjugate flag. -
compute_model_chunk(lon_inf, lon_sup, lat_inf, lat_sup, N, fe, date_vect, spectrum_axi, file_model, lon_staA, lat_staA, lon_staB, lat_staB, comp): Compute correlation function in frequency domain between stations A and B for a chunk of the www3 model source. -
ccf_computation(coords_staA, coords_staB, path_model, date_vect, spectrum_axi, fe, N, extent, comp): Compute the cross-correlation function between two seismic stations.
apply_delay_f_domain(s, d=0.0)
Apply a delay d to the input signal s using Fourier domain.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
ccf_computation(coords_staA, coords_staB, path_model, date_vect, spectrum_axi, fe=4.0, N=14400, extent=[-180, 181, -80, 81], comp='Z')
Computes the cross-correlation function between two seismic stations. It takes the coordinates of the stations, the path to the AxiSEM archive, the path to the model, a vector of dates, a normalization factor, and a component parameter. It returns the computed cross-correlation function and the corresponding time array.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | |
compute_model_chunk(lon_inf, lon_sup, lat_inf, lat_sup, N, fe, date_vect, spectrum_axi, file_model, lon_staA, lat_staA, lon_staB, lat_staB, comp)
Computes correlation function between stations A and B for a chunk of the www3 model source.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
create_date_vect(dates)
Creates a date vector from a list of dates.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
create_spectrum_archive(time, distance, tapered_archive, h5_name_spectrum='spectrum_archive_tapered.h5')
Create a Green's function archive in frequency domain from an AxiSEM archive. This function creates a spectrum archive by computing the Fourier transform of the input archive for each distance value. The resulting spectrum is saved as an HDF5 file with the specified name. The HDF5 file contains three datasets:
'SPECTRUM': The spectrum data.
'frequency': The frequency values.
'distance': The distance values.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
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 | |
distance_to_station(lon, lat, lon_s=0, lat_s=90, radius_earth=6371000.0)
Computes the distance of every point of the model to station of coordinates (lonS, latS)
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
get_synthetic_info(path_file_axisem='../../data/NOISE_vertforce_dirac_0-ak135f_1.s_3600s.h5', comp='Z')
Function to get synthetic info from a specified h5 file and return fe, time, and N.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
matrix_GF(spectrum_axi, lon, lat, N, distance_s, comp='Z', conjugate=False)
Generates a synthetic seismogram (Green's Functions) matrix in frequency domain using the given lon, lat, N, path_file_axisem, distance_s, and optional conjugate flag. Returns the synthetic seismogram matrix.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | |
open_archive(h5_name='spectrum_archive_tapered.h5')
Open an AxiSEM .h5 archive in a 1D model given its path, and returns sampling frequency, time vector and trace.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
open_axisem(dist, path_file_axisem='../../data/NOISE_vertforce_dirac_0-ak135f_1.s_3600s.h5', comp='Z')
Reads an AxiSEM .h5 archive in a 1D model given its path and a distance, and returns sampling frequency, time vector and trace at the given distance.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
open_model(path_file_WW3, date_vect, N, fe, lon_slice=slice(-180, 180), lat_slice=slice(-78, 80))
Open WW3 model for ambient noise sources at a specific time and date. Returns the PSD of the given model in N^2.s with dimensions (dim_lon, dim_lat, 2*dim_freq+1).
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
open_spectrum_axisem(path_file_axisem='./spectrum_vertforce_iasp91_1.s_256c_3600.s.h5', comp='Z')
Reads an AxiSEM .h5 archive in a 1D model given its path and component, and returns sampling frequency, time vector and trace.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
taper_axisem_archive(time, distance, archive_name='../../data/NOISE_vertforce_dirac_0-ak135f_1.s_3600s.h5', umin=2.5, umax=3.5)
Taper an AxiSEM .h5 archive in a 1D model given its path and distances as well as minimum and maximum Rayleigh wave velocity,and saves and returns the tapered archive.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
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 | |
taper_axisem_archive_body_waves(time, distance, archive_name='../../data/NOISE_vertforce_dirac_0-ak135f_1.s_3600s.h5', phase1='P', phase2='PP', model='ak135', **kwargs)
Taper an AxiSEM .h5 archive around two body wave phases in a 1D model given its path and a distance, and returns the tapered archive.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in wmsan/synthetics.py
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 | |