Skip to content

Commit

Permalink
More explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
khider committed Jun 13, 2024
1 parent 256856b commit beb3b34
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 258 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<img src="thumbnail.png" alt="thumbnail" width="300"/>
<img src="https://github.com/LinkedEarth/Logos/blob/master/LinkedEarth_medium.png?raw=true" alt="LinkedEarth Logo" width="500">

# Investigating interhemispheric precipitation changes over the past millennium
# Investigating interhemispheric precipitation changes over the past millennium

[![nightly-build](https://github.com/ProjectPythia/paleoPCA-Cookbook/actions/workflows/nightly-build.yaml/badge.svg)](https://github.com/ProjectPythia/paleoPCA-Cookbook/actions/workflows/nightly-build.yaml)
[![Binder](https://binder.projectpythia.org/badge_logo.svg)](https://binder.projectpythia.org/v2/gh/ProjectPythia/paleoPCA-Cookbook/main?labpath=notebooks)
Expand Down
24 changes: 18 additions & 6 deletions notebooks/.virtual_documents/notebook-template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,26 @@ SELECT distinct?varID ?dataSetName ?lat ?lon ?varname ?interpLabel ?val ?varunit
response = requests.post(url, data = {'query': query})

data = io.StringIO(response.text)
df = pd.read_csv(data, sep=",")
df_res = pd.read_csv(data, sep=",")

df['val']=df['val'].apply(lambda row : json.loads(row) if isinstance(row, str) else row)
df['timeval']=df['timeval'].apply(lambda row : json.loads(row) if isinstance(row, str) else row)
df_res['val']=df_res['val'].apply(lambda row : json.loads(row) if isinstance(row, str) else row)
df_res['timeval']=df_res['timeval'].apply(lambda row : json.loads(row) if isinstance(row, str) else row)

df.head()
df_res.head()





len(df_res)





df = df_res[~df_res['varID'].duplicated()]


len(df)


Expand Down Expand Up @@ -298,7 +307,6 @@ def array_range_exceeds(array, threshold=1500):
return np.max(array) - np.min(array) > threshold

filt_df = filtered_df[filtered_df['timeval'].apply(array_range_exceeds)]
filt_df.head()



Expand Down Expand Up @@ -358,7 +366,8 @@ mgs.map()



mgs.sel(time=slice(0,2000)).stackplot(v_shift_factor=2.5)
fig, ax = mgs.sel(time=slice(0,2000)).stackplot(v_shift_factor=1.2)
plt.show(fig)



Expand Down Expand Up @@ -404,3 +413,6 @@ pca.modeplot(index=2)






Loading

0 comments on commit beb3b34

Please sign in to comment.