[GPlates-discuss] Colour by feature age: Keeping colour constant during reconstruction

Christian.Heine at shell.com Christian.Heine at shell.com
Thu Jan 12 01:44:28 AEDT 2017


Hi John,

[snip]

> /detailMode on/
>
> Firstly, there's the new official pyGPlates API (programming
> interface)...
> 
> http://www.gplates.org/docs/pygplates/index.html
> 
> ...which does not currently work in GPlates (ie, can only be used in
> external Python scripts - by external I mean not running inside GPlates).

OK, yes, understood.

> But there's also an old, lesser known API that is currently used "inside"
> GPlates for colouring (like you see in ColorByProperty.py and that
> AbsoluteAge code snippet below)...
> 
> http://www.gplates.org/user-manual/PythonAPIs.html
> 
> ...but it will mostly get replaced by the official pyGPlates API when it
> is later supported "inside" GPlates. And this will affect the colouring
> scripts since they make calls to pyGPlates (and hence will be affected by
> the changed API). But since the old API is quite small we will probably
> also silently support it for backward compatibility (ie, so old colouring
> scripts don't bail).

Fantastic, this was what I was after! I'm just interested in the interacting/querying features and I was really puzzled yesterday when I couldn't get this working in the GPlates Python console. As I recalled from some years back, Michael and I coded up a simple time-bookmarking tool which was using that API. Mystery solved :-)

Will contact you offlist for some other stuff in the next days. 

Many thanks for your help.

Greetings,
Christian


> ________________________________________
> From: GPlates-discuss [gplates-discuss-bounces at mailman.sydney.edu.au] on
> behalf of Christian.Heine at shell.com [Christian.Heine at shell.com]
> Sent: Wednesday, 11 January 2017 9:31 PM
> To: gplates-discuss at mailman.sydney.edu.au
> Subject: Re: [GPlates-discuss] Colour by feature age: Keeping colour
> constant during reconstruction
> 
> Hi John,
> 
> > That's correct - the colouring will always be relative to the
> > reconstruction time. And thanks for providing your colouring tutorial
> > :)
> 
> Most welcome!
> 
> > > I guess one could also just point the ColorByProperty script to the
> > "FROMAGE" here, thinking about it...
> >
> > Yes that works also. And is probably the easiest solution if you
> > already have the ColorByProperty script.
> 
> OK
> 
> > > Is there a simpler way to do this?
> >
> > This isn't the simplest, but another alternative is to provide the
> > following script (using a similar procedure, to add the script, as
> > covered in your tutorial)...
> 
> [snip]
> 
> > ...perhaps calling it "AbsoluteAge.py". And make sure not to mix tabs
> > and spaces... as I just did a few moments ago :-) ...
> 
> haha, beginner's mistake ;-)
> 
> > It's basically a minor modification to class FeatureAge in the
> > existing "draw_style_demo.py" script that you can see in GPlates 1.5
> > (it's now stored inside the executable in GPlates 2.0 - so no longer
> visible).
> 
> Great - can confirm that your script works (did check for the space/tabs
> though :-) ), the beauty is that now only needs the CPT to be loaded and
> not the age attribute specified.
> 
> > In the future we will take another look at this sort of thing when
> > symbology is implemented/improved to see investigate easier ways to do
> > this (ie, without having to write a Python script).
> 
> Yep, cool.
> 
> One other question - the pygplates pages say that pygplates doesn't yet
> work on the built-in GPlates Python console, is this still the case in
> GPlates 2.0.x? I was trying something out yesterday and couldn't get
> pygplates to work in the console.
> 
> Thanks again,
> Christian
> 
> 
> 
> > ________________________________________
> > From: GPlates-discuss [gplates-discuss-bounces at mailman.sydney.edu.au]
> > on behalf of Christian.Heine at shell.com [Christian.Heine at shell.com]
> > Sent: Tuesday, 10 January 2017 3:39 AM
> > To: gplates-discuss at mailman.sydney.edu.au
> > Subject: [GPlates-discuss] Colour by feature age: Keeping colour
> > constant during reconstruction
> >
> > Hi list,
> >
> > happy 2017 first!
> >
> > I recently had a query from a colleague and just wanted to check with
> > the list whether my reasoning/workflow is correct:
> >
> > When reconstructing features in GPlates which are coloured by
> > "FeatureAge" the colouring will always be relative to reconstruction
> age.
> > I am using my GTS2012 colourscale
> > (https://bitbucket.org/chhei/gmt-cpts)
> > but this equally applies to the default GPlates FeatureAge colouring.
> > This means that a 50 Ma old feature at 40 Ma recon time will be be
> > 'yellowish' (using the GTS2012 cpt) as it is only 10 Myr old, but grow
> > darker as reconstruction time progresses towards present day.
> >
> > In order to keep the feature colour constant (e.g. keep a Jurassic
> > chron "blue" over the course of the reconstruction) I have reverted to
> > the following procedure described here:
> >
> > https://wiki.paleoearthlabs.org/tectonicwaters:gplates_coloring_featur
> > es_
> > by_absolute_age
> >
> > where I introduce a new attribute column for the "FROMAGE" but then
> > use the ColorByProperty python script to colour the features for an
> > absolute age (ie keep the colouring constant) using the age value from
> > the new column.
> >
> > Is there a simpler way to do this? I guess one could also just point
> > the ColorByProperty script to the "FROMAGE" here, thinking about it...
> >
> >
> > Cheers,
> > Christian
> >
> > --
> >   Christian Heine, Ph.D.
> >   Upstream | Shell Intl. Exploration and Production B.V.
> >   Carel van Bylandtlaan 5 | C05 0.D15
> >   2596 HP Den Haag, The Netherlands
> >
> >   SIP +31 7 0377 4341
> >   W: http://www.shell.com
> >   G: http://goo.gl/7GfvPZ
> >
> > _______________________________________________
> > GPlates-discuss mailing list
> > GPlates-discuss at mailman.sydney.edu.au
> > http://mailman.sydney.edu.au/mailman/listinfo/gplates-discuss
> >
> >
> >
> > _______________________________________________
> > GPlates-discuss mailing list
> > GPlates-discuss at mailman.sydney.edu.au
> > http://mailman.sydney.edu.au/mailman/listinfo/gplates-discuss
> 
> _______________________________________________
> GPlates-discuss mailing list
> GPlates-discuss at mailman.sydney.edu.au
> http://mailman.sydney.edu.au/mailman/listinfo/gplates-discuss
> 
> 
> 
> _______________________________________________
> GPlates-discuss mailing list
> GPlates-discuss at mailman.sydney.edu.au
> http://mailman.sydney.edu.au/mailman/listinfo/gplates-discuss



More information about the GPlates-discuss mailing list