GithubHelp home page GithubHelp logo

licsalert's Introduction

Introduction

LiCSAlert is an algorithm to detect changes in the signals at sub-aerial volcanoes that are imaged by the Sentinel-1 satellites. The algorithm is detailed fully in Gaddes et al., 2019 but, briefly:

  • The time series is divided into baseline interferograms and monitoring interferograms (e.g. the first third of a time series and the remainder).
  • The ICASAR algorithm is run on the baseline interferograms to find a set of spatially independent sources that are thought to represent the latent deformation and atmosphere signals present at a volcano.
  • The temporal behaviour of these signals is calculated through performing a simple inversion to fit each baseline interferogram with them.
  • During monitoring, the same inversion is performed to fit new interferograms.
    • If the way in which the spatial sources is used changes significantly, the volcano is flagged as having entered a period of unrest (e.g. acceleration of uplift).
    • If the ability of the spatial sources to fit the interferograms (i.e. the residual) changes significantly, the the volcano is flagged as having entered a period of unrest (e.g. a previously unseen deformation signal appears).

The figure below shows the results when the algorithm is applied to a time series of Sentinel-1 data that images Sierra Negra volcano (Galapagos Archipelago) before the 2018 eruption. Note that the caldera floor uplift is capture in the first component, and its acceleration flagged (the red bars). Additionally, the residual (lowest plot) increases before the eruption, suggesting the spatial pattern of the deformation has changed slightly.

sierra_negra_resized

Installation

A suitable python environment can be created using the conda command:
conda env create --file LiCSAlert.yml

The ICASAR package will also be needed, and the ICASAR_path argument updating to point to it.

Batch mode usage

Batch mode usage is simpler than monitoring mode as it does not automatically updated the time series using LiCSBAS when new LiCSAlert products are available. Simply prepare unwrapped incremental interferograms in your software of choice, mask pixels that you do not wish to include (e.g. water bodies, incoherent areas etc.), and flatten each interferogram to a 1D vector that only contains values for the unmasked pixels.

There are three groups of inputs:

  1. ICASAR_path | the path to a local copy of ICASAR

  2. LiCSAlert_settings

    • n_baseline_end | The number of interferograms to use in the baseline stage. E.g. 30, to use the first 30, and any remaining will be used for monitoring.
    • out_folder | Where to store the outputs of LiCSAlert
    • run_ICSAR | True or False. If it has been run before, setting this to False will try to load the previous results.
    • intermediate_figures | If True, a figure is made for each time step, but if False, a single figure is made for the whole time series. Intermediate figures can be useful for making .gif animations. See the example for the differences in the outputs (and runtime!).
    • downsample_run | Downsampling the data can speed up runs.
    • downsample_plot | Downsampling the data for plotting can speed up making figures. Note that this is applied after the downsample_run command, so is compound (i.e. 0.5 for downsample_run and 0.5 for downsample_plot produces a final downsampling of 0.25 for the plotted signals).
  3. ICASAR_settings

Monitoring mode usage

It uses LiCSBAS to create time series, which in turn uses the interefrograms that are automatically created by LiCSAR. A simple example is outside the scope of this repository.

licsalert's People

Contributors

matthew-gaddes avatar cemacrr avatar

Stargazers

ZGH avatar young avatar  avatar Tobias Augspurger avatar Yuehao Zhang avatar Liao Spacefan avatar  avatar Mohammed W. Al-Zaidy  avatar Antonio Valentino avatar Gauhar avatar nat avatar  avatar ys avatar  avatar  avatar Hans avatar  avatar Yu Morishita avatar

Watchers

 avatar

licsalert's Issues

LICSBAS output example

Hi Mathew,

I think my test example is not working. I used LICSBAS output but I don't know why there is an error in the output
I used your example to get output. Your example dataset works without any problem. I really appreciate it if you can help me regarding this issue. the same issue has happened with ICASAR example_spatial_02.py with a new dataset from LICSBAS!

best,
Mohammad

the code is


import sys
import pickle
from pathlib import Path
import copy
import numpy as np

sys.path.append("./lib")
from LiCSAlert_functions import LiCSAlert_batch_mode
LiCSBAS_out_folder_campi_flegrei = Path('./010D_11455_131313')
sys.path.append(str(ICASAR_path))                                                                       # Add ICASAR to the path so we can use one of its functions.  
from ICASAR_functions import LiCSBAS_to_ICASAR                                                          # which is for importing time series processed by LiCSBAS.  

LiCSAlert_settings = {"n_baseline_end" : 55,                                         # n_ifgs that are used in the baseline stage (i.e. by ICASAR)
                      "out_folder" : "LiCSAlert_03_Campi_Flegrei",    # no spaces, snake or camel case
                      "run_ICASAR" : True,                                           # If False, attempt to load results from previous run.  If True, run (which can be slow)
                      "intermediate_figures" :True,                                # if set to True, a figure is produced for all time steps in the monitoring data, which can be time consuming.  
                      "downsample_run" : 1.,                                        # data can be downsampled to speed things up
                      "downsample_plot" : 0.5}                                       # and a 2nd time for fast plotting.  Note this is applied to the restuls of the first downsampling, so is compound


ICASAR_settings = {"n_comp" : 5,                                         # number of components to recover with ICA (ie the number of PCA sources to keep)
                   "bootstrapping_param" : (200, 0),                    # (number of runs with bootstrapping, number of runs without bootstrapping)                    "hdbscan_param" : (35, 10),                        # (min_cluster_size, min_samples)
                   "tsne_param" : (30, 12),                             # (perplexity, early_exaggeration)
                   "ica_param" : (1e-2, 150),                           # (tolerance, max iterations)
                   "hdbscan_param" : (100,10),                           # (min_cluster_size, min_samples) Discussed in more detail in Mcinnes et al. (2017). min_cluster_size sets the smallest collection of points that can be considered a cluster. min_samples sets how conservative the clustering is. With larger values, more points will be considered noise. 
                   "create_all_ifgs_flag" : True,                       # small signals are hard for ICA to extact from time series, so make it easier by creating all possible long temporal baseline ifgs from the incremental data.  
                   "load_fastICA_results" : False,                      # If all the FastICA runs already exisit, setting this to True speeds up ICASAR as they don't need to be recomputed.  
                   "figures" : "png+window"}                            # if png, saved in a folder as .png.  If window, open as interactive matplotlib figures,


displacement_r2, tbaseline_info = LiCSBAS_to_ICASAR(LiCSBAS_out_folder_campi_flegrei,filtered=True, figures=True,return_r3=True)        # open various LiCSBAS products, spatial ones in displacement_r2, temporal ones in tbaseline_info
displacement_r2['ifg_dates'] = tbaseline_info['ifg_dates']                                                  # Unlike ICASAR, LiCSAlert always needs the ifg_dates too.  

LiCSAlert_batch_mode(displacement_r2, ICASAR_settings = ICASAR_settings, **LiCSAlert_settings, ICASAR_path = ICASAR_path)


The output


QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-maref'
Traceback (most recent call last):
  File "./LiCSAlert_batch_mode_examples.py", line 106, in <module>
    displacement_r2, tbaseline_info = LiCSBAS_to_ICASAR(LiCSBAS_out_folder_campi_flegrei,filtered=True, figures=True,return_r3=True)        # open various LiCSBAS products, spatial ones in displacement_r2, temporal ones in tbaseline_info
  File "/raid-manaslu/maref/Software/ICASAR/lib/ICASAR_functions.py", line 581, in LiCSBAS_to_ICASAR
    displacement_r2['incremental'], _ = rank3_ma_to_rank2(displacement_r3['incremental'])                          # also convert incremental, no need to also get mask as should be same as above
  File "/raid-manaslu/maref/Software/ICASAR/lib/ICASAR_functions.py", line 432, in rank3_ma_to_rank2
    ifgs_r3_consistent = ma.array(ifgs_r3, mask = ma.repeat(mask_coh_water_consistent[np.newaxis,], n_ifgs, axis = 0))                       # mask with the new consistent mask
  File "/raid-manaslu/maref/Software/anaconda3/envs/myisceenv/lib/python3.8/site-packages/numpy/ma/core.py", line 6559, in array
    return MaskedArray(data, mask=mask, dtype=dtype, copy=copy,
  File "/raid-manaslu/maref/Software/anaconda3/envs/myisceenv/lib/python3.8/site-packages/numpy/ma/core.py", line 2909, in __new__
    raise MaskError(msg % (nd, nm))
numpy.ma.core.MaskError: Mask and data not compatible: data size is 2788668, mask si
```ze is 108.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.