Skip to content

Commit

Permalink
Update Spatial_Temporal evolution of the Paleo Crustal Thickness.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
jianping-geoman authored Sep 28, 2024
1 parent 99895b4 commit 0ac647e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Spatial_Temporal evolution of the Paleo Crustal Thickness.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"import matplotlib.pyplot as plt\n",
"\n",
"# Read the CSV dataset\n",
"df = pd.read_csv(\"/Users/jianpingzhou/work/Papers/Ongoing/Appendix/workflow/JP_crustal_thickness_prediction/dataset/output/Appendix Table 2-test2_export_Lhasa_With Georoc.csv\")\n",
"df = pd.read_csv(\"data/Training data with locations and citations/Table S1 (please modify the file, see readme.md).csv\")\n",
"\n",
"# Separate the columns\n",
"age = df['Age']\n",
Expand Down Expand Up @@ -85,7 +85,7 @@
"import matplotlib.pyplot as plt\n",
"\n",
"# Read the CSV dataset\n",
"df = pd.read_csv(\"/Users/jianpingzhou/work/Papers/Ongoing/Appendix/workflow/JP_crustal_thickness_prediction/dataset/output/Appendix Table 2-test2_export_Lhasa_With Georoc.csv\")\n",
"df = pd.read_csv(\"data/Training data with locations and citations/Table S3.csv\")\n",
"\n",
"# Group by Age, Latitude, and Longitude and calculate median and standard deviation of crustal thickness\n",
"grouped = df.groupby(['Age', 'Lat', 'Lon'])['Predicted_Crustal_Thickness'].agg(['median', 'std']).reset_index()\n",
Expand Down Expand Up @@ -230,7 +230,7 @@
"plt.legend()\n",
"\n",
"# Save the plot to a PDF file\n",
"plt.savefig(\"/Users/jianpingzhou/work/Papers/Ongoing/figures/20_Aug_0-250_nnnLhasa_crustal_thickness_vs_age.pdf\", format='pdf', dpi=300, bbox_inches='tight')\n",
"plt.savefig(\"path to your file/Crustal_thickness_vs_age.pdf\", format='pdf', dpi=300, bbox_inches='tight')\n",
"\n",
"plt.show()\n"
]
Expand Down Expand Up @@ -262,7 +262,7 @@
"plt.rcParams['font.family'] = 'Times New Roman'\n",
"\n",
"# Read the CSV dataset\n",
"df = pd.read_csv(\"/Users/jianpingzhou/work/Papers/Ongoing/Appendix/workflow/JP_crustal_thickness_prediction/dataset/output/Model1_imputed_South China.csv\")\n",
"df = pd.read_csv(\"data/Training data with locations and citations/Table S3.csv\")\n",
"\n",
"# Compute the median and standard deviation of crustal thickness for each combination of Age, Latitude, and Longitude\n",
"grouped = df.groupby(['Age', 'Lat', 'Lon'])['Predicted_Crustal_Thickness'].agg(['median', 'std']).reset_index()\n",
Expand Down Expand Up @@ -324,7 +324,7 @@
"axs[1].text(0.95, 0.95, f'Number of Samples: {num_samples}', transform=axs[1].transAxes, verticalalignment='top', horizontalalignment='right', bbox=dict(facecolor='white', alpha=0.5))\n",
"\n",
"# Save the figure as a PDF\n",
"plt.savefig('/Users/jianpingzhou/work/Papers/Ongoing/figures/12_Aug_Model1_0-250_South China.pdf', format='pdf', dpi=300, bbox_inches='tight')\n",
"plt.savefig('path to your file/output.pdf', format='pdf', dpi=300, bbox_inches='tight')\n",
"plt.show()\n"
]
},
Expand Down Expand Up @@ -363,7 +363,7 @@
"from sklearn.kernel_ridge import KernelRidge\n",
"\n",
"# Read the CSV dataset\n",
"df = pd.read_csv(\"/Users/jianpingzhou/work/Papers/Ongoing/Appendix/workflow/JP_crustal_thickness_prediction/dataset/output/Model1_imputed_South China.csv\")\n",
"df = pd.read_csv(\"path to your file/Model1_certain area.csv\")\n",
"\n",
"# Group by Age, Latitude, and Longitude and calculate median and standard deviation of crustal thickness\n",
"grouped = df.groupby(['Age', 'Lat', 'Lon'])['Predicted_Crustal_Thickness'].agg(['median', 'std']).reset_index()\n",
Expand Down Expand Up @@ -450,7 +450,7 @@
"plt.grid(True)\n",
"\n",
"# Save the plot to a PDF file\n",
"plt.savefig(\"/Users/jianpingzhou/work/Papers/Ongoing/figures/21Aug_0-200_south china_crustal_thickness_vs_age.pdf\", format='pdf', dpi=300, bbox_inches='tight')\n",
"plt.savefig(\"path to your file/figures/Crustal_thickness_vs_age.pdf\", format='pdf', dpi=300, bbox_inches='tight')\n",
"\n",
"plt.show()"
]
Expand Down

0 comments on commit 0ac647e

Please sign in to comment.