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, 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)
: 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. -
amplitude_modulator(lon, lat, N, lon_s, lat_s, comp)
: amplitude modulation depending on the component. -
compute_model_chunk_autocorr(lon_inf, lon_sup, lat_inf, lat_sup, N, fe, spectrum_axi_R, spectrum_axi_Z, file_model, lon_sta, lat_sta, comp)
: Compute auto-correlation cross-component function in frequency domain for a chunk of the www3 model source. -
ccf_computation_autocorr(coords_sta,path_model, date_vect, spectrum_axi_R, spectrum_axi_Z, fe, N, extent, comp)
: Compute auto-correlation function between radial and vertical components for a single station.
amplitude_modulator(lon, lat, N, lon_s, lat_s, comp='E')
Modulates the source PSD amplitude depending on the source point backazimuth and horizontal component
Parameters: |
|
---|
Source code in wmsan/synthetics.py
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
|
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
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
ccf_computation(coords_staA, coords_staB, path_model, date_vect, spectrum_axi, fe=4.0, N=14400, extent=[-180, 181, -80, 81])
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
482 483 484 485 486 487 488 489 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 |
|
ccf_computation_autocorr(coords_sta, path_model, date_vect, spectrum_axi_R, spectrum_axi_Z, fe=4.0, N=14400, extent=[-180, 181, -80, 81], comp='ZE')
Computes the auto-correlation function for a single station. It takes the coordinates of the station, 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 auto-correlation function and the corresponding time array.
Parameters: |
|
---|
Returns: |
|
---|
Source code in wmsan/synthetics.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
|
compute_model_chunk(lon_inf, lon_sup, lat_inf, lat_sup, N, fe, spectrum_axi, file_model, lon_staA, lat_staA, lon_staB, lat_staB)
Computes correlation function between stations A and B for a chunk of the www3 model source.
Parameters: |
|
---|
Returns: |
|
---|
Source code in wmsan/synthetics.py
439 440 441 442 443 444 445 446 447 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 |
|
compute_model_chunk_autocorr(lon_inf, lon_sup, lat_inf, lat_sup, N, fe, spectrum_axi_R, spectrum_axi_Z, file_model, lon_sta, lat_sta, comp='ZE')
Computes auto-correlation function for a given station coordinates for a chunk of the www3 model source.
Parameters: |
|
---|
Returns: |
|
---|
Source code in wmsan/synthetics.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
|
create_date_vect(dates)
Creates a date vector from a list of dates.
Parameters: |
|
---|
Returns: |
|
---|
Source code in wmsan/synthetics.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
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
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 |
|
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
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
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
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
matrix_GF(spectrum_axi, lon, lat, N, distance_s, 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
404 405 406 407 408 409 410 411 412 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 |
|
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
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
|
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
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
open_model(path_file_WW3, 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
339 340 341 342 343 344 345 346 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 |
|
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
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
|
taper_axisem_archive(time, distance, archive_name='../../data/NOISE_vertforce_dirac_0-ak135f_1.s_3600s.h5', umin=2.5, umax=3.5, comp='Z')
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
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 |
|
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', comp='Z', **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
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 |
|