pygplates.NetRotation
- class pygplates.NetRotation
- Bases: - instance- Net rotation of regional or global crust. - NetRotations support addition - net_rotation = net_rotation1 + net_rotation2and- net_rotation += other_net_rotation.- NetRotations are not equality ( - ==,- !=) comparable (will raise- TypeErrorwhen compared) and are not hashable (cannot be used as a key in a- dict). This stems from the fact that two NetRotations can have equivalent finite rotations but can cover different- areas.- A NetRotation can also be pickled. - Added in version 0.43. - __init__()
- Creates a zero net rotation. 
 - Methods - __init__()- Creates a zero net rotation. - [staticmethod] Convert a - finite rotationover a time interval to a rotation rate vector (with magnitude in radians per Myr).- [staticmethod] Convert a rotation rate vector (with magnitude in radians per Myr) to a - finite rotationover a time interval.- create_sample_from_finite_rotation(point, ...)- [staticmethod] Creates a net rotation contribution from a finite rotation at a point sample. - create_sample_from_rotation_rate(point, ...)- [staticmethod] Creates a net rotation contribution from a rotation rate vector at a point sample. - get_area()- Return the sample area covered by the - point samplesused to calculate this net rotation, in steradians (square radians).- Return the net rotation as a finite rotation (over a time interval of 1Myr). - Return the net rotation as a rotation rate vector with a magnitude of radians per Myr. - static convert_finite_rotation_to_rotation_rate_vector(finite_rotation[, time_interval=1.0])
- [staticmethod] Convert a - finite rotationover a time interval to a rotation rate vector (with magnitude in radians per Myr).- Parameters:
- finite_rotation ( - FiniteRotation) – The finite rotation over the specified time interval.
- time_interval (float) – The time interval of the specified finite rotation (defaults to 1Myr). 
 
- Return type:
 - To convert a finite rotation over 10Myr to a rotation rate vector (in radians per Myr): - net_rotation_rate_vector = pygplates.NetRotation.convert_finite_rotation_to_rotation_rate_vector(net_finite_rotation_over_10myr, 10) 
 - static convert_rotation_rate_vector_to_finite_rotation(rotation_rate_vector[, time_interval=1.0])
- [staticmethod] Convert a rotation rate vector (with magnitude in radians per Myr) to a - finite rotationover a time interval.- Parameters:
- rotation_rate_vector ( - Vector3D) – The rotation rate vector (with magnitude in radians per Myr).
- time_interval (float) – The time interval of the returned finite rotation (defaults to 1Myr). 
 
- Return type:
 - To convert a rotation rate vector (in radians per Myr) to a finite rotation over 10Myr (ie, having the same pole but with an angle multiplied by 10): - net_finite_rotation_over_10myr = pygplates.NetRotation.convert_rotation_rate_vector_to_finite_rotation(net_rotation_rate_vector, 10) 
 - static create_sample_from_finite_rotation(point, sample_area, finite_rotation[, time_interval=1.0])
- [staticmethod] Creates a net rotation contribution from a finite rotation at a point sample. - Parameters:
- point ( - PointOnSphereor- LatLonPointor tuple (latitude,longitude), in degrees, or tuple (x,y,z)) – The point that contributes to net rotation.
- sample_area (float) – The surface area around the point in steradians (square radians). 
- finite_rotation ( - FiniteRotation) – The finite rotation over the specified time interval.
- time_interval (float) – The time interval of the specified finite rotation (defaults to 1Myr). 
 
- Return type:
 - In this contrived example we calculate the net rotation of a single plate. This is just for demonstration purposes in case you wanted to do your own intersections of point samples with plates (otherwise it’s easier to just use - NetRotationSnapshotwhich does all this for you).- # Let's assume you have a plate and know its finite rotation (over 1Myr), and you have a list of # (lat, lon) tuples which are those points on a uniform lat-lon grid that are inside the plate. plate_finite_rotation = ... lat_lon_tuples_inside_plate = [...] lat_lon_grid_spacing_in_degrees = ... lat_lon_grid_spacing_in_radians = math.radians(lat_lon_grid_spacing_in_degrees) # We'll accumulate net rotation over the point samples inside the plate. plate_net_rotation_accumulator = pygplates.NetRotation() # start with zero net rotation for lat, lon in lat_lon_tuples_inside_plate: # The cosine is because points near the North/South poles are closer together # (latitude parallel small circle radius). sample_area_radians = math.cos(math.radians(lat)) * lat_lon_grid_spacing_in_radians * lat_lon_grid_spacing_in_radians plate_net_rotation_accumulator += pygplates.NetRotation.create_sample_from_finite_rotation( pygplates.LatLonPoint(lat, lon), sample_area_radians, plate_finite_rotation) plate_net_rotation = plate_net_rotation_accumulator.get_finite_rotation() 
 - static create_sample_from_rotation_rate(point, sample_area, rotation_rate_vector)
- [staticmethod] Creates a net rotation contribution from a rotation rate vector at a point sample. - Parameters:
- point ( - PointOnSphereor- LatLonPointor tuple (latitude,longitude), in degrees, or tuple (x,y,z)) – The point that contributes to net rotation.
- sample_area (float) – The surface area around the point in steradians (square radians). 
- rotation_rate_vector ( - Vector3D) – The rotation rate vector (with magnitude in radians per Myr).
 
- Return type:
 - See also 
 - get_area()
- Return the sample area covered by the - point samplesused to calculate this net rotation, in steradians (square radians).- Return type:
- float 
 - For example, if this is the net rotation for a single topological plate then the returned area would be the sum of the sample areas of those sample points in the - point distributionthat fell within the polygon boundary of the topological plate.- To convert from steradians (square radians) to square kms multiply, by the square of the - Earth's radius:- area_in_square_kms = net_rotation.get_area() * pygplates.Earth.mean_radius_in_kms**2 - Note - The accuracy of this area depends on how many - point sampleswere used to calculate net rotation. If you need an accurate area then it’s better to explicitly calculate the- polygon areaof the topology (or topologies) that contributed to this net rotation.
 - get_finite_rotation()
- Return the net rotation as a finite rotation (over a time interval of 1Myr). - Return type:
 - Returns - identity rotationif the net rotation is zero.
 - get_rotation_rate_vector()
- Return the net rotation as a rotation rate vector with a magnitude of radians per Myr. - Return type:
 - Returns - zero vectorif the net rotation is zero.