Skip to content

Commit

Permalink
Lightly tested version that uses LiCSAlert_monitoring_mode() for
Browse files Browse the repository at this point in the history
everything.
Two Campi Flegrei examples.
New .yml to control versions of packages.
  • Loading branch information
matthew-gaddes committed Apr 5, 2023
1 parent c1a0172 commit 478acb3
Show file tree
Hide file tree
Showing 1,917 changed files with 2,436 additions and 41,576 deletions.
15 changes: 7 additions & 8 deletions LiCSAlert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ channels:

dependencies:
- python=3.9 # general
- matplotlib #
- numpy
- matplotlib=3.6 #
- numpy=1.23
- spyder # interactive plotting of ICASAR is designed to work with Spyder

- scikit-image # for LiCSAlert

- hdbscan # for ICASAR
- scikit-learn
- simplekml
- geopy
- hdbscan=0.8 # for ICASAR
- scikit-learn=1.2
- scikit-image=0.19 # for LiCSAlert
- simplekml=1.3
- geopy=2.3

- astropy # For LiCSBAS - not always needed.
- beautifulsoup4
Expand Down
54 changes: 28 additions & 26 deletions LiCSAlert_batch_mode_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,49 @@
import licsalert
from licsalert.monitoring_functions import LiCSAlert_monitoring_mode

#ICASAR_path = Path("/home/matthew/university_work/15_my_software_releases/ICASAR-2.13/") # location of ICASAR functions
ICASAR_path = Path("/home/matthew/university_work/crucial_1000gb/01_blind_signal_separation_python/13_ICASAR/ICASAR_GitHub/") # development version
ICASAR_pkg_dir = Path("/home/matthew/crucial_1000gb/university_work/15_my_software_releases/ICASAR-2.13/") # location of ICASAR functions
#ICASAR_pkg_dir = Path("/home/matthew/university_work/crucial_1000gb/01_blind_signal_separation_python/13_ICASAR/ICASAR_GitHub/") # development version

LiCSAlert_pkg_dir = Path("/home/matthew/university_work/crucial_1000gb/03_automatic_detection_algorithm/06_LiCSAlert/00_LiCSAlert_GitHub") # path to LiCSAlert. Could also be this directory.

#%% Settings

#%%

licsalert_settings = {"baseline_end" : "20170101", # end baseline stage at YYYYMMDD, need to be before the last acquisition of LiCSAlert will never monitoring anyhting.
"figure_intermediate" : False, # if set to True, a figure is produced for all time steps in the monitoring data, which can be time consuming.
"figure_type" : 'both', # either 'window' or 'png' (to save as pngs), or 'both'
"downsample_run" : 0.5, # 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
"residual_type" : 'cumulative'} # controls the type of residual used in the lower plot. Either cumulative or window


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.
"ifgs_format" : 'cum'} # can be 'all', 'inc' (incremental - short temporal baselines), or 'cum' (cumulative - relative to first acquisition)

licsalert_settings = {"baseline_end" : "20170101", # end baseline stage at YYYYMMDD
"out_folder" : Path("LiCSAlert_campi_flegrei"), # pathlib Path
"figure_intermediate" : False, # if set to True, a figure is produced for all time steps in the monitoring data, which can be time consuming.
"figure_type" : 'png', # either 'window' or 'png' (to save as pngs)
"downsample_run" : 0.5, # 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
"residual_type" : 'cumulative'} # controls the type of residual used in the lower plot. Either cumulative or window


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.
"ifgs_format" : 'cum'}
#"load_fastICA_results" : True} # If all the FastICA runs already exisit, setting this to True speeds up ICASAR as they don't need to be recomputed.
licsalert_dir = Path("./") # outdir parent
volcano = 'campi_flegrei_example' # outdir final
licsbas_dir = Path("./022D_04826_121209") # input data


LiCSAlert_monitoring_mode(region = None, volcano = volcano, LiCSAlert_pkg_dir = LiCSAlert_pkg_dir, ICASAR_pkg_dir = ICASAR_pkg_dir,
licsbas_dir = licsbas_dir, licsalert_dir = licsalert_dir,
licsalert_settings = licsalert_settings, icasar_settings = icasar_settings)



region = None # optional
volcano = 'campi_flegrei_example' # name of outdir
LiCSAlert_pkg_dir = Path("/home/matthew/university_work/crucial_1000gb/03_automatic_detection_algorithm/06_LiCSAlert/00_LiCSAlert_GitHub")
ICASAR_pkg_dir = ICASAR_path
#%% We can also make the LiCSAlert figure for all times, but this is slow

licsalert_settings['figure_intermediate'] = True # Turn on figures for all times
licsalert_settings['figure_type'] = 'png' # There will be too many figure windows if this is 'window' or 'both' !

licsbas_dir = Path("/home/matthew/university_work/crucial_1000gb/03_automatic_detection_algorithm/06_LiCSAlert/00_LiCSAlert_GitHub/022D_04826_121209")
licsalert_dir = Path("/home/matthew/university_work/crucial_1000gb/03_automatic_detection_algorithm/06_LiCSAlert/00_LiCSAlert_GitHub/")
volcano = 'campi_flegrei_example_all_times' # new outdir

LiCSAlert_monitoring_mode(region = region, volcano = volcano, LiCSAlert_pkg_dir = LiCSAlert_pkg_dir, ICASAR_pkg_dir = ICASAR_pkg_dir,
LiCSAlert_monitoring_mode(region = None, volcano = volcano, LiCSAlert_pkg_dir = LiCSAlert_pkg_dir, ICASAR_pkg_dir = ICASAR_pkg_dir,
licsbas_dir = licsbas_dir, licsalert_dir = licsalert_dir,
licsalert_settings = licsalert_settings, icasar_settings = icasar_settings)


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified campi_flegrei_example/20210912/licsalert_results.pkl
Binary file not shown.
2 changes: 2 additions & 0 deletions campi_flegrei_example/20210912/volcano_status.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.06477005990551767
2.8163270865607837
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified campi_flegrei_example/ICASAR_results/03_ICA_sources_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified campi_flegrei_example/ICASAR_results/FastICA_results.pkl
Binary file not shown.
Binary file modified campi_flegrei_example/ICASAR_results/ICASAR_results.pkl
Binary file not shown.
Binary file modified campi_flegrei_example/ICASAR_results/ICs.kmz
Binary file not shown.
Loading

0 comments on commit 478acb3

Please sign in to comment.