gfail.pdl

Todo

  • Add max probability to product properties

  • Potentially add more files (e.g., png, pdf)

gfail.pdl.transfer(event_dir, version, pdl_conf, pdl_bin=None, source='us', dryrun=False, status='UPDATE')[source]

This is to transfer the event’s ‘pdl_directory’ to comcat. PDL must be installed separately, see https://usgs.github.io/pdl/ for information.

Parameters
  • event_dir (str) – File path to location of results for event.

  • version (int) – Version number of ground-failure run.

  • pdl_conf (str) – Path to PDL conf file.

  • pdl_bin (str) – Path to ‘ProductClient.jar’. If None it guesses that it is installed in the user’s home directory: ~/ProductClient/ProductClient.jar.

  • source (str) – PDL ‘source’. This is ‘us’ for products coming from NEIC, and is tied to the authentication key but this only matters once we start sending to production servers rather than dev servers, at which point we’ll need to add a configuration option for the key.

  • dryrun (bool) – If True, the PDL command is constructed and printed but not executed.

  • status (str) – Status of ground-failure product being sent to comcat. Default is “UPDATE” but can also be “WARNING” so that the product page displays the warning banner.

Returns

Dictionary of pdl return code, standard out, and standard error for dryrun=False; PDL command for dryrun=True.

Return type

dict or str

gfail.pdl.prepare_pdl_directory(event_dir)[source]

Make directory for transferring to comcat.

Parameters

event_dir (str) – Path to event directory

Returns

event_dir containing copies of all of the files that need to be sent to comcat