Skip to content

Commit

Permalink
merging saved work branch
Browse files Browse the repository at this point in the history
  • Loading branch information
wino6687 committed Mar 29, 2019
2 parents 9db4bc4 + b1aff44 commit 1b2f83d
Show file tree
Hide file tree
Showing 11 changed files with 405 additions and 158 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ swe_1day.geojson
.DS_Store
swepy/.DS_Store
.pypirc
dist/
swepy.egg-info/
__pycache__/
swepy/__pycache__/
Expand Down
252 changes: 242 additions & 10 deletions full_workflow_jup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
"cells": [
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 11,
=======
"execution_count": 1,
>>>>>>> my-saved-work
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import datetime\n",
<<<<<<< HEAD
"from swepy.swepy import swepy\n",
"from swepy import process"
=======
"from swepy.swepy import swepy"
>>>>>>> my-saved-work
]
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 10,
"metadata": {},
"outputs": [
Expand All @@ -28,6 +37,20 @@
"output_type": "execute_result"
}
],
=======
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from swepy.process import process"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
>>>>>>> my-saved-work
"source": []
},
{
Expand All @@ -39,22 +62,19 @@
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 2,
=======
"execution_count": 3,
>>>>>>> my-saved-work
"metadata": {},
"outputs": [],
"source": [
"# greenland\n",
"#lat_lon_ul = [82, -54] \n",
"#lat_lon_lr = [80, -30]\n",
"\n",
"# alaska\n",
"lat_lon_ul = [66,-145]\n",
"lat_lon_lr = [73, -166]\n",
"\n",
"#antarctica\n",
"#lat_lon_lr = [-80, 9]\n",
"#lat_lon_ul = [-69, -16]\n",
"lat_lon_lr = [73,-166]\n",
"\n",
<<<<<<< HEAD
"# colorado \n",
"#lat_lon_lr = [37, -102]\n",
"#lat_lon_ul = [40, -109]\n",
Expand All @@ -69,11 +89,16 @@
"\n",
"username= ''\n",
"password = ''"
=======
"# start and end dates \n",
"start = datetime.date(2005, 1, 1)\n",
"end = datetime.date(2005, 1, 1)"
>>>>>>> my-saved-work
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -86,32 +111,207 @@
}
],
"source": [
<<<<<<< HEAD
"swep = swepy(os.getcwd(), start, end, lat_lon_ul, lat_lon_lr, username, password, high_res = True)"
=======
"swep = swepy(os.getcwd(), start=start, end=end,ul = lat_lon_ul, lr = lat_lon_lr, username = '', password = '', high_res=False)"
>>>>>>> my-saved-work
]
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 7,
=======
"execution_count": 5,
>>>>>>> my-saved-work
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
<<<<<<< HEAD
"100%|██████████| 1/1 [00:16<00:00, 16.16s/it]\n",
"100%|██████████| 1/1 [00:00<00:00, 12.21it/s]\n",
"100%|██████████| 1/1 [00:00<00:00, 11.47it/s]\n"
=======
"100%|██████████| 1/1 [00:00<00:00, 2.01it/s]\n",
"100%|██████████| 1/1 [00:00<00:00, 8.82it/s]\n",
"100%|██████████| 1/1 [00:00<00:00, 15.47it/s]\n"
>>>>>>> my-saved-work
]
}
],
"source": [
<<<<<<< HEAD
"tup = swep.scrape_all()\n",
"#swep.concatenate(swep.scrape())"
=======
"tup = swep.scrape_all()"
>>>>>>> my-saved-work
]
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 8,
=======
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"tb19, tb37 = process.get_array(tup[0], tup[1])"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"numpy.ma.core.MaskedArray"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(tb19)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import cartopy.crs as ccrs\n",
"geod = ccrs.Geodetic()\n",
"e2n = ccrs.LambertAzimuthalEqualArea(central_latitude=90.0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UR_corner = [9, -80]\n",
"UL_corner = [-16, -69] \n",
"x, y = e2n.transform_point(\n",
" x = UR_corner[0],\n",
" y = UR_corner[1],\n",
" src_crs = geod)\n",
"print(x, y)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"x,y = e2n.transform_point(x = UL_corner[0],\n",
" y = UL_corner[1],\n",
" src_crs = geod)\n",
"print(x,y)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"%matplotlib notebook\n",
"import cartopy.crs as ccrs\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.figure()\n",
"\n",
"e2n_full_extent = [-9000000., 9000000., -9000000., 9000000.] # Full extent, in projected coords: [ULx, LRx, ULy, LRy]\n",
"ax = plt.axes(projection=e2n)\n",
"ax.set_extent(e2n_full_extent, crs=e2n) # you have to tell it what projection to use to interpret the extent\n",
"ax.gridlines(color='gray', linestyle='--')\n",
"ax.coastlines()\n",
"\n",
"plt.tight_layout()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"form netCDF4 import Dataset"
]
},
{
"cell_type": "code",
"execution_count": null,
>>>>>>> my-saved-work
"metadata": {},
"outputs": [
{
Expand All @@ -127,7 +327,11 @@
}
],
"source": [
<<<<<<< HEAD
"tb19, tb37 = process.get_array(tup[0], tup[1])"
=======
"file = '/Users/williamnorris/SWEpy/tests/data/MEASURES/NSIDC-0630.001/2010.01.01/NSIDC-0630-EASE2_N3.125km-F17_SSMIS-2010001-37H-M-SIR-CSU-v1.3.nc'\n"
>>>>>>> my-saved-work
]
},
{
Expand All @@ -137,6 +341,34 @@
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# alaska\n",
"#lat_lon_ul = [-145,66]\n",
"#lat_lon_lr = [-166,73]\n",
"\n",
"#antarctica\n",
"#lat_lon_lr = [-80, 9]\n",
"#lat_lon_ul = [-69, -16]\n",
"\n",
"# colorado \n",
"#lat_lon_lr = [37, -102]\n",
"#lat_lon_ul = [40, -109]\n",
"\n",
"# no subset\n",
"#lat_lon_lr = \"N\"\n",
"#lat_lon_ul = \"N\"\n",
"\n",
"# overlapping grid (should break)\n",
"#lat_lon_lr = [-145,60]\n",
"#lat_lon_ul = [-166, 72]\n",
"# Generate list of dates"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
Binary file modified swepy/nsidcDownloader/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Loading

0 comments on commit 1b2f83d

Please sign in to comment.