[yt-svn] commit/yt: MatthewTurk: Merged in ngoldbaum/yt/yt-3.0 (pull request #1111)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jul 31 06:46:49 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/61f020440f1a/
Changeset: 61f020440f1a
Branch: yt-3.0
User: MatthewTurk
Date: 2014-07-31 15:46:38
Summary: Merged in ngoldbaum/yt/yt-3.0 (pull request #1111)
Restoring the mapserver.
Affected #: 2 files
diff -r c53247fe4390bec08eb05bb0b96117ebaa45e671 -r 61f020440f1a983b9d0e4875f16773b5a3419e69 doc/source/reference/command-line.rst
--- a/doc/source/reference/command-line.rst
+++ b/doc/source/reference/command-line.rst
@@ -67,6 +67,7 @@
version Get some information about the yt installation (this
is an alias for instinfo).
load Load a single dataset into an IPython instance
+ mapserver Serve a plot in a GMaps-style interface
pastebin Post a script to an anonymous pastebin
pastebin_grab Print an online pastebin to STDOUT for local use.
upload_notebook Upload an IPython notebook to hub.yt-project.org.
@@ -192,6 +193,13 @@
This will start the iyt interactive environment with your specified
dataset already loaded. See :ref:`interactive-prompt` for more details.
+mapserver
++++++++++
+
+Ever wanted to interact with your data using the
+`google maps <http://maps.google.com/>`_ interface? Now you can by using the
+yt mapserver. See :ref:`mapserver` for more details.
+
pastebin and pastebin_grab
++++++++++++++++++++++++++
diff -r c53247fe4390bec08eb05bb0b96117ebaa45e671 -r 61f020440f1a983b9d0e4875f16773b5a3419e69 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -908,6 +908,46 @@
sys.path.insert(0,'')
IPython.embed(config=cfg,user_ns=local_ns)
+class YTMapserverCmd(YTCommand):
+ args = ("proj", "field", "weight",
+ dict(short="-a", longname="--axis", action="store", type=int,
+ dest="axis", default=0, help="Axis (4 for all three)"),
+ dict(short ="-o", longname="--host", action="store", type=str,
+ dest="host", default=None, help="IP Address to bind on"),
+ "ds",
+ )
+
+ name = "mapserver"
+ description = \
+ """
+ Serve a plot in a GMaps-style interface
+
+ """
+
+ def __call__(self, args):
+ ds = args.ds
+ if args.axis == 4:
+ print "Doesn't work with multiple axes!"
+ return
+ if args.projection:
+ p = ProjectionPlot(ds, args.axis, args.field, weight_field=args.weight)
+ else:
+ p = SlicePlot(ds, args.axis, args.field)
+ from yt.gui.reason.pannable_map import PannableMapServer
+ mapper = PannableMapServer(p.data_source, args.field)
+ import yt.extern.bottle as bottle
+ bottle.debug(True)
+ if args.host is not None:
+ colonpl = args.host.find(":")
+ if colonpl >= 0:
+ port = int(args.host.split(":")[-1])
+ args.host = args.host[:colonpl]
+ else:
+ port = 8080
+ bottle.run(server='rocket', host=args.host, port=port)
+ else:
+ bottle.run(server='rocket')
+
class YTPastebinCmd(YTCommand):
name = "pastebin"
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list