diff --git a/etc/README.md b/etc/README.md index 6f852a99ef0242d4e322e372d80c86b8ff112277..acc7daa4dfe150765d8f3819364274220127caeb 100644 --- a/etc/README.md +++ b/etc/README.md @@ -2,4 +2,6 @@ See the [examples](examples) directory as a starting point for command-line use [Matlab](matlab) shows how to take advantage of the ground motion model implementations in `nshmp-haz`. +[Nshm](nshm) contains site lists and map polygons commonly used by the USGS NSHMP. + [Peer](peer) is a collection of simple source models that are used for testing. diff --git a/src/org/opensha2/calc/Site.java b/src/org/opensha2/calc/Site.java index 9bff69fdcdb724513982854a15032153a1cfd412..2989469be27623cd87b984fe34720c16cc83c0ed 100644 --- a/src/org/opensha2/calc/Site.java +++ b/src/org/opensha2/calc/Site.java @@ -163,9 +163,12 @@ public class Site implements Named { private Builder() {} - /** The name of the {@code Site}. */ + /** + * The name of the {@code Site}. Prior to setting, the supplied name is + * stripped of commas and truncated at 72 characters. + */ public Builder name(String name) { - this.name = checkNotNull(name); + this.name = cleanName(checkNotNull(name)); return this; } @@ -226,6 +229,10 @@ public class Site implements Named { } + private static String cleanName(String name) { + return name.replaceAll(",", "").substring(0, 72); + } + /* Json and csv serialization keys */ static final class Key { static final String NAME = "name";