Skip to content

Instantly share code, notes, and snippets.

@hersfeldtn
hersfeldtn / drift_correct.py
Last active February 15, 2024 15:57
"Drift corrrection" for gplates; copies latest positions of each plate to a near-present time and replaces all flowlines based on mid-ocean ridges
import sys
import os
import shutil
import fileinput
import pygplates
#Update rotation.rot file to copy latest rotation to a near-present day age
Adjust_rotation = True
#Redraw all flowlines based on mid-ocean ridge features
@hersfeldtn
hersfeldtn / gplates_mod.py
Created February 12, 2024 13:13
A python script to modify gplates files to shift all dates or flip east and west
import fileinput
import os
#shifts all dates while not modifying any set to 0.0 and not moving any other dates forward of 0.01
timeshift = False
#amount to be shifted (positive shifts back in time, negative forward in time)
shift = -100.0
#flips east and west of all objects and rotations
import exoplasim as exo
import configparser
import os
name='earth45ax'
prev='earth30ax15ex'
lastyear=0
if os.path.exists(name+'_crashed'):
while True: