2025-04-15 17:23:42 +02:00
|
|
|
# -----------------
|
|
|
|
# Copyright © 2025 ACK Cyfronet AGH, Poland.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
# This work was partially funded by DT-GEO Project.
|
|
|
|
# -----------------
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
from seismic_hazard_forecasting import main as shf
|
|
|
|
|
|
|
|
|
|
|
|
def main(argv):
|
2025-05-26 16:35:04 +02:00
|
|
|
|
|
|
|
def str2bool(v):
|
|
|
|
if v.lower() in ("True", "TRUE", "yes", "true", "t", "y", "1"):
|
|
|
|
return True
|
|
|
|
elif v.lower() in ("False", "FALSE", "no", "false", "f", "n", "0"):
|
|
|
|
return False
|
|
|
|
else:
|
|
|
|
raise argparse.ArgumentTypeError("Boolean value expected.")
|
|
|
|
|
2025-04-15 17:23:42 +02:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
|
2025-04-25 11:18:32 +02:00
|
|
|
parser.add_argument("catalog_file", help="Path to input file of type 'catalog'")
|
2025-04-15 17:23:42 +02:00
|
|
|
parser.add_argument("--mc_file", help="Path to input file of type 'mccalc_output'", type=str, default=None, required=False)
|
|
|
|
parser.add_argument("--pdf_file", help="Path to input file of type 'PDF'", type=str, default=None, required=False)
|
|
|
|
parser.add_argument("--m_file", help="Path to input file of type 'm'", type=str, default=None, required=False)
|
|
|
|
|
2025-05-26 16:35:04 +02:00
|
|
|
parser.add_argument("--m_select", type=str2bool)
|
2025-04-15 17:23:42 +02:00
|
|
|
parser.add_argument("--mag_label", type=str, default=None, required=False)
|
|
|
|
parser.add_argument("--mc", type=float, default=None, required=False)
|
|
|
|
parser.add_argument("--m_max", type=float, default=None, required=False)
|
|
|
|
parser.add_argument("--m_kde_method", type=str)
|
2025-05-26 16:35:04 +02:00
|
|
|
parser.add_argument("--xy_select", type=str2bool)
|
2025-04-15 17:23:42 +02:00
|
|
|
parser.add_argument("--grid_dim", type=int)
|
2025-05-26 16:35:04 +02:00
|
|
|
parser.add_argument("--xy_win_method", type=str2bool)
|
|
|
|
parser.add_argument("--rate_select", type=str2bool)
|
2025-04-15 17:23:42 +02:00
|
|
|
parser.add_argument("--time_win_duration", type=float)
|
2025-05-26 16:35:04 +02:00
|
|
|
parser.add_argument("--forecast_select", type=str2bool)
|
2025-04-15 17:23:42 +02:00
|
|
|
parser.add_argument("--custom_rate", type=float, default=None, required=False)
|
|
|
|
parser.add_argument("--forecast_len", type=float)
|
|
|
|
parser.add_argument("--time_unit", type=str)
|
|
|
|
parser.add_argument("--model", type=str)
|
|
|
|
parser.add_argument("--products_string", type=str)
|
2025-05-26 16:35:04 +02:00
|
|
|
parser.add_argument("--verbose", type=str2bool)
|
2025-04-15 17:23:42 +02:00
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
shf(**vars(args))
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main(sys.argv)
|