- Open Automator
- Create a new document
- Select Quick Action
- Set “Service receives selected” to
files or foldersinany application - Add a
Run Shell Scriptaction- your default shell should already be selected, otherwise use
/bin/zshfor macOS 10.15 (”Catalina”) or later - older versions of macOS use
/bin/bash
- your default shell should already be selected, otherwise use
- if you're using something else, you probably know what to do 😉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> //perror | |
| #include <stdlib.h> //atof, exit, EXIT_FAILURE | |
| #include <dlfcn.h> // dlopen, RTLD_LAZY, dlsym | |
| #include <libgen.h> // basename | |
| #include <getopt.h> // struct option, getopt_long, optarg | |
| void print_usage(const char *name) | |
| { | |
| printf("Usage: %s -[k|d] <epicentral distance in km/deg>\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float convertKMtoDegree(float c) | |
| { | |
| return (c / 111.1); | |
| } | |
| float convertDegreetoKM(float c) | |
| { | |
| return (c * 111.1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AutoDRM is an automatic, electronic mail-based message handling system | |
| developed and maintained by the Canadian National Data Centre for Earthquake | |
| Seismology and Nuclear Explosion Monitoring (CNDC) for the exchange of | |
| seismic and other geophysical data. It has been in continuous operation | |
| since April 1994. AutoDRM uses a command language that represents an | |
| amalgam of the command set and structure of the original Swiss autodrm and | |
| the GSE2.0 and IMS1.0 command sets (see below). While every effort has been | |
| made to allow the old commands to function fully, users are encouraged to | |
| adopt the GSE/IMS command set since it is more powerful and flexible and is | |
| an International Standard. More information on GSE/IMS formats and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| network,station,channel,stla,stlo,stel,evla,evlo,evdp,starttime,endtime,samplingRate,dist,baz | |
| TW,GWUB,HHZ,24.5059,121.1131,2159.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000002Z,2018-12-11T03:56:31.990002Z,100.0,15445.41,205.14 | |
| TW,LXIB,HHZ,24.0211,121.4133,1327.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000000Z,2018-12-11T03:56:31.990000Z,100.0,15409.58,204.75 | |
| TW,VCHM,HHZ,23.2087,119.4295,60.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000000Z,2018-12-11T03:56:31.990000Z,100.0,15242.27,205.4 | |
| TW,VDOS,HHZ,20.701,116.7306,5.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000000Z,2018-12-11T03:56:31.990000Z,100.0,14871.63,205.6 | |
| TW,VNAS,HHZ,10.3774,114.365,2.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000000Z,2018-12-11T03:56:31.990000Z,100.0,13726.26,203.23 | |
| TW,VWDT,HHZ,23.7537,121.1412,2578.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000000Z,2018-12-11T03:56:31.990000Z,100.0,15371.08,204.77 | |
| TW,VWUC,HHZ,24.9911,119.4492,42.0,-58.5981,-26.4656,164.66,2018-12-11T02:25:32.000000Z,2018-12-11T03:56:31.9 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygmt | |
| import pandas as pd | |
| # 1995-07-05 17:33:48.600 24.8313 122.1158 27 4.87 | |
| data = pd.read_csv('evtlist.dat', names=['SN','year','time','latitude','longitude','depth_km','magnitude'], delimiter='\s+') | |
| minlon, maxlon = 119.5, 124.0 | |
| minlat, maxlat = 19.8, 26.0 | |
| # Load sample earth relief data | |
| grid = pygmt.datasets.load_earth_relief(resolution="03s", region=[minlon, maxlon, minlat, maxlat]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import subprocess | |
| import numpy as np | |
| import os | |
| import glob | |
| from obspy import read_events, UTCDateTime | |
| import dask.dataframe as dd | |
| # Path to CMT catalog (ndk file) | |
| path_to_CMT_cat = 'https://www.ldeo.columbia.edu/~gcmt/projects/CMT/catalog/jan76_dec20.ndk' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| parse_yaml() { | |
| local prefix=$2 | |
| local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
| sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
| -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
| awk -F$fs '{ | |
| indent = length($1)/2; | |
| vname[indent] = $2; | |
| for (i in vname) {if (i > indent) {delete vname[i]}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygmt | |
| import pandas as pd | |
| # this file is retrieved from the pygmt dataset | |
| data = pd.read_csv('my_events_data.csv') | |
| # Set the region | |
| region = [ | |
| data.longitude.min() - 1, | |
| data.longitude.max() + 1, |
NewerOlder