Skip to content

Commit

Permalink
pseudo_tde_state_vector moved to eigen post processing. Still need to…
Browse files Browse the repository at this point in the history
… update usage in notebook
  • Loading branch information
brendanjmeade committed Jun 25, 2024
1 parent c426a28 commit e06faea
Showing 1 changed file with 56 additions and 28 deletions.
84 changes: 56 additions & 28 deletions notebooks/celeri_western_north_america_qp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:21:30.431\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_logger\u001b[0m:\u001b[36m129\u001b[0m - \u001b[1mRead: ../data/command/western_north_america_command.json\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.432\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_logger\u001b[0m:\u001b[36m130\u001b[0m - \u001b[1mRUN_NAME: 2024-06-25-15-21-30\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.432\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_logger\u001b[0m:\u001b[36m131\u001b[0m - \u001b[1mWrite log file: ../runs/2024-06-25-15-21-30/2024-06-25-15-21-30.log\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.433\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m136\u001b[0m - \u001b[1mReading data files\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.437\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m140\u001b[0m - \u001b[32m\u001b[1mRead: ../data/segment/western_north_america_segment.csv\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.440\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m145\u001b[0m - \u001b[32m\u001b[1mRead: ../data/block/western_north_america_block.csv\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.440\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m152\u001b[0m - \u001b[32m\u001b[1mRead: ../data/mesh/western_north_america_mesh_parameters.json\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.452\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_logger\u001b[0m:\u001b[36m129\u001b[0m - \u001b[1mRead: ../data/command/western_north_america_command.json\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.453\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_logger\u001b[0m:\u001b[36m130\u001b[0m - \u001b[1mRUN_NAME: 2024-06-25-17-06-17\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.453\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_logger\u001b[0m:\u001b[36m131\u001b[0m - \u001b[1mWrite log file: ../runs/2024-06-25-17-06-17/2024-06-25-17-06-17.log\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.453\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m136\u001b[0m - \u001b[1mReading data files\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.459\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m140\u001b[0m - \u001b[32m\u001b[1mRead: ../data/segment/western_north_america_segment.csv\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.461\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m145\u001b[0m - \u001b[32m\u001b[1mRead: ../data/block/western_north_america_block.csv\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.462\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m152\u001b[0m - \u001b[32m\u001b[1mRead: ../data/mesh/western_north_america_mesh_parameters.json\u001b[0m\n",
"\n"
]
},
Expand All @@ -77,10 +77,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:21:30.466\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m273\u001b[0m - \u001b[32m\u001b[1mRead: ../data/mesh/cascadia.msh\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.469\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m309\u001b[0m - \u001b[32m\u001b[1mRead: ../data/station/western_north_america_station.csv\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.470\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m324\u001b[0m - \u001b[1mNo mogi_file_name\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:30.471\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m346\u001b[0m - \u001b[1mNo sar_file_name\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:17.488\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m273\u001b[0m - \u001b[32m\u001b[1mRead: ../data/mesh/cascadia.msh\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.491\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m309\u001b[0m - \u001b[32m\u001b[1mRead: ../data/station/western_north_america_station.csv\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.492\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m324\u001b[0m - \u001b[1mNo mogi_file_name\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:17.493\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mread_data\u001b[0m:\u001b[36m346\u001b[0m - \u001b[1mNo sar_file_name\u001b[0m\n"
]
}
],
Expand Down Expand Up @@ -120,7 +120,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:21:31.181\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_elastic_operators\u001b[0m:\u001b[36m1531\u001b[0m - \u001b[1mUsing precomputed elastic operators\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:18.217\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_elastic_operators\u001b[0m:\u001b[36m1531\u001b[0m - \u001b[1mUsing precomputed elastic operators\u001b[0m\n"
]
}
],
Expand Down Expand Up @@ -150,8 +150,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:21:31.768\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_slip_rate_constraints\u001b[0m:\u001b[36m1170\u001b[0m - \u001b[1mFound 1 slip rate constraints\u001b[0m\n",
"\u001b[32m2024-06-25 15:21:31.772\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_slip_rate_constraints\u001b[0m:\u001b[36m1173\u001b[0m - \u001b[1mStrike-slip rate constraint on cfm_san_andreas_mojave_extruded_trace_part1_sa: rate = -50.00 (mm/yr), 1-sigma uncertainty = +/-1.00 (mm/yr)\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:18.819\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_slip_rate_constraints\u001b[0m:\u001b[36m1170\u001b[0m - \u001b[1mFound 1 slip rate constraints\u001b[0m\n",
"\u001b[32m2024-06-25 17:06:18.823\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mget_slip_rate_constraints\u001b[0m:\u001b[36m1173\u001b[0m - \u001b[1mStrike-slip rate constraint on cfm_san_andreas_mojave_extruded_trace_part1_sa: rate = -50.00 (mm/yr), 1-sigma uncertainty = +/-1.00 (mm/yr)\u001b[0m\n"
]
}
],
Expand Down Expand Up @@ -214,7 +214,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:21:35.537\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_input_summary\u001b[0m:\u001b[36m4416\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-15-21-30/plot_input_summary.(pdf, png)\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:22.579\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_input_summary\u001b[0m:\u001b[36m4416\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-17-06-17/plot_input_summary.(pdf, png)\u001b[0m\n"
]
},
{
Expand Down Expand Up @@ -258,7 +258,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Elapsed time: 1.9880330562591553\n"
"Elapsed time: 1.9553110599517822\n"
]
}
],
Expand Down Expand Up @@ -314,7 +314,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:21:45.497\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-15-21-30/plot_estimation_summary.(pdf, png)\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:32.218\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-17-06-17/plot_estimation_summary.(pdf, png)\u001b[0m\n"
]
},
{
Expand Down Expand Up @@ -358,7 +358,7 @@
" 5: -3.4866e+14 -3.4866e+14 3e+02 5e-06 3e-24\n",
" 6: -3.4866e+14 -3.4866e+14 1e+02 1e-16 5e-24\n",
"Optimal solution found.\n",
"Elapsed time: 4.927337408065796\n"
"Elapsed time: 4.690531253814697\n"
]
}
],
Expand Down Expand Up @@ -453,7 +453,7 @@
"n_eigen=100.0\n",
"eigenvectors_two_component.shape=(3682, 200)\n",
"operator.shape=(3519, 293)\n",
"Elapsed time: 0.010069131851196289\n"
"Elapsed time: 0.00824594497680664\n"
]
},
{
Expand All @@ -476,7 +476,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:22:00.741\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-15-21-30/plot_estimation_summary.(pdf, png)\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:46.630\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-17-06-17/plot_estimation_summary.(pdf, png)\u001b[0m\n"
]
},
{
Expand Down Expand Up @@ -713,9 +713,6 @@
"operator_eigen = get_full_dense_operator_eigen(operators, meshes, index)\n",
"\n",
"\n",
"# def post_process_estimation_eigen(\n",
"# estimation_eigen: Dict, operators: Dict, station: pd.DataFrame, index: Dict\n",
"# ):\n",
"def post_process_estimation_eigen(estimation_eigen, operators, station, index):\n",
" \"\"\"Calculate derived values derived from the block model linear estimate (e.g., velocities, undertainties)\n",
"\n",
Expand Down Expand Up @@ -760,6 +757,17 @@
" estimation_eigen.tde_strike_slip_rates = estimation_eigen.tde_rates[0::2]\n",
" estimation_eigen.tde_dip_slip_rates = estimation_eigen.tde_rates[1::2]\n",
"\n",
" # TODO: Create a pseudo state vector that is the length of a TDE state vector\n",
" estimation_eigen.pseudo_tde_state_vector = np.zeros(\n",
" 3 * n_blocks + 2 * index.n_tde_total\n",
" )\n",
" estimation_eigen.pseudo_tde_state_vector[0 : 3 * index.n_blocks] = (\n",
" estimation_eigen.state_vector[0 : 3 * index.n_blocks]\n",
" )\n",
" estimation_eigen.pseudo_tde_state_vector[3 * index.n_blocks : :] = (\n",
" estimation_eigen.tde_rates\n",
" )\n",
"\n",
" # Extract segment slip rates from state vector\n",
" estimation_eigen.slip_rates = (\n",
" operators.rotation_to_slip_rate\n",
Expand Down Expand Up @@ -1115,7 +1123,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:22:09.171\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-15-21-30/plot_estimation_summary.(pdf, png)\u001b[0m\n"
"\u001b[32m2024-06-25 17:06:54.696\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-17-06-17/plot_estimation_summary.(pdf, png)\u001b[0m\n"
]
},
{
Expand Down Expand Up @@ -1347,7 +1355,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-06-25 15:22:17.263\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-15-21-30/plot_estimation_summary.(pdf, png)\u001b[0m\n"
"\u001b[32m2024-06-25 17:07:02.490\u001b[0m | \u001b[32m\u001b[1mSUCCESS \u001b[0m | \u001b[36mceleri.celeri\u001b[0m:\u001b[36mplot_estimation_summary\u001b[0m:\u001b[36m4916\u001b[0m - \u001b[32m\u001b[1mWrote figures../runs/2024-06-25-17-06-17/plot_estimation_summary.(pdf, png)\u001b[0m\n"
]
},
{
Expand Down Expand Up @@ -1421,7 +1429,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x11e1ac880>]"
"[<matplotlib.lines.Line2D at 0x1301e07c0>]"
]
},
"execution_count": 20,
Expand Down Expand Up @@ -1457,7 +1465,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x13f2a8220>]"
"[<matplotlib.lines.Line2D at 0x17e74c1c0>]"
]
},
"execution_count": 21,
Expand Down Expand Up @@ -1493,7 +1501,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x13f27dde0>]"
"[<matplotlib.lines.Line2D at 0x1304e5d20>]"
]
},
"execution_count": 22,
Expand All @@ -1520,6 +1528,26 @@
"source": [
"plt.plot(estimation_eigen.strike_slip_rates)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3775,)"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"estimation_eigen.pseudo_tde_state_vector.shape"
]
}
],
"metadata": {
Expand Down

0 comments on commit e06faea

Please sign in to comment.