Hi, HMTK is now part of OpenQuake, so if you have some recent version, you already have it installed, just the use is a bit tricky, you need to find out what parts of the code need to be replaced to their new locations - this works for me on OQ 3.11:
from openquake.hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueWriter, CsvCatalogueParser
from openquake.hmtk.seismicity.catalogue import Catalogue
cat = CsvCatalogueParser(input_file = 'ISC-GEM-V3.csv').read_file() #recognised headers need to be present in the csv file
from openquake.hmtk.seismicity.selector import CatalogueSelector
#select within bounding box (Turkey) min lonlat, max lonlat, done on the original cat
CatalogueSelector(master_catalogue=cat,create_copy=False).within_bounding_box([23.4,34.5,48.5,44.2])
from openquake.hmtk.seismicity.declusterer.dec_afteran import Afteran
from openquake.hmtk.seismicity.declusterer.distance_time_windows import GardnerKnopoffWindow
declust_method = Afteran()
declust_config = {'time_distance_window': GardnerKnopoffWindow(), 'time_window': 100.0}
cluster_index, cluster_flag = declust_method.decluster(cat, declust_config)
cat.purge_catalogue(cluster_flag == 0) #remove aftershocks
cat.write_catalogue('ISC-GEM_Turkey.csv') #we can save the resulting declustered catalogue
comp_config = {'magnitude_bin': 0.5, 'time_bin': 5., 'increment_lock': True }
from openquake.hmtk.seismicity.completeness.comp_stepp_1971 import Stepp1971
completeness_algorithm = Stepp1971 ()
completeness_table = completeness_algorithm.completeness (cat ,comp_config )
#The next step could be to determine GR relationship for an area source, e.g
from openquake.hazardlib.geo.point import Point
from openquake.hazardlib.geo.polygon import Polygon
pns = '3.3346058E+01 3.8560173E+01 3.2787741E+01 3.7673824E+01 3.2287301E+01 3.7357098E+01 3.1895493E+01 3.7828385E+01 3.1029273E+01 3.8543841E+01 3.0987743E+01 3.8584700E+01 3.0809671E+01 3.8594232E+01 3.0636475E+01 3.8639983E+01 3.0402299E+01 3.8798211E+01 3.0053471E+01 3.9006840E+01 2.9711967E+01 3.9121456E+01 2.9399727E+01 3.9117636E+01 2.9126519E+01 3.9194048E+01 2.8207768E+01 3.9494066E+01 2.8187624E+01 3.9683284E+01 2.8425452E+01 3.9819942E+01 2.8824420E+01 4.0066503E+01 2.9631731E+01 3.9812212E+01 2.9941591E+01 3.9714611E+01 3.0372154E+01 3.9580687E+01 3.0983979E+01 3.9422098E+01 3.1489729E+01 3.9249590E+01 3.1933458E+01 3.9076420E+01 3.2399578E+01 3.8822339E+01 3.2694714E+01 3.8602817E+01 3.2822972E+01 3.8487713E+01 3.2949770E+01 3.8658522E+01 3.3090816E+01 3.8851659E+01'.split(' ')
poly = Polygon([Point(float(pns[i]),float(pns[i+1])) for i in range(0,len(pns),2)])
trbg103 = CatalogueSelector(master_catalogue=cat,create_copy=True).within_polygon(poly)
mle_config = {'magnitude_interval': 0.1, 'reference_magnitude': None, 'Average Type': 'Weighted'}
from openquake.hmtk.seismicity.occurrence.b_maximum_likelihood import BMaxLikelihood
recurrence = BMaxLikelihood()
bval, sigmab, aval, sigmaa = recurrence.calculate (trbg103, mle_config, completeness = completeness_table)
but this last step failed for me - I just followed some old examples and have rewritten them, I would also be grateful if someone would share some code to do the whole process.
Thank you
Peter