Skip to main content

MAGMA Volcanic Activity Report (VAR)

Project description

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__)
success, token, expired_at = auth.load_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
success, token, expired_at = auth.load_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
    overwrite=True, # Overwrite existsing 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,
)

Changelog

[0.0.10] 2025-07-22

Expecting breaking changes from previous version.

Added

  • Added english translation in resources.py for earthquakes type.
  • Added debug property for developing purposes.

Fixed

  • Increase performance by caching some results.
  • Fix inconsistent output directory.
  • Fix felt earthquake not detected.

Changed

  • load_token() method will unpack 3 variables, success (bool), token (str), expired_date (str) instead of two variables success (bool) and token (str).
  • Code reformatting using black.

Project details


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.0.10.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magma_var-0.0.10-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file magma_var-0.0.10.tar.gz.

File metadata

  • Download URL: magma_var-0.0.10.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for magma_var-0.0.10.tar.gz
Algorithm Hash digest
SHA256 74b59ea91dd99fbd74eb304a5c3574ed088b049ad5d10144e77c0035b6a11b2d
MD5 20f4c0f6e6c751e8f860ded88033d9e7
BLAKE2b-256 58e4a6c5b31be1d6facb4daafe2cd624bcb26fa6a9ed05af934e89908a55a762

See more details on using hashes here.

File details

Details for the file magma_var-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: magma_var-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for magma_var-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9a9bdae50d8fc7d99149c75ae3bf02974712c34525bd10533a2a260bff40f1e2
MD5 dec522e013e5ecf9f74b71222a5d759d
BLAKE2b-256 0e71a064d04dace7d2896b61549cd1df04bce74e6e73c2bfdcb81d6b9558daa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page