|
58 | 58 |
|
59 | 59 |
|
60 | 60 | # %% |
61 | | -adloc_file = f"{root_path}/{region}/adloc/ransac_events.csv" |
| 61 | +adloc_file = f"{root_path}/{region}/adloc/adloc_events.csv" |
62 | 62 | adloc_exist = False |
63 | 63 | if os.path.exists(adloc_file): |
64 | 64 | print(f"Reading {adloc_file}") |
|
67 | 67 | # adloc_catalog["magnitude"] = 0.0 |
68 | 68 | # gamma_catalog["depth_km"] = gamma_catalog["depth(m)"] / 1e3 |
69 | 69 |
|
| 70 | +# %% |
| 71 | +qtm_file = f"{root_path}/{region}/qtm/qtm_events.csv" |
| 72 | +qtm_exist = False |
| 73 | +if os.path.exists(qtm_file): |
| 74 | + print(f"Reading {qtm_file}") |
| 75 | + qtm_exist = True |
| 76 | + qtm_catalog = pd.read_csv(qtm_file, parse_dates=["time"]) |
| 77 | + |
70 | 78 | # %% |
71 | 79 | adloc_dt_file = f"{root_path}/{region}/adloc_dd/adloc_dt_events.csv" |
72 | 80 | adloc_dt_exist = False |
|
335 | 343 |
|
336 | 344 | # %% |
337 | 345 | size_factor = 2600 |
338 | | -fig, ax = plt.subplots(4, 2, squeeze=False, figsize=(10, 15), sharex=True, sharey=True) |
| 346 | +fig, ax = plt.subplots(4, 3, squeeze=False, figsize=(15, 15), sharex=True, sharey=True) |
339 | 347 | for i in range(4): |
340 | | - for j in range(2): |
| 348 | + for j in range(3): |
341 | 349 | ax[i, j].set_xlim(xlim) |
342 | 350 | ax[i, j].set_ylim(ylim) |
343 | 351 | ax[i, j].set_aspect((ylim[1] - ylim[0]) / ((xlim[1] - xlim[0]) * np.cos(np.mean(ylim) * np.pi / 180))) |
|
375 | 383 | # ylim = ax[0, 1].get_ylim() |
376 | 384 |
|
377 | 385 | if adloc_exist and (len(adloc_catalog) > 0): |
378 | | - ax[0, 1].scatter( |
| 386 | + ax[0, 2].scatter( |
379 | 387 | adloc_catalog["longitude"], |
380 | 388 | adloc_catalog["latitude"], |
381 | 389 | s=min(2, size_factor / len(adloc_catalog)), |
382 | 390 | alpha=1.0, |
383 | 391 | linewidth=0, |
384 | 392 | label=f"AdLoc: {len(adloc_catalog)}", |
385 | 393 | ) |
386 | | - # ax[0, 1].legend() |
387 | | - ax[0, 1].set_title(f"AdLoc: {len(adloc_catalog)}") |
| 394 | + # ax[0, 2].legend() |
| 395 | + ax[0, 2].set_title(f"AdLoc: {len(adloc_catalog)}") |
| 396 | + |
| 397 | +if qtm_exist and (len(qtm_catalog) > 0): |
| 398 | + ax[1, 2].scatter( |
| 399 | + qtm_catalog["longitude"], |
| 400 | + qtm_catalog["latitude"], |
| 401 | + s=min(2, size_factor / len(qtm_catalog)), |
| 402 | + alpha=1.0, |
| 403 | + linewidth=0, |
| 404 | + label=f"QTM: {len(qtm_catalog)}", |
| 405 | + ) |
| 406 | + ax[1, 2].set_title(f"QTM: {len(qtm_catalog)}") |
388 | 407 |
|
389 | 408 | if adloc_dt_exist and (len(adloc_dt_catalog) > 0): |
390 | 409 | ax[1, 0].scatter( |
|
459 | 478 | plt.show() |
460 | 479 |
|
461 | 480 | # %% |
462 | | -fig, ax = plt.subplots(4, 2, squeeze=False, figsize=(15, 30), sharex=True, sharey=True) |
| 481 | +fig, ax = plt.subplots(4, 3, squeeze=False, figsize=(20, 30), sharex=True, sharey=True) |
463 | 482 | cmin = 0 |
464 | 483 | cmax = 10 |
465 | 484 | for i in range(4): |
466 | | - for j in range(2): |
| 485 | + for j in range(3): |
467 | 486 | ax[i, j].grid() |
468 | 487 |
|
469 | 488 | if routine_exist and (len(routine_catalog) > 0): |
|
509 | 528 | ylim = None |
510 | 529 |
|
511 | 530 | if adloc_exist and (len(adloc_catalog) > 0): |
512 | | - ax[0, 1].scatter( |
| 531 | + ax[0, 2].scatter( |
513 | 532 | adloc_catalog["longitude"], |
514 | 533 | adloc_catalog["depth_km"], |
515 | 534 | c=adloc_catalog["depth_km"], |
|
521 | 540 | cmap="viridis_r", |
522 | 541 | label=f"AdLoc: {len(adloc_catalog)}", |
523 | 542 | ) |
524 | | - # ax[0, 1].legend() |
525 | | - ax[0, 1].set_title(f"AdLoc: {len(adloc_catalog)}") |
526 | | - ax[0, 1].set_xlim(xlim) |
527 | | - ax[0, 1].set_ylim(ylim) |
| 543 | + # ax[0, 2].legend() |
| 544 | + ax[0, 2].set_title(f"AdLoc: {len(adloc_catalog)}") |
| 545 | + ax[0, 2].set_xlim(xlim) |
| 546 | + ax[0, 2].set_ylim(ylim) |
| 547 | + |
| 548 | +if qtm_exist and (len(qtm_catalog) > 0): |
| 549 | + ax[1, 2].scatter( |
| 550 | + qtm_catalog["longitude"], |
| 551 | + qtm_catalog["depth_km"], |
| 552 | + c=qtm_catalog["depth_km"], |
| 553 | + s=8000 / len(qtm_catalog), |
| 554 | + alpha=1.0, |
| 555 | + linewidth=0, |
| 556 | + vmin=cmin, |
| 557 | + vmax=cmax, |
| 558 | + cmap="viridis_r", |
| 559 | + ) |
| 560 | + # ax[1, 2].legend() |
| 561 | + ax[1, 2].set_title(f"QTM: {len(qtm_catalog)}") |
| 562 | + ax[1, 2].set_xlim(xlim) |
| 563 | + ax[1, 2].set_ylim(ylim) |
528 | 564 |
|
529 | 565 | if adloc_dt_exist and (len(adloc_dt_catalog) > 0): |
530 | 566 | ax[1, 0].scatter( |
|
630 | 666 |
|
631 | 667 |
|
632 | 668 | # %% |
633 | | -fig, ax = plt.subplots(4, 2, squeeze=False, figsize=(15, 30), sharex=True, sharey=True) |
| 669 | +fig, ax = plt.subplots(4, 3, squeeze=False, figsize=(20, 30), sharex=True, sharey=True) |
634 | 670 | cmin = 0 |
635 | 671 | cmax = 10 |
636 | 672 | for i in range(4): |
637 | | - for j in range(2): |
| 673 | + for j in range(3): |
638 | 674 | ax[i, j].grid() |
639 | 675 |
|
640 | 676 | if routine_exist and (len(routine_catalog) > 0): |
|
680 | 716 | ylim = None |
681 | 717 |
|
682 | 718 | if adloc_exist and (len(adloc_catalog) > 0): |
683 | | - ax[0, 1].scatter( |
| 719 | + ax[0, 2].scatter( |
684 | 720 | adloc_catalog["latitude"], |
685 | 721 | adloc_catalog["depth_km"], |
686 | 722 | c=adloc_catalog["depth_km"], |
|
692 | 728 | cmap="viridis_r", |
693 | 729 | label=f"AdLoc: {len(adloc_catalog)}", |
694 | 730 | ) |
695 | | - # ax[0, 1].legend() |
696 | | - ax[0, 1].set_title(f"AdLoc: {len(adloc_catalog)}") |
697 | | - ax[0, 1].set_xlim(xlim) |
698 | | - ax[0, 1].set_ylim(ylim) |
| 731 | + # ax[0, 2].legend() |
| 732 | + ax[0, 2].set_title(f"AdLoc: {len(adloc_catalog)}") |
| 733 | + ax[0, 2].set_xlim(xlim) |
| 734 | + ax[0, 2].set_ylim(ylim) |
| 735 | + |
| 736 | +if qtm_exist and (len(qtm_catalog) > 0): |
| 737 | + ax[1, 2].scatter( |
| 738 | + qtm_catalog["latitude"], |
| 739 | + qtm_catalog["depth_km"], |
| 740 | + c=qtm_catalog["depth_km"], |
| 741 | + s=8000 / len(qtm_catalog), |
| 742 | + alpha=1.0, |
| 743 | + linewidth=0, |
| 744 | + vmin=cmin, |
| 745 | + vmax=cmax, |
| 746 | + cmap="viridis_r", |
| 747 | + ) |
| 748 | + ax[1, 2].set_title(f"QTM: {len(qtm_catalog)}") |
| 749 | + ax[1, 2].set_xlim(xlim) |
| 750 | + ax[1, 2].set_ylim(ylim) |
699 | 751 |
|
700 | 752 | if adloc_dt_exist and (len(adloc_dt_catalog) > 0): |
701 | 753 | ax[1, 0].scatter( |
|
815 | 867 | if adloc_exist: |
816 | 868 | ax[0, 0].plot(adloc_catalog["time"], adloc_catalog["magnitude"], "o", markersize=2, alpha=0.5, label="AdLoc") |
817 | 869 | ax[1, 0].plot(adloc_catalog["time"], adloc_catalog["magnitude"], "o", markersize=2, alpha=0.5, label="AdLoc") |
| 870 | +# if qtm_exist: |
| 871 | +# ax[0, 0].plot(qtm_catalog["time"], qtm_catalog["magnitude"], "o", markersize=2, alpha=0.5, label="QTM") |
| 872 | +# ax[1, 0].plot(qtm_catalog["time"], qtm_catalog["magnitude"], "o", markersize=2, alpha=0.5, label="QTM") |
818 | 873 | if adloc_dt_exist: |
819 | 874 | ax[0, 0].plot( |
820 | 875 | adloc_dt_catalog["time"], adloc_dt_catalog["magnitude"], "o", markersize=2, alpha=0.5, label="AdLoc (CT)" |
|
862 | 917 | if adloc_exist: |
863 | 918 | ax[0, 0].hist(adloc_catalog["magnitude"], bins=bins, alpha=0.5, label="AdLoc") |
864 | 919 | ax[1, 0].hist(adloc_catalog["magnitude"], bins=bins, alpha=0.5, label="AdLoc") |
| 920 | +# if qtm_exist: |
| 921 | +# ax[0, 0].hist(qtm_catalog["magnitude"], bins=bins, alpha=0.5, label="QTM") |
| 922 | +# ax[1, 0].hist(qtm_catalog["magnitude"], bins=bins, alpha=0.5, label="QTM") |
865 | 923 | if adloc_dt_exist: |
866 | 924 | ax[0, 0].hist(adloc_dt_catalog["magnitude"], bins=bins, alpha=0.5, label="AdLoc (CT)") |
867 | 925 | if adloc_dtcc_exist: |
@@ -954,6 +1012,15 @@ def plot3d(x, y, z, config, fig_name): |
954 | 1012 | f"{root_path}/{figure_path}/earthquake_location_adloc.html", |
955 | 1013 | ) |
956 | 1014 |
|
| 1015 | + if qtm_exist and len(qtm_catalog) > 0: |
| 1016 | + plot3d( |
| 1017 | + qtm_catalog["longitude"], |
| 1018 | + qtm_catalog["latitude"], |
| 1019 | + qtm_catalog["depth_km"], |
| 1020 | + config_plot3d, |
| 1021 | + f"{root_path}/{figure_path}/earthquake_location_qtm.html", |
| 1022 | + ) |
| 1023 | + |
957 | 1024 | if adloc_dt_exist and len(adloc_dt_catalog) > 0: |
958 | 1025 | plot3d( |
959 | 1026 | adloc_dt_catalog["longitude"], |
|
0 commit comments