"""
Fixed parameters used by GrowClust (converted from grow_params.f90).
These are not read from input file; modify as necessary.
"""

import numpy as np

# Array size parameters
NSTA0 = 1000              # max number of stations
NQ0 = 100000              # max number of quakes
NPAIR0 = 1000000          # max total number of event pairs
NTMAX = 100000            # max number of trees (clusters)
NBMAX = 100000            # max number of events (branches) per tree
N0 = 1000                 # max number of differential times for each event pair
NDIF0 = 10000000          # max total number of differential times
N08 = 10000               # max number of diff. times for 10 event pairs
MAXBOOT = 100             # max number of bootstrap resamples
MAXEVID = 100000000       # maximum event id number

# GrowClust algorithm control parameters
DISTMAX = 8.0             # max catalog distance to join clusters (km)
DISTMAX2 = 6.0            # max relocated distance to join clusters (km)
NCLUSTSHIFTMIN = 1        # min number of events in cluster to apply cluster shift test
HSHIFTMAX = 2.0           # max permitted horizontal cluster shifts (km)
VSHIFTMAX = 2.0           # max permitted vertical cluster shifts (km)
RMEDMAX = 0.10            # max median absolute tdif residual to join clusters

# Relative relocation subroutine parameters
BOXWID = 3.0              # initial "shrinking-box" width (km)
NIT = 15                  # number of iterations
IRELONORM = 1             # relocation norm (L1 norm=1, L2 norm=2, 3=robust L2)
TDIFMAX = 30.0            # max differential time value allowed

# Bootstrap resampling parameters
ISEED = 0                 # random number seed
RMS_NAN = 0.0             # rms flag for unrelocated event
MAD_NAN = -1.0            # bootstrap MAD error flag for unrelocated events
SE_NAN = MAD_NAN          # bootstrap SE error flag for unrelocated events
SAMP_TYPE = 2             # bootstrap sampling type (1 or 2)

# Velocity model parameters
VZMODEL_TYPE = 1          # 1 = flat earth (Z,Vp,Vs), 2 = radial (R,Vp,Vs)

# Travel-time table parameters
NX0_TT = 501              # max distance points in travel time table
ND0_TT = 201              # max depth points in travel time table

# Spherical geometry constants
DEGRAD = 180.0 / np.pi
DEGKM = 111.1949266
ERAD = 6371.0             # earth radius in km
