magma-var
Python package for MAGMA Volcanic Activity Report (VAR)
1. How to use
Make sure you have MAGMA token. Check examples directory.
Volcano name and code:
| Volcano | Code |
|---|---|
| Agung | AGU |
| Ambang | AMB |
| Anak Krakatau | KRA |
| Anak Ranakah | RAN |
| Arjuno Welirang | WEL |
| Awu | AWU |
| Banda Api | BAN |
| Batur | BAT |
| Batutara | TAR |
| Bromo | BRO |
| Bur Ni Telong | TEL |
| Ciremai | CER |
| Colo | COL |
| Dempo | DEM |
| Dieng | DIE |
| Dukono | DUK |
| Ebulobo | EBU |
| Egon | EGO |
| Galunggung | GAL |
| Gamalama | GML |
| Gamkonora | GMK |
| Gede | GED |
| Guntur | GUN |
| Ibu | IBU |
| Ijen | IJE |
| Ile Werung | WER |
| Ili Boleng | BOL |
| Ili Lewotolok | LEW |
| Inielika | LIK |
| Inierie | RIE |
| Iya | IYA |
| Kaba | KAB |
| Karangetang | KAR |
| Kelimutu | KLM |
| Kelud | KLD |
| Kerinci | KER |
| Kie Besi | KIE |
| Lamongan | LAM |
| Lereboleng | LER |
| Lewotobi Laki-laki | LWK |
| Lewotobi Perempuan | LWP |
| Lokon | LOK |
| Mahawu | MAH |
| Marapi | MAR |
| Merapi | MER |
| Papandayan | PAP |
| Peut Sague | PEU |
| Raung | RAU |
| Rinjani | RIN |
| Rokatenda | ROK |
| Ruang | RUA |
| Salak | SAL |
| Sangeangapi | SAN |
| Semeru | SMR |
| Seulawah Agam | SEU |
| Sinabung | SIN |
| Sirung | SIR |
| Slamet | SLA |
| Soputan | SOP |
| Sorikmarapi | SOR |
| Sumbing | SBG |
| Sundoro | SUN |
| Talang | TAL |
| Tambora | TAM |
| Tandikat | TAN |
| Tangkoko | TGK |
| Tangkuban Parahu | TPR |
| Teon | TEO |
| Wurlali | WUR |
1.1 Install module
pip install magma-var
Check your version:
print(magma_var.__version__)
1.2 Download Volcanic Activity Report (VAR)
To download Volcanic Activity Report (VAR):
import magma_var
from magma_auth import auth
from magma_var import Download
print(magma_var.__version__)
token = auth.token # or replace with your own token
download = Download(
token=token,
volcano_code='LOK',
start_date='2025-01-01',
end_date='2025-06-08',
locale="id", # [testing] Change to "en" for english translation
current_dir='D:\\Projects\\magma-var', # Change your current directory. Default to None.
verbose=True,
)
download.var()
download.to_excel()
download.to_csv()
1.3 Plot VAR
Plot seismicity count:
Earthquake name and code:
| Jenis Gempa | Earthquake (EN) | Code |
|---|---|---|
| Semua Gempa | Select all earthquake | * |
| Letusan | Eruption | lts |
| Awan Panas Letusan | Fountain Collapse Pyroclastic Flow | apl |
| Awan Panas Guguran | Pyroclastic Density Current (PDC) | apg |
| Guguran | Rockfall | gug |
| Hembusan | Degassing | hbs |
| Harmonik | Harmonic | hrm |
| Tremor Non-Harmonik | Non-Harmonic Tremor | tre |
| Tornillo | Tornillo | tor |
| Low Frequency | Low Frequency | lof |
| Hybrid/Fase Banyak | Hybrid/Multi Phase | hyb |
| Vulkanik Dangkal | Shallow Volcanic-Tectonic (VT-B) | vtb |
| Vulkanik Dalam | Deep Volcanic-Tectonic (VT-A) | vta |
| Very Long Period | Very Long Period | vlp |
| Tektonik Lokal | Local Tectonic | tel |
| Terasa | Felt Earthquake | trs |
| Tektonik Jauh | Teleseismic | tej |
| Double Event | Double Event | dev |
| Getaran Banjir | Lahar | gtb |
| Deep Tremor | Deep Tremor | dpt |
| Tremor Menerus | Tremor | mtr |
from magma_auth import auth
from magma_var import Plot
token = auth.token or replace with your own token
plot = Plot(
token = token,
volcano_code = 'LOK',
start_date = '2025-01-01',
end_date = '2025-03-13',
earthquake_code = '*', # Check table above for earthquake code
locale = 'en', # change to "id" for Indonesia. Default to "id"
overwrite=True, # Overwrite existing downloaded file
verbose=True, # Show detailed information
)
Print DataFrame:
plot.df
Show plot:
plot.show(
interval=7, # 7 days. X-axis interval in days.
width=1.0, # Size bar width
title='Lokon', # Plot title
figsize=(10,1),
title_fontsize=12,
figure_ylabel_fontsize=9,
x_labelsize=8,
y_labelsize=8,
legend_fontsize=6,
color='black', # remove or change to None to use default color
)
Changelog
[0.1.1] 2025-09-04
Bug fix.
Added
- Update jupyter notebook example.
Fixed
- Fix readme.
- Fix color options.
Changed
- Code reformatting using
black.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
magma_var-0.1.3.tar.gz
(16.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
magma_var-0.1.3-py3-none-any.whl
(17.1 kB
view details)
File details
Details for the file magma_var-0.1.3.tar.gz.
File metadata
- Download URL: magma_var-0.1.3.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
796bc56ac666f8304b21b6de4fa4bc2c53050cac2465022462855e64ae799143
|
|
| MD5 |
8d4f4b284930de57e1db2cb30d726875
|
|
| BLAKE2b-256 |
786d9117a0aa9a54df440e00508f660650b049e44b112c79901328f818fdd965
|
File details
Details for the file magma_var-0.1.3-py3-none-any.whl.
File metadata
- Download URL: magma_var-0.1.3-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3c36d079f581f421e75a9a28cd844e3cd415c1a4186201383e8eaa9f9deeff1
|
|
| MD5 |
4266c80c85e58f017894e2cdb2dac550
|
|
| BLAKE2b-256 |
1e5323c69f1af0a52e9040a59a4779ceba08d8ee845d271cb1816f0160bf7f72
|