Spicks, an abbreviation for Station Picks is an action plan project for Global Seismology Observation Course (Seminar Course Participant) developed by Akhadi-san and Jambari-san.
Spicks is a Django application designed for seismic data processing and visualization. It integrates PyGMT and ObsPy to analyze seismic events, station data, and phase picks, and generates visualizations such as station maps, residual plots, and histograms.
Before you begin, ensure you have the following installed:
- Miniconda or Anaconda: Download and install from here.
- Git: Download and install from here.
Clone the repository to your local machine:
git clone https://github.com/jambari/Spicks.git
cd Spicks
Create the Conda Environment:
Use the provided environment.yml
file to create the django_pygmt
environment:
conda env create -f environment.yml
If you don’t have an environment.yml
file, create one with the following content:
name: django_pygmt
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- django
- pygmt
- obspy
- pip
Activate the Environment: After the environment is created, activate it:
conda activate django_pygmt
If there are additional Python dependencies not included in the environment.yml
file, install them using pip
:
pip install -r requirements.txt
Migrate the Database: Run the following commands to apply database migrations:
python manage.py migrate
Create a Superuser (Optional): If you need access to the Django admin panel, create a superuser:
python manage.py createsuperuser
Load Initial Data: Run fixtures for the initial data to load, use the following command: We will import stations data from IA Network BMKG
python manage.py loaddata slmon.all.laststatus.json
Start the Django development server:
python manage.py runserver
Visit http://127.0.0.1:8000/ in your browser to view the application.
The project is already set up to use PyGMT and ObsPy. You can import these libraries in your Django views, models, or scripts:
Here’s an overview of the project structure:
focal_mechanism/
├── manage.py
├── seismic/ # Django app
│ ├── migrations/
│ ├── static/
│ ├── templates/
│ ├── admin.py
│ ├── models.py
│ ├── views.py
│ └── urls.py
├── focal_mechanism/ # Django project settings
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── static/ # Static files
│ └── images/ # Generated images
│ ├── station_locs/ # Station location maps
│ ├── distancebins/ # Distance bins plots
│ ├── distresid/ # Distance residuals plots
│ ├── logathist/ # Log amplitude histograms
│ ├── monthlypics/ # Monthly event pictures
│ ├── P.timehist/ # P-wave time histograms
│ ├── S.timehist/ # S-wave time histograms
│ ├── residmap/ # Residual maps
│ └── residualazimuth/ # Residual azimuth plots
├── requirements.txt # Python dependencies
├── environment.yml # Conda environment setup
└── README.md # Project documentation
For deployment, follow the official Django deployment guide: Django Deployment Checklist.
- If the environment fails to create, ensure you have the correct channels (
conda-forge
anddefaults
) in yourenvironment.yml
. - Update Conda and try again:
conda update conda
- PyGMT requires GMT to be installed. Ensure it is installed correctly by running:
pygmt.show_versions()
- If GMT is missing, install it using:
conda install -c conda-forge gmt
- Ensure all migrations are applied and there are no database conflicts.
- Check the logs for errors and resolve them.
If you’d like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push to the branch.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.
For any questions or issues, please contact Muhammad Akhadi at muhammad.akhadi@bmkg.go.id, jambari at jambari@bmkg.go.id