GetRangeShifts

This application will find the mean coordinates of all patches within the specified range margin, for each time step of the simulation, and calculates the change in position of the mean from the previous time step. That is, the application tracks the movement of the unweighted centroids of the range margins.

Arguments

There are five mandatory arguments and four optional arguments to this application. Optional arguments are listed between brackets below:

MPFile Start_Year X | Y Threshold Delimiter [burn-in patch_abundance_threshold smoothing_method (sma | exp) window_size]

MPFile is the metapop file to process
Start_Year is the first year of the simulation. Each subsequent time-step is assumed to be one year after this
X | Y if X then the metapopulation movement will be tracked along the East-West axis, if Y the movement will be tracked along the North-South axis
Threshold is the proportion of the metapopulation that will be taken as the range margins. For example, if 0.1 is specified, then the most northerly and southerly ten percent of the population will be taken as the range margin.
Delimiter is the character used to delimit the fields in the outputs
burn-in is the number of years to ignore at the start of the simulation, if a "burn-in" period is being used
patch_abundance_threshold is the minimum abundance threshold, any patch with an abundance less than this will not be included in the calculations
smoothing_method is the method to use to smooth the time-series output by the application. Options are sma for simple moving average and exp for exponential smoothing
window_size is the number of years to include in the smoothing method. Although exponential smoothing doesn't strictly use a smoothing window, the application does use the window size to calculate the weighting factor

Outputs

The outputs of the application are the number of patches loaded, the number of years the simulation was run for, the initial coordinates of the centroid, and a time-series of the movements of the centroid per year of the simulation.

Examples

The command below measures the north-south range margin shiftsm using the most northerly and southerly ten percent of the metapopulation as the margins.

getrangeshifts example.mp 2000 Y 0.1 ,

This yields the following output

Num patches loaded,358
Resolution(km),1
Total years,20
North,,South
Initial Coords,9.86376,4.64119,,10.9704,27.3839
Year,X,Y,Year,X,Y
2000,0,0,2000,0,0
2001,0.664208,0.0600417,2001,0.285204,0.0370509
2002,-0.190911,-0.0784107,2002,0.402479,0.295408
2003,-1.09282,-0.111725,2003,0.393157,0.483539
2004,-0.339125,0.014125,2004,0.539956,1.40852
2005,-0.864625,0.099475,2005,0.0455457,1.21197
2006,-0.955125,0.270125,2006,-0.0610714,1.53872
2007,0.129625,0.376125,2007,0.0390952,1.57377
2008,0.545775,0.407075,2008,0.0227952,2.13996
2009,0.37375,0.780625,2009,0.185583,2.10701
2010,0.172486,1.05787,2010,0.780725,2.33841
2011,0.817144,1.55211,2011,0.994762,2.39333
2012,1.08154,2.11521,2012,0.643993,2.66831
2013,1.03011,2.14377,2013,-0.0383181,2.88411
2014,0.679007,2.34645,2014,0.747035,3.5021
2015,-0.0567019,2.76087,2015,-0.810655,3.49452
2016,-0.687856,3.06311,2016,-0.757238,3.53196
2017,-0.718087,3.28911,2017,-1.28774,3.62411
2018,-1.64313,3.78747,2018,0.354262,3.555
2019,-1.25693,3.7478,2019,0.568703,3.5676

Applying a three-year burn-in with the following command:

getrangeshifts example.mp 2000 Y 0.1 , 3

Yields the following output:

Num patches loaded,358
Resolution(km),1
Total years,20
Burn-in years,3
North,,South
Initial Coords,9.4706,4.15765,,12.0632,27.4956
Year,X,Y,Year,X,Y
2003,0,0,2003,0,0
2004,0.7537,0.12585,2004,0.146799,0.924984
2005,0.2282,0.2112,2005,-0.347612,0.728435
2006,0.1377,0.38185,2006,-0.454229,1.05518
2007,1.22245,0.48785,2007,-0.354062,1.09023
2008,1.6386,0.5188,2008,-0.370362,1.65642
2009,1.46658,0.89235,2009,-0.207574,1.62347
2010,1.26531,1.1696,2010,0.387568,1.85487
2011,1.90997,1.66383,2011,0.601605,1.90979
2012,2.17437,2.22693,2012,0.250835,2.18477
2013,2.12294,2.25549,2013,-0.431475,2.40057
2014,1.77183,2.45818,2014,0.353877,3.01856
2015,1.03612,2.8726,2015,-1.20381,3.01098
2016,0.404969,3.17483,2016,-1.1504,3.04842
2017,0.374738,3.40083,2017,-1.6809,3.14057
2018,-0.5503,3.8992,2018,-0.0388953,3.07146
2019,-0.164108,3.85952,2019,0.175546,3.08406

Patches with abundances less the five are filtered out as follows:

getrangeshifts example.mp 2000 Y 0.1 , 3 5

which gives us:

Num patches loaded,358
Patch size threshold,5
Num patches after cleaning,203
Resolution(km),1
Total years,20
Burn-in years,3
North,,South
Initial Coords,9.40787,4.05823,,11.1225,27.121
Year,X,Y,Year,X,Y
2003,0,0,2003,0,0
2004,0,0,2004,0.0707541,0.780995
2005,0.28175,0.11325,2005,-0.208957,0.646916
2006,-0.938167,0.0593333,2006,-0.432814,0.956259
2007,-0.938167,0.0593333,2007,-0.482069,0.99479
2008,0.6979,0.1442,2008,-0.328645,1.57833
2009,0.525875,0.51775,2009,-0.176536,1.54242
2010,0.324611,0.795,2010,0.445103,1.78342
2011,0.713167,1.14058,2011,0.505679,1.79958
2012,1.11056,1.88825,2012,-0.285492,2.08528
2013,0.900967,2.04313,2013,-0.549389,2.29771
2014,0.254625,2.42088,2014,-0.154028,2.92373
2015,0.0954231,2.498,2015,-1.00422,2.88505
2016,-0.752864,3.19136,2016,-1.00422,2.88505
2017,-0.788591,3.45845,2017,-1.48593,2.91773
2018,-1.491,3.5246,2018,-1.48593,2.91773
2019,-1.491,3.5246,2019,-1.48593,2.91773

Finally, applying exponential smoothing with a window size of three:

getrangeshifts example.mp 2000 Y 0.1 , 3 5 exp 3

Num patches loaded,358
Patch size threshold,5
Num patches after cleaning,203
Resolution(km),1
Total years,20
Burn-in years,3
Exponential smoothing window,3
North,,South
Initial Coords,9.40787,4.05823,,11.1225,27.121
Year,X,Y,Year,X,Y
2003,0,0,2003,0,0
2004,0,0,2004,0.0353771,0.390498
2005,0.140875,0.056625,2005,-0.0867899,0.518707
2006,-0.398646,0.0579792,2006,-0.259802,0.737483
2007,-0.668406,0.0586563,2007,-0.370936,0.866136
2008,0.0147469,0.101428,2008,-0.349791,1.22224
2009,0.270311,0.309589,2009,-0.263163,1.38233
2010,0.297461,0.552295,2010,0.0909697,1.58287
2011,0.505314,0.846439,2011,0.298325,1.69123
2012,0.807938,1.36734,2012,0.00641639,1.88825
2013,0.854452,1.70524,2013,-0.271486,2.09298
2014,0.554539,2.06306,2014,-0.212757,2.50836
2015,0.324981,2.28053,2015,-0.608488,2.6967
2016,-0.213941,2.73595,2016,-0.806354,2.79088
2017,-0.501266,3.0972,2017,-1.14614,2.8543
2018,-0.996133,3.3109,2018,-1.31603,2.88602
2019,-1.24357,3.41775,2019,-1.40098,2.90187



Back to RAMAS Metapop Tools main page.


Maintained by Dr Michael J. Watts