- We define a search space over the source parameters and initialize it with a quasi-uniform set of samples generated using a Sobol sequence, which provides an efficient and systematic exploration of high-dimensional parameter spaces with low discrepancy.
- The objective function is evaluated at each sampled point, and the search region is subsequently refined based on the quantile range of the top-value samples.
- This process is implemented iteratively. In each iteration, the search space is progressively narrowed to focus on regions most likely to contain the global optimum.
- The iteration continues until a predefined convergence criterion is met.
- Finally, the sample with the highest objective function value is selected, and the phases associated within an acceptable residual threshold are considered the optimal association for the event.
A dedicated Conda environment is recommended.
conda create -n doublef python=3.9
conda activate doublef
pip install doublefIf you prefer to install from source inside the environment:
conda create -n doublef python=3.9
conda activate doublef
git clone https://github.com/Lonngfei/DoubleF.git
cd DoubleF
pip install .If you plan to run DoubleF on a GPU, make sure that your PyTorch version matches your CUDA version.
Please refer to the official PyTorch installation guide: https://pytorch.org/get-started/previous-versions.
Run the following in Python:
import torch
print(torch.cuda.is_available())True: CUDA is available and PyTorch can use your GPU.False: Check the NVIDIA driver and CUDA-PyTorch compatibility.
doublefThis prints the program name, version, and basic usage information.
Before running DoubleF, make sure the required input files are correctly prepared.
Typical inputs include:
Picks/YYYYMMDD.csv # Daily pick files
TravelTime/mymodel.nd # Velocity model used for travel-time calculation
example.config # Configuration file
The exact directory structure can be adjusted in the configuration file.
DoubleF is controlled through a configuration file such as example.config.
Most parameters do not need frequent modification. In most cases, only a few settings require special attention.
Set cal_tt = True when using a new velocity model.
This is usually required only once to generate the travel-time tables.
After the tables have been generated, set: cal_tt = False, so that the program loads the existing tables and skips recalculation.
In most applications, the default sampling settings are sufficient.
If the nearest-station distance is larger than 0.6°, increasing the number of samples may improve the results.
DoubleF provides several alternative objective functions.
In most cases, the choice among these objective functions does not significantly affect the final results.
Users who are familiar with the method may further customize the scoring strategy if needed.
A custom objective function can be implemented by modifying: weight.py, batch_weight.py in the source code.
Set the output directory and related options according to your needs.
DoubleF automatically writes:
- logs
- configuration records
- phase association results
to the specified output path.
This parameter only affects computational efficiency and does not affect the final results.
In general, a larger value may improve speed, but this is not always the case.
Once the computation reaches saturation, further increasing max_batch_size may provide little or no additional speedup, while leading to higher memory usage.
Visualization is usually recommended to be turned off during normal runs.
It should only be enabled when intermediate inspection, debugging, or result checking is needed.
Once the input files and configuration file are ready, run:
doublef example.configIf the installation and configuration are correct, DoubleF will start processing and write logs and results to the output directory.
A typical output phase file has the following format:
# Year Month Day Hour Minute Second Latitude Longitude Depth Magnitude ErrHorizontal ErrVertical ErrTime RMS NumP NumS NumBoth NumSum ID
NET Station Distance PhaseTime Probability PhaseType Residual ML Mag Amplitude
ErrHorizontal,ErrVertical, andErrTimedo not necessarily represent the true location uncertainty.- These values describe the spatial dispersion of candidate solutions that are associated with the same nearby location. Specifically, they quantify the statistical deviation (e.g., mean or standard deviation) of these candidate locations relative to the final solution.
- If only a single candidate solution exists, the dispersion cannot be computed and the value is reported as NaN.
- When these values are unusually large or reported as NaN, the corresponding results should be interpreted with caution.
