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

John Cannon john.cannon at sydney.edu.au
Wed Jan 11 14:47:06 AEDT 2017


Hi Christian,

That's correct - the colouring will always be relative to the reconstruction time. And thanks for providing your colouring tutorial :)


> 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.


> 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)...


import pygplates

class AbsoluteAge:
	def __init__(self):
		pass
				
	def get_style(self, feature, style):
		absolute_age = feature.begin_time()
		style.colour = self.cfg['Palette'].get_color(pygplates.PaletteKey(absolute_age))
		
	def get_config(self):
		self.cfg_dict = {}
		self.cfg_dict['Palette/type'] = 'Palette'
		return self.cfg_dict
		
	def set_config(self, config):
		self.cfg = config

		
def register():
	pygplates.Application().register_draw_style(AbsoluteAge())



...perhaps calling it "AbsoluteAge.py". And make sure not to mix tabs and spaces... as I just did a few moments ago :-) ...  otherwise Python will fail to compile it (when GPlates launches) and it won't get registered.

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).


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).

Regards,
John
________________________________________
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_features_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





More information about the GPlates-discuss mailing list