## 2024

#### Understanding the metropolis-hastings algorithm: a step-by-step guide with python examples

The Metropolis-Hastings algorithm is a cornerstone of Markov Chain Monte Carlo (MCMC) methods, enabling us to generate samples from complex probability distr...

#### Mastering large data processing with mpi4py in python

Explore the power of mpi4py for simplifying data distribution in parallel computing with its efficient broadcast functionality, which seamlessly sends data f...

#### How to relocate your anaconda or miniconda installation on linux

Navigating the complexities of relocating your Anaconda or Miniconda installation on a Linux system can be daunting. This concise guide provides a step-by-st...

## 2023

#### Exploring the multi-taper method: a robust approach for time-frequency analysis

Explore the Multi-Taper Method’s unique ability to refine spectral estimates in seismology. Leveraging multiple orthogonal tapers, this approach minimizes va...

#### How to plot great circle path through your region using pygmt

In this article, we will learn how to visualize the great circle paths that traverse a designated region of interest using PyGMT. Understanding these paths i...

#### What is pink noise and how is it different from white noise?

Pink noise, also known as 1/f noise or flicker noise, is a type of random signal that has equal energy per octave. It is called pink because it is analogous ...

#### How to read a scientific research paper using a large language model?

Python script to read a PDF document, and perform question-answering on the document, and to generate an output based on the provided query

#### Object oriented programming (oop) with examples in python

This post explains the concepts of object-oriented programming (OOP) and its key features, including encapsulation, abstraction, inheritance, and polymorphis...

#### Using mpi4py for parallel computing in python on supercomputers

The article discusses the mpi4py module, which is a Python wrapper for MPI, used for parallel computing in supercomputing environments. It provides higher-le...

## 2022

#### How to plot the boundaries of the states on the basemap of the usa

We will plot the boundaries of the states of the USA on a basemap figure

#### How to set up ssh-keys for github

You will learn how to generate and set up an SSH key for github so that you don’t need to always type your username and password when accessing github repo.

#### How to load dynamic libraries in c/c++?

We will see how to load shared libraries in C/C++. We will write a library to convert km to degrees and vice-versa. Then we create a utility program to conve...

#### Read yaml input file in bash, c/c++ and python

We will see how to read a YAML file in Bash, C/C++ and Python.

Using multiple threads in C for concurrent process flow

#### What are linked lists in data structures?

We look into a quick overview of the idea of linked list data structure with some examples.

#### Numerical optimization based on the l-bfgs method

We will inspect the L-BFGS optimization method using one example and compare its performance with the gradient descent method

#### Create beamer slides using python

We will use the Python package to create beamer presentation and append existing figures to each slide

#### A quick overview on geospatial data visualization using pygmt

We will see how to plot a topographic map, overlay earthquake data on topographic maps, plot focal mechanism solutions and plot tomographic results on a geog...

## 2021

#### How to deal with irregularly sampled time series data

While analyzing time series data, we often come across data that is non-uniformly sampled, i.e., they have non-equidistant time-steps. Infact, most of the re...

#### The easiest way to publish a python package on pypi using poetry

We will learn how to use the poetry package to create, manage, build and publish Python package on PyPI

#### How to plot earthquakes data on a three-dimensional topographic map

Read the earthquake data from a data file and overlay on a three-dimensional topographic map using PyGMT.

#### Encrypt your data and software with python

Learn to encrypt and decrypt any files, data or software with python

#### Perform distributed computing easily using ray in python

We will introduce the concepts of distributed computing and then use the open-source Python library Ray to write scalable codes that can work on distributed ...

#### Convolution of waveforms using python compared to matlab

We will see compare the convolution functions in Python (Numpy) with the conv function in MATLAB. If you have tried them both then you would know that its no...

#### Read and write text files in modern fortran

We will read and write text and numeric data into a file using modern fortran.

#### Convert any text to lifelike speech using amazon polly

We will see how we can use amazon web services, specifically amazon polly to convert any text into a speech

#### How to install jekyll on apple m1 macbook

If you have recently bought a M1 mac and have been doing blogging using Jekyll, then you must have experienced that installing Jekyll on the M1 architecture ...

#### How to create a simple makefile in linux

We learn how to write a Makefile to automate the compilation of our source code. We will use one example from Fortran.

#### Maximum likelihood estimation for the regression parameters

We will learn the basics of the maximum likelihood method, and then apply it on a regression problem. We will also compare it with the least-squares estimati...

#### Solving boundary value problems using the shooting method

The boundary value problems require information at the present time and a future time. We will see how we can use shooting method to solve problems where we ...

#### Efficiently compute spectrogram for large dataset in python

Librosa can efficiently compute the spectrogram for large time series data in seconds. We will use that to plot the spectrogram using matplotlib

#### How to overlay shapefile data on pygmt maps

We learn how to plot selected shapefile data using geopandas on top of PyGMT maps

#### Numerically solving initial value problems using the runge-kutta method

Runge-Kutta methods are most popular method to solve ordinary differential equations (ODEs) with a better approximation than the Euler method. We compare the...

#### Numerically solving initial value problems using the euler method

The simplest algorithm to solve a system of differential equations is the Euler method. We understand the Euler method by looking into a simple heat transfer...

#### How to plot shear-wave splitting measurements using pygmt

How you can plot the shear-wave splitting measurements from splitting database using PyGMT.

How can you link unsplash images directly to your blog without hosting it locally.

#### How to extract station data from the web page

Uses pandas to read the html page and extract the html data into pandas dataframe

#### How to plot the earthquakes data on a topographic map

Read the earthquake data from a csv file and overlay on a topographic map using PyGMT.

#### How to automatically enquire the availability of seismic data using obspy

In this post, we will see how can we retrive the available seismic waveforms information for a given network, station, channel and client in a given period o...

#### How to implement the iterative newton–raphson method to find roots of a function in python

The Newton–Raphson method (commonly known as Newton’s method) is developed for finding roots of a given function or polynomial iteratively. We show two examp...

#### How to host a http server on your linux computer to share files

Is the signal denoising using a wavelet effective? We will implement the wavelet-based signal denoising using the MATLAB

#### How effective is the signal denoising using the matlab based wavelet analysis

We see how to download seismic waveforms, convert them into mat format from mini-seed and then perform denoising using wavelet analysis. We first performed w...

#### Make your python script executable from anywhere in linux

Follow the instructions to make your python script executable from anywhere in Linux system.

#### How to securely send data from local client to remote server using paramiko (codes included)

Paramiko module can be used in Python to securely send data from the local client to the remote server. It is analogous to the SSH and SCP in Linux.

#### Towards multi-resolution analysis with wavelet transform

We will learn the basic concepts of wavelet tranform and multi-resolution analysis starting from the Fourier Transform, and Gabor Transform.

#### Empirical orthogonal function analysis to inspect the spatial coherency in the geospatial data (codes included)

Empirical Orthogonal Functions analysis decomposes the continuous space-time field into a set of orthogonal spatial patterns along with a set of associated u...

#### Concatenating daily seismic traces into one miniseed file (codes included)

I concatenate the daily seismic traces for 15 days into one miniseed file for further analysis. Then I obtained the spectrogram of the 15 days seismic data. ...

#### Computing cross-correlation and spectrogram of two seismic traces (codes included)

Read the seismic traces from the miniseed files and compute the cross-correlation and spectrogram

#### Principal component analysis to decompose signals and reduce dimensionality (codes included)

We will learn the basics of Fourier analysis and implement it to remove noise from the synthetic and real signals

#### Signal denoising using fourier analysis in python (codes included)

We will learn the basics of Fourier analysis and implement it to remove noise from the synthetic and real signals

#### Analyzing miniseed seismic data in matlab (codes included)

We will learn how to convert a mseed data file into mat format and then read and analyze it using MATLAB

#### Transfer learning applied on the unsplash data using alexnet pretrained network (codes included)

Transfer learning using the pre-trained deep learning networks from MATLAB can be easily implemented to achieve fast and impressive results

#### Getting familiar with pytorch data structures (codes included)

In this introduction to the concepts of Pytorch data structures, we will learn about how to create and reshape tensors using Pytorch and compare it with the ...

#### How to analyze a huge data file with pandas (codes included)

We learn how to read huge csv file containing time series data by breaking it into chunks and then visualizing it with matplotlib

#### Pyqt5 application for visualizing ambient sound in real-time (codes included)

A PyQt5 application for retrieving and visualizing sound waveforms in real time. Codes included.

#### How to start using pandas immediately for earth data analysis (codes included)

This tutorial gives a brief description of scientific computing using Pandas by introducing Series, DataFrame, Pandas common operations, methods, conditional...

#### Introduction to numpy for scientific computing

This tutorial gives a brief description of scientific computing using numpy by introducing arrays, methods, attributes, random numbers, indexing, broadcastin...

#### A quick look into the sktime for time-series forecasting (codes included)

I used the sktime library to forecast the airline data using NaiveForecaster, KNeighborsRegressor, Statistical forecasters, and auto ARIMA model.

#### Three-dimensional perspective map of taiwan using gmt and pygmt (codes included)

We learn how to make the three-dimensional map using both GMT and PyGMT

#### Wavelet analysis applied to the real dataset in a quick and easy way (codes included)

An introduction to the wavelet analysis for a real geophysical data set. I compared the analysis to the Fourier analysis. Codes included!

#### High-quality maps using the modern interface to the generic mapping tools (codes included)

GMT or generic mapping tools have become synonymous with plotting maps in Earth, Ocean, and Planetary sciences. It can be used for processing data, generatin...

#### The right way to loop in python (codes included)

What is the fastest and most efficient way to loop in Python. We found that the numpy is fastest and python builtins are the most memory efficient.

#### Genetic algorithm: a highly robust inversion scheme for geophysical applications (codes included)

An introduction to the basics of genetic algorithm along with a simple numerical example and solution of an earthquake location problem

#### Easily integrate custom functions in matlab with python (codes included)

How can we use the MATLAB functions in Python? MATLAB implementation are usually reliable as it is developed by the professionals. But the advantages of usin...

#### The easy way to compute and visualize the time & frequency domain correlation (codes included)

In geophysics, it is important to understand and identify the complex and unknown relationships between two time-series. Cross-correlation is an established ...

#### Monte carlo methods and earthquake location problem (codes included)

The common geophysical problems most often have multimodal objective function with many possible minima. In this post, we will look into the Monte Carlo meth...

#### Plotting a record section using obspy (codes included)

Quickly plot record section of a stream using Obspy. I will introduce you how to make a stream from a set of SAC data, plot the record section and store it a...

#### Writing and formatting a scientific manuscript in microsoft word

less than 1 minute read      UTILITIES

If you are ready to use the Microsoft Word as your favourite tool for writing your awesome scientific thoughts and ideas into a manuscript, then I would like...

#### A simple system monitor app in python (codes included)

less than 1 minute read      DESKTOPAPPS

A simple Python app for system CPU and RAM usage monitoring in real time. The app is build mainly using the PyQt5, pyqtgraph and psutil.

#### Build a flask web application: sea level rise monitoring (codes included)

This post gives a quick introduction on how to build a web application using Flask and deploy on Heroku server. Then, I share my codes for building advanced ...

#### Write ascii data to mseed file using obspy (codes included)

In this post, I will read a ASCII file whose first few lines contains the header information and then the three-component data. I will read using the pandas ...

#### Least-squares method in geosciences (codes included)

Least-squares method is a popular approach in geophysical inversion to estimate the parameters of a postulated Earth model from given observations. This meth...

#### Speed-up your codes by parallel computing in python (codes included)

Parallel computing is quickly becoming a necessity. Modern computers comes with more than one process and we most often only use single process to do most of...

#### Advanced 2d plots with matplotlib in python (codes included)

Codes for plotting advanced 2D plots using matplotlib library in Python. Includes simple 2D plot, error bars, bar graphs, histograms, multiple plots, etc

## 2020

#### Time-frequency analysis in matlab (codes included)

A signal has one or more frequency components in it and can be viewed from two different standpoints: time-domain and frequency domain. In general, signals a...

#### Hypothesis test for the significance of linear trend using the monte carlo simulations (codes included)

We pose a null hypothesis and enquire that given that the null hypothesis is true, how likely is the observed pattern of results? This likelihood is known as...

#### How to avoid common mistakes in analyzing correlations of two time-series

Most often data analyst consider correlation between two time-series as a causation effect. Two time-series are correlated that does not imply that one cause...

#### Estimation of the degrees of freedom for time series (codes included)

Numerical tests to understand the degrees of freedom in time series

#### Numerical tests for seismic resolution (codes included)

Seismic resolution and fidelity are the two important measures of the quality of the seismic record and the seismic images. Seismic resolution quantifies the...

#### Locating earthquakes using geiger’s method (codes included)

Simple earthquake location problem and its solution using Geiger’s method

#### Exploratory factor analysis (codes included)

Factor Analysis is an exploratory data analysis method used to search influential underlying factors or latent variables from a set of observed variables

#### Working with obspy and basemap (codes included)

This post is aimed to resolve the issues regarding the conflicts of using obspy and basemap libraries together.

#### Time series analysis in geophysics (codes included)

Time-series analysis is essential in most fields of science, including geophysics, economics, etc. Most of the geophysical data comes in a time-series format...

#### Gmt tutorial for beginners (codes included)

The Generic Mapping Tools is widely used across Earth and Planetary and other fields of studies to process data and generate high-quality illustrations. This...

Obspy is an open-source Python framework developed for the processing of seismological data. In this post, I will introduce how to use Obspy along with some ...

#### Simple wave modeling and hilbert transform in matlab (codes included)

We demonstrate how to model a simple wave, obtain its frequencies, apply Hilbert transform, and perform edge detection

#### Writing netcdf4 data using python (codes included)

NetCDF file format has been designed for storing multidimensional scientific data such as temperature, rainfall, humidity, etc. In this post, we will see how...

#### Time series analysis in python: filtering or smoothing data (codes included)

In this post, we will see how we can use Python to low-pass filter the 10 year long daily fluctuations of GPS time series. We need to use the “Scipy” package...

#### How to insert equation numbering in ms word

It is essential to insert equation numbers in your thesis and/or any scientific paper. In this post, I will show you some of the easiest ways to insert equat...

#### Reading netcdf4 data in python (codes included)

In Earth Sciences, we often deal with multidimensional data structures such as climate data, GPS data. It ‘s hard to save such data in text files as it would...

#### Writing scientific papers in ulysses

Ulysses is a natural, freestyle way of writing. If you got any idea, just write it down, worry about the format and other things when you’re done. Don’t let ...

#### Pygmt: high-resolution topographic map in python (codes included)

A simple tutorial on how to plot high resolution topographic map using GMT tools in Python

#### Plotting seismograms with increasing epicentral distance using python (codes included)

Short demostration of how to plot the distance vs seismic waveforms and mark the P and S arrival times using the IASP91 earth model. Codes are included.

#### Plotting track and trajectory of tropical cyclones on a topographic map in python (codes included)

Short demonstration of how to plot the track or trajectory of a hurricane on a map. Codes are included.

#### Visualizing power spectral density using obspy in python (codes included)

Short demonstration of the ppsd class defined in Obspy using 3 days of data for station PB-B075

#### Some handy mac tweaks [macos]

Some handy tweaks for mac like relocating default screenshot location, renaming batch files etc

#### Introduction to automating mac [macos]

Mac can be easily automated by the help of several tools such as automator, quick actions, applescripts

#### Iphone shortcut to quickly log body temperature [ios]

Shortcut code for quickly logging temperature in Apple health app

#### Automatically plotting record section for an earthquake in the given time range in python (codes included)

Python code to automatically plot the record section for the highest magnitude earthquake in the given time range

#### Mac quick action to rate the songs in apple music app [macos]

Quick action for mac to easily love, dislike, rate songs in apple music app

#### Numerical tests on travel time tomography [matlab]

Introduction to the concepts of tomography with equations and codes. Introduction to the concepts of overdetermined, underdetermined and mix-determined probl...

#### Monte carlo simulation to test for the correlation between two dataset in matlab (codes included)

We test for the correlation coefficients or the covariance between two sets of random numbers selected from normal distribution using the Monte Carlo simulat...

#### Easy statistical analysis using the tools of matlab (codes included)

Visualize the statistics of the data using MATLAB: mean, median, std, interquartile range, skewness, kurtosis, t-statistic, degrees of freedom

#### Hypothesis test in matlab (codes included)

Using Randomization to test the disprove the null hypothesis

#### Topographic map clipped by coastlines in python (codes included)

This post demonstrate how to use Python to set up clip topographic map based on coastlines.

#### Topographic map with shading in python (codes included)

Generating GMT style shaded relief map in Python

#### Plotting the geospatial data clipped by coastlines in python (codes included)

In geosciences, we most frequently have to make geospatial plots, but the available data is unevenly distributed and irregular. We like to show the data, in ...

#### How to plot topographic station map in python (codes included)

We read the station information from a file to plot the 1 arc-minute relief map

#### Non-linear curve fitting to a model with multiple observational variables in matlab (codes included)

How to fit data to non-linear model

#### Plotting 1 arc-minute global relief map in python (codes included)

Plotting 1 arc-minute topographic map in python

## 2019

#### Estimation of the degrees of freedom of time series in python (codes included)

Two time series with predominant linear trends (very low DOF) can have a very high correlation coefficient, which can hardly be construed as an evidence for ...

#### Gmt advanced tutorial, part ii (codes included)

Plotting publishable quality maps using generic mapping tools (GMT)

#### Interactive data visualization in python using bokeh

A basic to advanced guide to making interactive plots in Bokeh.

#### Why we should use generators? [python]

Generators don’t hold the entire result in memory. It yields one result at a time.

#### Gmt advanced tutorial (codes included)

Plotting publishable quality maps using generic mapping tools (GMT)

#### Using github for team collaboration

Tutorial on how to use Git and GitHub for team collaboration on a project. Content includes installing, setting up, creating a repository, making commits, un...