Add a demo for the HDF5 module 42/12742/4
Antoine Monmayrant [Mon, 30 Sep 2013 09:40:16 +0000 (11:40 +0200)]
Change-Id: Iad5e6f7dd9e9bcc95ef00b110e103ae85f5887c7

scilab/modules/hdf5/demos/eps.h5 [new file with mode: 0644]
scilab/modules/hdf5/demos/hdf5.dem.gateway.sce [new file with mode: 0644]
scilab/modules/hdf5/demos/resonator.dem.sce [new file with mode: 0644]

diff --git a/scilab/modules/hdf5/demos/eps.h5 b/scilab/modules/hdf5/demos/eps.h5
new file mode 100644 (file)
index 0000000..3d74199
Binary files /dev/null and b/scilab/modules/hdf5/demos/eps.h5 differ
diff --git a/scilab/modules/hdf5/demos/hdf5.dem.gateway.sce b/scilab/modules/hdf5/demos/hdf5.dem.gateway.sce
new file mode 100644 (file)
index 0000000..5e56d62
--- /dev/null
@@ -0,0 +1,18 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+
+function subdemolist = demo_gateway()
+
+    demopath = get_absolute_file_path("hdf5.dem.gateway.sce");
+    add_demo(gettext("HDF5"), demopath + "hdf5.dem.gateway.sce");
+
+    subdemolist = [_("Ring resonator (HDF5 data source)")   ,"resonator.dem.sce" ]
+
+    subdemolist(:,2) = demopath + subdemolist(:,2);
+endfunction
+
+subdemolist = demo_gateway();
+clear demo_gateway;
diff --git a/scilab/modules/hdf5/demos/resonator.dem.sce b/scilab/modules/hdf5/demos/resonator.dem.sce
new file mode 100644 (file)
index 0000000..eecce97
--- /dev/null
@@ -0,0 +1,37 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - S/E - Sylvestre Ledru
+// Copyright (C) 2013 - LASS - Antoine Monmayrant
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function resonator_demo()
+
+
+
+    my_test_fig = figure(100001);
+    my_test_fig.figure_name = _("Ring Resonator from a HDF5 file");
+
+    filename = "resonator.dem.sce";
+    demo_viewCode(filename);
+
+    h5=h5open(SCI+"/modules/hdf5/demos/eps.h5");
+    eps=h5.root.eps.data;
+
+    surf(eps);
+    h=gcf();
+    h.color_map=hotcolormap(64);
+    f=gcf();f.background=60;
+    e=gce();
+    a=gca();
+    a.x_label.text=_("X position [a]");
+    a.y_label.text=_("Y position [a]");
+    a.z_label.text=_("Permittivity");
+    a.z_label.font_angle=-90;
+    e.thickness=0;
+    a.rotation_angles=[20,-140];
+    a.title.text=_("Ring Resonator");
+
+endfunction
+
+resonator_demo();
+clear resonator_demo;
\ No newline at end of file