Post by David NeÄas (Yeti)Post by Andrés Muñiz PiniellaHow would I get my SM4 files to open 'Topography' container first?
Is it something i can costumize using pygwy module plugin FILE?
I would not try to physically reorder the data as this can mess up
things easily if you miss some bits and pieces.
However, it is possible to set the ‘visible’ flag for some channels upon
loading. When it is set for any channel the data browser will honour
it, instead of showing the first channel which is the default
behaviour.
http://gwyddion.net/documentation/user-guide-en/gwyfile-format.html#gwyfile-channels
AFAICT topography is identified by page type = 1. I can modify the
RHK import modules so that they set ‘visible’ flag for all channels that
have this page type (if there are none the default behaviour would
apply).
There should be some general consensus on this behaviour first though.
Otherwise you can essentially override import by writing a module that
- gives higher score than 100 for the RHK SM4 files
- calls the original module to load the file when asked to do it, i.e.
using gwy_file_func_run_load()
- sets ‘visible’ flags accordingly
- returns the modified Container
I did not actually try this so there may be some unexpected hurdles on
the road.
Hi yeti,
Sorry for giving the false impression that I knew what I was doing. Is this what you meant?
# in windows7 C:\Users\[NameOfUser]\gwyddion\pygwy
import gwy, sys
plugin_type = "FILE"
plugin_desc = "RHK data (.SM4)"
def detect_by_name(filename):
if (filename.endswith(".SM4")):
return 100
else:
return 0
def load(data, filename, title, mode=None):
c = gwy.Container()
for key in data.keys():
if (title.startswith("Topo")):
c.set_object_by_name("/0/data/visible", 1)
#hopefully sets any thing named as topo as visible
#the default will stay as visible.
return c
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.