-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from gaelforget/argovisexample
Argovis example
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ | |
/dev/ | ||
/docs/build/ | ||
/docs/site/ | ||
MITprof | ||
examples/*.ipynb | ||
.ipynb_checkpoints/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "ArgoData" | ||
uuid = "9eb831cf-c491-48dc-bed4-6aca718df73c" | ||
authors = ["gaelforget <[email protected]>"] | ||
version = "0.1.1" | ||
version = "0.1.2" | ||
|
||
[deps] | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# --- | ||
# jupyter: | ||
# jupytext: | ||
# formats: ipynb,jl:light | ||
# text_representation: | ||
# extension: .jl | ||
# format_name: light | ||
# format_version: '1.4' | ||
# jupytext_version: 1.2.4 | ||
# kernelspec: | ||
# display_name: Julia 1.3.0-rc4 | ||
# language: julia | ||
# name: julia-1.3 | ||
# --- | ||
|
||
# # Access Argo data using [ArgoVis](https://argovis.colorado.edu/ng/home) in Julia | ||
# | ||
# Citation for the Argovis web application and the Argovis database: | ||
# Tucker, T., D. Giglio, M. Scanderbeg, and S.S.P. Shen, 0: Argovis: A Web Application for Fast Delivery, Visualization, and Analysis of Argo Data. J. Atmos. Oceanic Technol., 0, https://doi.org/10.1175/JTECH-D-19-0041.1 | ||
# | ||
# Argo data reference | ||
# " These data were collected and made freely available by the International Argo Program and the national programs that contribute to it. (http://www.argo.ucsd.edu, http://argo.jcommops.org). The Argo Program is part of the Global Ocean Observing System. " | ||
# Argo (2000). Argo float data and metadata from Global Data Assembly Centre (Argo GDAC). SEANOE. http://doi.org/10.17882/42182 | ||
|
||
# + | ||
#run(pipeline(`which python`,"whichpython.txt")) #external python path | ||
#ENV["PYTHON"]=readline("whichpython.txt") | ||
#import Pkg; Pkg.build("PyCall") | ||
|
||
using PyCall | ||
|
||
requests = pyimport("requests") | ||
pd = pyimport("pandas") | ||
np = pyimport("numpy") | ||
sp = pyimport("scipy.interpolate") | ||
griddata=sp.griddata | ||
datetime = pyimport("datetime") | ||
pdb = pyimport("pdb") | ||
os = pyimport("os") | ||
netCDF4 = pyimport("netCDF4") | ||
netcdf_dataset=netCDF4.Dataset | ||
|
||
# + | ||
function get_monthly_profile_pos(month, year) | ||
baseURL = "https://argovis.colorado.edu/selection/profiles" | ||
url = baseURL*"/"*string(month)*"/"*string(year) | ||
resp = requests.get(url) | ||
monthlyProfilePos = resp.json() | ||
return monthlyProfilePos | ||
end | ||
|
||
function parse_meta_into_df(profiles) | ||
#initialize dict | ||
df = pd.DataFrame(profiles) | ||
return df | ||
end | ||
|
||
# set month and year for metadata | ||
month = 1 | ||
year = 2004 | ||
metaProfiles = get_monthly_profile_pos(month, year) | ||
metaDf = parse_meta_into_df(metaProfiles) | ||
# - | ||
|
||
|