Differences between revisions 16 and 19 (spanning 3 versions)
Revision 16 as of 2020-06-01 17:35:10
Size: 10824
Editor: kcrisman
Comment:
Revision 19 as of 2020-06-01 18:37:46
Size: 11038
Editor: kcrisman
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
Warning: Web apps can break frequently due to websites or services changing locations or formats!
Line 69: Line 69:
import urllib2, csv import urllib.request, csv, io
Line 72: Line 72:
L = list(zip(range(1,13),longmonths))
Line 73: Line 74:
def iceplotter(month = selector(zip(range(1,13),longmonths),default = (4, 'April'),label="Month")):
    month_str = months[month-1] + '/N_%02d_area.txt'%(month)
def iceplotter(month = selector(L, default = 4, label="Month")):
    month_str = '/north/monthly/data/N_%02d_extent_v3.0.csv'%(month)
Line 77: Line 78:
    icedata_f = urllib2.urlopen('ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/%s'%month_str)
    cr = csv.reader(icedata_f,delimiter=' ', dialect=dialect)
    icedata = list(cr)
    icedata_f = urllib.request.urlopen('ftp://sidads.colorado.edu/DATASETS/NOAA/G02135%s'%month_str)
    cr = csv.reader(io.StringIO(icedata_f.read().decode()), delimiter=',', dialect=dialect)
    icedata = [row for row in cr]
Line 99: Line 100:
    html('<h3>Extent of Arctic sea ice coverage in %s, %d - %d</h3>'%(longmonths[month-1],min(years),max(years)))
    html('Data from the <a href="http://nsidc.org/">National Snow and Ice Data Center</a>')
    pretty_print(html('<h3>Extent of Arctic sea ice coverage in %s, %d - %d</h3>'%(longmonths[month-1],min(years),max(years))))
    pretty_print(html('Data from the <a href="http://nsidc.org/">National Snow and Ice Data Center</a>'))
Line 110: Line 111:
import urllib2 as inet
from pylab import imshow
# Google Chart API: http://code.google.com/apis/chart
Line 120: Line 120:
    html('<div style="border:3px dashed;text-align:center;padding:50px 0 50px 0"><img src="%s"></div>'%url)     pretty_print(html('<div style="border:3px dashed;text-align:center;padding:50px 0 50px 0"><img src="%s"></div>'%url))

Sage Interactions - Web applications

goto interact main page

Warning: Web apps can break frequently due to websites or services changing locations or formats!

CO2 data plot, fetched from NOAA

by Marshall Hampton

One can do many things with scipy.stats. This only scratches the surface.

co2c.png

Arctic sea ice extent data plot, fetched from NSIDC

by Marshall Hampton

seaice.png

Pie Chart from the Google Chart API

by Harald Schilly

interact_with_google_chart_api.png

Stock Market data, fetched from Yahoo and Google FIXME

by William Stein

(Need to fix plotting warnings as well as some stocks give index errors (like bcc), and Python 3 changes, etc.)

stocks.png

interact/web (last edited 2020-06-01 18:37:46 by kcrisman)