Documentation
¶
Overview ¶
Package model implements paleogeographic reconstruction models using a pixelation based on an equal area pixelation and discrete time stages.
There are different model types depending on how is expected the reconstruction model will be used.
To build a model, type PixPlate is used to provide associations between tectonic plates (which rotations are defined in a rotation file) and the pixels of that plate.
Index ¶
- type PixAge
- type PixPlate
- func (pp *PixPlate) Add(plate int, name string, lat, lon float64, begin, end int64)
- func (pp *PixPlate) AddPixels(plate int, name string, pixels []int, begin, end int64)
- func (pp *PixPlate) Pixel(plate, pixel int) PixAge
- func (pp *PixPlate) Pixelation() *earth.Pixelation
- func (pp *PixPlate) Pixels(plate int) []int
- func (pp *PixPlate) Plates() []int
- func (pp *PixPlate) TSV(w io.Writer) error
- type Recons
- func (rec *Recons) Add(plate int, locations map[int][]int, age int64)
- func (rec *Recons) PixStage(plate int, age int64) map[int][]int
- func (rec *Recons) Pixelation() *earth.Pixelation
- func (rec *Recons) Pixels(plate int) []int
- func (rec *Recons) Plates() []int
- func (rec *Recons) Stages() []int64
- func (rec *Recons) TSV(w io.Writer) error
- type Rotation
- type StageRot
- type TimePix
- func (tp *TimePix) At(age int64, pixel int) (int, bool)
- func (tp *TimePix) AtClosest(age int64, pixel int) int
- func (tp *TimePix) Bounds(age int64) (old, young int64)
- func (tp *TimePix) ClosestStageAge(age int64) int64
- func (tp *TimePix) Del(age int64, pixel int)
- func (tp *TimePix) Pixelation() *earth.Pixelation
- func (tp *TimePix) Set(age int64, pixel, value int)
- func (tp *TimePix) Stage(age int64) map[int]int
- func (tp *TimePix) Stages() []int64
- func (tp *TimePix) TSV(w io.Writer) error
- type Total
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PixAge ¶
type PixAge struct { // Name of the feature that contains the pixel Name string // ID of the pixel // (using an isolatitude pixelation) ID int // Plate ID of the plate that contains the pixel Plate int // Temporal range of the pixel // in years Begin int64 End int64 }
A PixAge is a pixel with a defined time range.
type PixPlate ¶
type PixPlate struct {
// contains filtered or unexported fields
}
A PixPlate is a collection of pixels associated to tectonic plates.
func NewPixPlate ¶
func NewPixPlate(pix *earth.Pixelation) *PixPlate
NewPixPlate creates a new plate pixelation from an isolatitude pixelation.
func ReadPixPlate ¶
ReadPixPlate reads a tectonic plates pixelation from a TSV file.
The TSV file must have the following columns:
- equator, for the number of pixels at the equator
- plate, the ID of a tectonic plate
- pixel, the ID of a pixel (from a pixelation)
- begin, the oldest age of the pixel (in years)
- end, the youngest age of the pixel (in years)
Optionally, it can include the following fields:
- name, name of the tectonic feature
Here is an example file:
# tectonic plates pixelation equator plate pixel name begin end 360 202 29611 Parana 600000000 0 360 802 41257 Antarctica 600000000 0
If no pixelation is given, a new pixelation will be created.
func (*PixPlate) AddPixels ¶
AddPixels adds an slice of pixel IDs to a plate in a given time frame (in years).
func (*PixPlate) Pixelation ¶
func (pp *PixPlate) Pixelation() *earth.Pixelation
Pixelation returns the underlying pixelation of the pixel collection.
type Recons ¶
type Recons struct {
// contains filtered or unexported fields
}
A Recons is an editable plate motion model based on an equal area pixelation and using discrete time stages.
The model is based on tectonic plates so a time pixel should be retrieved by its plate.
func NewRecons ¶
func NewRecons(pix *earth.Pixelation) *Recons
NewRecons creates a new reconstruction model with a given pixelation.
func ReadReconsTSV ¶
ReadReconsTSV reads a plate motion model from a TSV file.
The TSV file must contains the following columns:
- equator, for the number of pixels at the equator
- plate, the ID of a tectonic plate
- pixel, the ID of a pixel (in an equal area pixelation)
- age, the age of the time stage (in years)
- stage-pixel, the pixel ID at the time stage
Here is an example file:
equator plate pixel age stage-pixel 360 59999 17051 100000000 19051 360 59999 17051 140000000 20051 360 59999 17055 100000000 19055 360 59999 17055 140000000 20055 360 59999 17055 140000000 20056
If no pixelation is given, a new pixelation will be created.
func (*Recons) Add ¶
Add adds a set of pixel locations at a time stage, in years, of a plate. Locations is a map in which the key is the pixel ID at the present time, and the value is an slice of pixel IDs of the locations of the pixel at the time stage (because the pixelation is a discrete representation of the continuous space, some reconstructions will produce multiple destinations for the same pixel).
func (*Recons) PixStage ¶
PixStage returns pixel locations at a time stage, in years. Locations is a map in which the key is the pixel ID at the present time, and the value is an slice of pixel IDs of the locations of the pixel at the time stage.
func (*Recons) Pixelation ¶
func (rec *Recons) Pixelation() *earth.Pixelation
Pixelation returns the underlying equal area pixelation of the model.
type Rotation ¶
type Rotation struct { // Ages (in years) of the rotation From int64 To int64 // pixels at 'from' time rotate to 'to' time Rot map[int][]int }
A Rotation is a rotation of a pixel to another time stage.
type StageRot ¶
type StageRot struct {
// contains filtered or unexported fields
}
StageRot is a collection of stage rotations.
An stage rotation is a rotation from a pixel at a time stage to another time stage. In this case the time stages are the neighbor time stages defined by a tectonic reconstruction model.
func NewStageRot ¶
NewStageRot returns a collection of stage rotations from a reconstruction model.
func ReadStageRot ¶
ReadStageRot reads a collection of stage rotations from a TSV file that contains a plate motion model.
The TSV file is a paleogeographic reconstruction model and must contains the following columns:
The TSV file is a paleogeographic reconstruction model file and must contain the following columns:
- equator, for the number of pixels at the equator
- plate, the ID of a tectonic plate
- pixel, the ID of a pixel (in the isolatitude pixelation)
- age, the age of the time stage (in years)
- stage-pixel, the pixel ID at the time stage
Here is an example file:
# paleogeographic reconstruction model equator plate pixel age stage-pixel 360 59999 17051 100000000 19051 360 59999 17051 140000000 20051 360 59999 17055 100000000 19055 360 59999 17055 140000000 20055 360 59999 17055 140000000 20056
If no pixelation is given, a new pixelation will be created.
func (*StageRot) ClosestStageAge ¶
ClosestStageAge returns the closest stage age for a given time i.e. the age of the first time stage younger than the given age.
func (*StageRot) OldToYoung ¶
OldToYoung returns an stage rotation from an older stage to it most immediate younger stage. If there is no younger stage, it will return a nil map.
func (*StageRot) YoungToOld ¶
YoungToOld returns an stage rotation from a younger stage to it most immediate older stage. If there is no older stage, it will return a nil map.
type TimePix ¶
type TimePix struct {
// contains filtered or unexported fields
}
A TimePix is a pixelated set of values (for example, an environmental variable) at different time stages. Note that only positions and values are stored so the identity of the pixel in time is not preserved.
func NewTimePix ¶
func NewTimePix(pix *earth.Pixelation) *TimePix
NewTimePix returns a new time pixelation based on an equal area pixelation.
func ReadTimePix ¶
ReadTimePix reads values of a time pixelation from a TSV file.
The TSV must contain the following columns:
- equator, for the number of pixels at the equator
- age, the age of the time stage (in years)
- stage-pixel, the pixel ID at the time stage
- value, an integer value
Here is an example file:
equator age stage-pixel value 360 100000000 19051 1 360 100000000 19055 2 360 100000000 19409 1 360 140000000 20051 1 360 140000000 20055 2 360 140000000 20056 3
If no pixelation is given, a new pixelation will be created.
func (*TimePix) At ¶
At returns the value for a pixel at a time in a time pixelation. If the pixel was never defined, it will return the default value (i.e. 0).
If the time stage is not defined for the time pixelation if will return 0 and false. If a pixel value in the closer time stage is wanted, use AtCloser.
func (*TimePix) AtClosest ¶
AtClosest returns the value for a pixel at the closest time stage (i.e. the age of the oldest stage younger than the indicated age). If the pixel was never defined, it will return the default value (i.e. 0).
func (*TimePix) Bounds ¶
Bounds return the age bounds for the stage of the given age in million years.
func (*TimePix) ClosestStageAge ¶
ClosestStageAge returns the closest stage age for a time (i.e. the age of the oldest stage younger than the indicated age).
func (*TimePix) Pixelation ¶
func (tp *TimePix) Pixelation() *earth.Pixelation
Pixelation returns the underlying equal area pixelation.
type Total ¶
type Total struct {
// contains filtered or unexported fields
}
Total is a collection of total rotations for pixels at present time moved to a given time stage.
func NewTotal ¶
NewTotal returns a collection of total rotations build from a tectonic reconstruction model.
func ReadTotal ¶
ReadTotal reads a collection of total rotations from a TSV file that contains a plate motion model. A total rotation is a rotation of a pixel in present time to a given time stage.
If no pixelation is given a new pixelation will be created.
If inverse is true, an inverse rotation will be returned. In an inverse rotation, the reference pixel are at the given time stage an rotate it to their present locations.
func (*Total) ClosestStageAge ¶
ClosestStageAge returns the closest stage age for a given time age (i.e. the age of the oldest time stage that is youngest than the given age). This stage age is the one used by Rotation method.
func (*Total) Inverse ¶
Inverse returns an inverse total rotation, a collection of pixels in past time moved to current time.
func (*Total) IsInverse ¶
IsInverse returns true in the total rotation is inverse i.e. is from past pixels to present pixels.
func (*Total) Pixelation ¶
func (t *Total) Pixelation() *earth.Pixelation
Pixelation returns the underlying pixelation of a total rotation model.
func (*Total) Rotation ¶
Rotation returns a pixel location at a given time stage. Locations is a map in which the key is the pixel ID at present time, and the value is an slice of pixel IDs of the locations of the key pixel at the time stage.
If the age given is not a defined time stage, the returned locations will be from the oldest time stage that is youngest that the given age. For example, the defined stages are [0, 10_000_000, 100_000_000], if asked for the stage 19_843_211 it will return the pixel locations at 10_000_000.