- Installation
- Install using pip
- Requirements
- Install using pip
- A Backtracking Example
Backtrack (1990) or Catchfire, is a release that would have been fine in 1977 or 1979, at best, but never in 1990. The music soundtrack is pure 1970's and the drama-style is 1970's TV-grade.
- 7/10 (563 votes) - Download BackTrack Free. Audit and check the security of your WiFi networks with the tools offered by BackTrack. Protect yourself against intruders and potential data leaks. There are loads of Linux distributions focused on auditing the security of wireless networks.
- Backtrack is a simple logging tool for Python 3.
You can install
pybacktrack
either:- using pip, or
- using Docker.
Docker is typically more straightforward since all the dependencies of
pybacktrack
have been pre-installed.Python packages installed using pip will typically also have their dependency packages automatically installed also.However
pybacktrack
requires manual installation of some of its dependencies.- Requirements
PyBacktrack depends on:
- Generic Mapping Tools (GMT) (>=5.0.0)
NumPy and SciPy are automatically installed by pip when pybacktrack is installed, however GMT (version 5 or above) and pyGPlates need to be manually installed.
GMT is called via the command-line (shell) and so just needs to be in the PATH in order for pyBacktrack to find it.Also ensure that version 5 or above (supports NetCDF version 4) is installed since the bundled grid files in pyBacktrack are in NetCDF4 format.
PyGPlates is not currently installable as a package and so needs to be in the python path (sys.path or PYTHONPATH).Installation instructions are available here.
PyGPlates now supports Python 3 (in addition to Python 2.7) so you can now use pyBacktrack with either Python 2.7 or 3.The Macports install example below shows one approach to selecting the default Python (2.7 or 3) using
sudoportselect
.Another approach is using Python virtual environments where each environment has its own python
, pip
and installed packages.However, currently pyGPlates does not yet work in virtual environments (at least on Mac systems).This is an example demonstrating how to install GMT and pyGPlates on Ubuntu 18.04 (Bionic).
Note
The main difference for other Ubuntu versions will be the pyGPlates install package(you’ll need to select the package appropriate for your Ubuntu version).
First install GMT 5:
Then install Python 3 (and Pip):
Then download the pyGPlates Python 3 debian package pygplates-py3-ubuntu-bionic_2.2_1_amd64.deb,and install it:
Then add the installed location of pyGPlates to the PYTHONPATH environment variable:
This is an example demonstrating how to install GMT and pyGPlates on a Mac system using Macports.
First install GMT 5:
Note
You will likely need to add
/opt/local/lib/gmt5/bin/
to your PATH
environment variable,for example in your ~/.bashrc
, ~/.bash_profile
or ~/.zprofile
file so that PATHis set each time you open a new terminal window.After doing this, typing gmt
should find GMT and show some help options.Then install Python 3 (and Pip):
Set your default
python
to Python 3.8:Note
If you already have
python
referencing Python 2 then you can instead use python3
to reference Python 3:…but this will require using
python3
on the command-line to runpybacktrack (instead of just python
).Alternatively you can use Python 2.7 to run pyBacktrack (instead of Python 3) by installing pyGPlatesfor Python 2.7 (instead of for Python 3) - see below.
Then download the pyGPlates Mac zip file pygplates_rev28_python38_MacOS64.zip,and extract it to your home directory.
Then add the unzipped location of pyGPlates to the PYTHONPATH environment variable:
Note
The above line can be added to your
~/.bashrc
, ~/.bash_profile
or ~/.zprofile
fileso that PYTHONPATH is set each time you open a new terminal window.Note
If you are using Python 2.7 to run pyBacktrack (instead of Python 3) then install the Python 2.7 version of pyGPlates instead by installing
pygplates_rev28_python27_MacOS64.zip
and adding ~/pygplates_rev28_python27_MacOS64
to your PYTHONPATH
.To install the latest stable version, run:
Warning
On Mac systems, when using Macports, it might be better to install to thelocal user install directory with
python-mpipinstall--userpybacktrack
to avoid confusing Macports(which installs to the system install directory).And on linux systems, if you have admin privileges, you can install to the system install directory with
sudopython-mpipinstallpybacktrack
.Note
We generally recommend using
python-mpipinstallpybacktrack
instead of pipinstallpybacktrack
to ensure pybacktrack
is installedinto the python
you are actually using. For example, when using Conda Python it might be that python
executes the Conda Python interpreterbut pip
installs into the system Python (eg, because the base Conda environment is not activated).If you already have
pybacktrack
installed and would like to upgrade to the latest version then use the --upgrade
flag: Mweb powerful markdown app 2 2 6.To install the latest development version (requires Git on local system), run:
Note
You may need to update your Git if you receive an error ending with
tlsv1alertprotocolversion
.…or download the pyBacktrack source code, extract to a local directory and run:
Note
Installing pyBacktrack will automatically install the NumPy and SciPyrequirements.However, as mentioned in requirements, GMT and pyGPlates still need to be manually installed.
Before running the example below, or any other examples, you’ll also need to install the example data (from the pybacktrack package itself).This assumes you’ve already installed the pybacktrack package.
The following command installs the examples (example data and notebooks) to a new sub-directory of your current working directory called
pybacktrack_examples
:Note
The current working directory is whatever directory you are in when you run the above command.
Note
Alternatively you can choose a different sub-directory by providing an argument to the
install_examples()
function above.For example,
python-c'importpybacktrack;pybacktrack.install_examples('pybacktrack/examples')'
creates a new sub-directory of your current working directory called pybacktrack/examples
.However the example below assumes the default directory (
pybacktrack_examples
).This method of running
pybacktrack
relies on Docker, so before installingthe pybacktrack
docker image, ensure you have installed Docker.Note
On Windows platforms you can install Docker Toolbox orDocker Desktop for Windows.
Docker Desktop for Windows offers the most “native” experience and is recommended by Docker, but hashigher system requirements and once it’s installed you can no longer use VirtualBox (to run other Virtual Machines).
In contrast, Docker Toolbox relies on VirtualBox, so if your system can run VirtualBox thenDocker Toolbox should work on your system.
A similar situation applies on Mac platforms where you can installDocker Toolbox orDocker Desktop for Mac.
Once Docker is installed, open a Docker terminal (command-line interface).
Note
For Docker Toolbox this is the Docker Quickstart Terminal.
For Docker Desktop for Windows andDocker Desktop for Mac this a regular command-line terminal.
On Linux systems this a regular command-line terminal.
To install the
pybacktrack
docker image, type:To run the docker image:
This should bring up a command prompt inside the running docker container.
The current working directory should be
/usr/src/pybacktrack/
.It should have a
pybacktrack_examples
sub-directory containing test data.Note
On Linux systems you may have to use sudo when running docker commands. For example:
From the current working directory you can run the backtracking example below,or any other examples in this documentation. For example, you could run:
If you wish to run the example notebooksthen there is a
notebook.sh
script to start a Jupyter notebook server in the running docker container:Then you can start a web browser on your local machine and type the following in the URL field:
This will display the current working directory in the docker container.
In the web browser, navigate to
pybacktrack_examples
and then notebooks
.Then click on a notebook (such as backtrack.ipynb).
You should be able to run the notebook, or modify it and then run it.
Note
If you are running Docker Toolbox on Windows then use the Docker Machine IP instead of
localhost
.To find the IP address use the command
docker-machineip
.Once installed,
pybacktrack
is available to:- run built-in scripts (inside
pybacktrack
), or importpybacktrack
into your own script.
The following example is used to demonstrate both approaches. It backtracks an ocean drill site and saves the output to a text file by:
- reading the ocean drill site file
pybacktrack_examples/test_data/ODP-114-699-Lithology.txt
,NoteHowever if you have your own ocean drill site file then you can substitute it in the example below if you want. - backtracking it using:
- the
M2
dynamic topography model, and - the
Haq87_SealevelCurve_Longterm
sea-level model,
- the
- writing the amended drill site to
ODP-114-699_backtrack_amended.txt
, and - writing the following columns to
ODP-114-699_backtrack_decompat.txt
:- age
- compacted_depth
- compacted_thickness
- decompacted_thickness
- decompacted_density
- decompacted_sediment_rate
- decompacted_depth
- dynamic_topography
- water_depth
- tectonic_subsidence
- lithology
Since there is a
backtrack
module inside pybacktrack
that can be run as a script,we can invoke it on the command-line using python-mpybacktrack.backtrack_cli
followed by command line options that are specific to that module.This is the easiest way to run backtracking.To see its command-line options, run:
Red giant shooter suite 13 1 4. The backtracking example can now be demonstrated by running the script as:
An alternative to running a built-in script is to write your own script (using a text editor) that imports
pybacktrack
andcalls its functions. You might do this if you want to combine pyBacktrack functionality with other research functionality into a single script.The following Python code does the same as the built-in script by calling the
pybacktrack.backtrack_and_write_well()
function:If you save the above code to a file called
my_backtrack_script.py
then you can run it as:- Installation
- Install using pip
- Requirements
- Install using pip
- A Backtracking Example
You can install
pybacktrack
either:- using pip, or
- using Docker.
Docker is typically more straightforward since all the dependencies of
pybacktrack
have been pre-installed.Python packages installed using pip will typically also have their dependency packages automatically installed also.However
pybacktrack
requires manual installation of some of its dependencies.- Requirements
PyBacktrack depends on:
- Generic Mapping Tools (GMT) (>=5.0.0)
NumPy and SciPy are automatically installed by pip when pybacktrack is installed, however GMT (version 5 or above) and pyGPlates need to be manually installed.
GMT is called via the command-line (shell) and so just needs to be in the PATH in order for pyBacktrack to find it.Also ensure that version 5 or above (supports NetCDF version 4) is installed since the bundled grid files in pyBacktrack are in NetCDF4 format.
PyGPlates is not currently installable as a package and so needs to be in the python path (sys.path or PYTHONPATH).Installation instructions are available here.
PyGPlates now supports Python 3 (in addition to Python 2.7) so you can now use pyBacktrack with either Python 2.7 or 3.The Macports install example below shows one approach to selecting the default Python (2.7 or 3) using
sudoportselect
.Another approach is using Python virtual environments where each environment has its own python
, pip
and installed packages.However, currently pyGPlates does not yet work in virtual environments (at least on Mac systems).This is an example demonstrating how to install GMT and pyGPlates on Ubuntu 18.04 (Bionic).
Note
The main difference for other Ubuntu versions will be the pyGPlates install package(you’ll need to select the package appropriate for your Ubuntu version).
First install GMT 5:
Then install Python 3 (and Pip):
Then download the pyGPlates Python 3 debian package pygplates-py3-ubuntu-bionic_2.2_1_amd64.deb,and install it:
Then add the installed location of pyGPlates to the PYTHONPATH environment variable:
This is an example demonstrating how to install GMT and pyGPlates on a Mac system using Macports.
First install GMT 5:
Note
You will likely need to add
/opt/local/lib/gmt5/bin/
to your PATH
environment variable,for example in your ~/.bashrc
, ~/.bash_profile
or ~/.zprofile
file so that PATHis set each time you open a new terminal window.After doing this, typing gmt
should find GMT and show some help options.Then install Python 3 (and Pip):
Set your default
python
to Python 3.8:Note
If you already have
python
referencing Python 2 then you can instead use python3
to reference Python 3:…but this will require using
python3
on the command-line to runpybacktrack (instead of just python
).Alternatively you can use Python 2.7 to run pyBacktrack (instead of Python 3) by installing pyGPlatesfor Python 2.7 (instead of for Python 3) - see below.
Then download the pyGPlates Mac zip file pygplates_rev28_python38_MacOS64.zip,and extract it to your home directory.
Then add the unzipped location of pyGPlates to the PYTHONPATH environment variable:
Note
The above line can be added to your
~/.bashrc
, ~/.bash_profile
or ~/.zprofile
fileso that PYTHONPATH is set each time you open a new terminal window.Note
If you are using Python 2.7 to run pyBacktrack (instead of Python 3) then install the Python 2.7 version of pyGPlates instead by installing
pygplates_rev28_python27_MacOS64.zip
and adding ~/pygplates_rev28_python27_MacOS64
to your PYTHONPATH
.To install the latest stable version, run:
Warning
On Mac systems, when using Macports, it might be better to install to thelocal user install directory with
python-mpipinstall--userpybacktrack
to avoid confusing Macports(which installs to the system install directory).And on linux systems, if you have admin privileges, you can install to the system install directory with
sudopython-mpipinstallpybacktrack
.Note
We generally recommend using
python-mpipinstallpybacktrack
instead of pipinstallpybacktrack
to ensure pybacktrack
is installedinto the python
you are actually using. For example, when using Conda Python it might be that python
executes the Conda Python interpreterbut pip
installs into the system Python (eg, because the base Conda environment is not activated).If you already have
pybacktrack
installed and would like to upgrade to the latest version then use the --upgrade
flag:To install the latest development version (requires Git on local system), run:
Note
You may need to update your Git if you receive an error ending with
tlsv1alertprotocolversion
.…or download the pyBacktrack source code, extract to a local directory and run:
Note
Installing pyBacktrack will automatically install the NumPy and SciPyrequirements.However, as mentioned in requirements, GMT and pyGPlates still need to be manually installed.
Before running the example below, or any other examples, you’ll also need to install the example data (from the pybacktrack package itself).This assumes you’ve already installed the pybacktrack package.
The following command installs the examples (example data and notebooks) to a new sub-directory of your current working directory called
pybacktrack_examples
:Note
The current working directory is whatever directory you are in when you run the above command.
Note
Alternatively you can choose a different sub-directory by providing an argument to the
install_examples()
function above.For example,
python-c'importpybacktrack;pybacktrack.install_examples('pybacktrack/examples')'
creates a new sub-directory of your current working directory called pybacktrack/examples
.However the example below assumes the default directory (
pybacktrack_examples
).This method of running
pybacktrack
relies on Docker, so before installingthe pybacktrack
docker image, ensure you have installed Docker.![Backtrack 1 3 Backtrack 1 3](https://3.bp.blogspot.com/-NQ1JjKkXTtI/VPws5ZdnQOI/AAAAAAAAAIk/BWSzqHoyuL4/s1600/backtrack.jpg)
Note
On Windows platforms you can install Docker Toolbox orDocker Desktop for Windows.
Docker Desktop for Windows offers the most “native” experience and is recommended by Docker, but hashigher system requirements and once it’s installed you can no longer use VirtualBox (to run other Virtual Machines).
In contrast, Docker Toolbox relies on VirtualBox, so if your system can run VirtualBox thenDocker Toolbox should work on your system.
A similar situation applies on Mac platforms where you can installDocker Toolbox orDocker Desktop for Mac.
Keyboard maestro 8 0 – hot key tasking solution. Once Docker is installed, open a Docker terminal (command-line interface).
Note
For Docker Toolbox this is the Docker Quickstart Terminal.
For Docker Desktop for Windows andDocker Desktop for Mac this a regular command-line terminal.
On Linux systems this a regular command-line terminal.
To install the
pybacktrack
docker image, type:To run the docker image:
This should bring up a command prompt inside the running docker container.
The current working directory should be
/usr/src/pybacktrack/
.It should have a
pybacktrack_examples
sub-directory containing test data.Note
On Linux systems you may have to use sudo when running docker commands. For example:
From the current working directory you can run the backtracking example below,or any other examples in this documentation. For example, you could run:
If you wish to run the example notebooksthen there is a
notebook.sh
script to start a Jupyter notebook server in the running docker container:Then you can start a web browser on your local machine and type the following in the URL field:
This will display the current working directory in the docker container.
In the web browser, navigate to
pybacktrack_examples
and then notebooks
.Then click on a notebook (such as backtrack.ipynb).
You should be able to run the notebook, or modify it and then run it.
Note
If you are running Docker Toolbox on Windows then use the Docker Machine IP instead of
localhost
.To find the IP address use the command
docker-machineip
.Once installed,
pybacktrack
is available to:- run built-in scripts (inside
pybacktrack
), or importpybacktrack
into your own script.
The following example is used to demonstrate both approaches. It backtracks an ocean drill site and saves the output to a text file by:
- reading the ocean drill site file
pybacktrack_examples/test_data/ODP-114-699-Lithology.txt
,NoteHowever if you have your own ocean drill site file then you can substitute it in the example below if you want. - backtracking it using:
- the
M2
dynamic topography model, and - the
Haq87_SealevelCurve_Longterm
sea-level model,
- the
- writing the amended drill site to
ODP-114-699_backtrack_amended.txt
, and - writing the following columns to
ODP-114-699_backtrack_decompat.txt
:- age
- compacted_depth
- compacted_thickness
- decompacted_thickness
- decompacted_density
- decompacted_sediment_rate
- decompacted_depth
- dynamic_topography
- water_depth
- tectonic_subsidence
- lithology
Since there is a
backtrack
module inside pybacktrack
that can be run as a script,we can invoke it on the command-line using python-mpybacktrack.backtrack_cli
followed by command line options that are specific to that module.This is the easiest way to run backtracking.To see its command-line options, run:
Backtrack 1990 Film
The backtracking example can now be demonstrated by running the script as:
An alternative to running a built-in script is to write your own script (using a text editor) that imports
pybacktrack
andcalls its functions. You might do this if you want to combine pyBacktrack functionality with other research functionality into a single script.The following Python code does the same as the built-in script by calling the
pybacktrack.backtrack_and_write_well()
function:Various
If you save the above code to a file called
my_backtrack_script.py
then you can run it as: