你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Updated with ruff formatter
这个提交包含在:
@@ -55,7 +55,9 @@ class Cursor(object):
|
||||
) # Convert pixel values from float (0-1) to integer (0-255)
|
||||
match = pixel_match(materials, pixel)
|
||||
if match is False:
|
||||
logger.info(f"x, y: {int(x)} {int(y)} px; RGB: {pixel[:-1]}; material ID: {len(self.materials)}")
|
||||
logger.info(
|
||||
f"x, y: {int(x)} {int(y)} px; RGB: {pixel[:-1]}; material ID: {len(self.materials)}"
|
||||
)
|
||||
materials.append(pixel)
|
||||
|
||||
|
||||
@@ -85,10 +87,17 @@ if __name__ == "__main__":
|
||||
)
|
||||
parser.add_argument("imagefile", help="name of image file including path")
|
||||
parser.add_argument(
|
||||
"dxdydz", type=float, action="append", nargs=3, help="spatial resolution of model, e.g. dx dy dz"
|
||||
"dxdydz",
|
||||
type=float,
|
||||
action="append",
|
||||
nargs=3,
|
||||
help="spatial resolution of model, e.g. dx dy dz",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-zcells", default=1, type=int, help="number of cells for domain in z-direction (infinite direction)"
|
||||
"-zcells",
|
||||
default=1,
|
||||
type=int,
|
||||
help="number of cells for domain in z-direction (infinite direction)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -97,7 +106,9 @@ if __name__ == "__main__":
|
||||
|
||||
# Store image data to use for creating geometry
|
||||
imdata = np.rot90(im, k=3) # Rotate 90CW
|
||||
imdata = np.floor(imdata * 255).astype(np.int16) # Convert pixel values from float (0-1) to integer (0-255)
|
||||
imdata = np.floor(imdata * 255).astype(
|
||||
np.int16
|
||||
) # Convert pixel values from float (0-1) to integer (0-255)
|
||||
|
||||
logger.info(f"Reading PNG image file: {os.path.split(args.imagefile)[1]}")
|
||||
logger.info(
|
||||
|
@@ -33,7 +33,11 @@ logging.basicConfig(format="%(message)s", level=logging.INFO)
|
||||
|
||||
# Host machine info.
|
||||
hostinfo = get_host_info()
|
||||
hyperthreadingstr = f", {hostinfo['logicalcores']} cores with Hyper-Threading" if hostinfo["hyperthreading"] else ""
|
||||
hyperthreadingstr = (
|
||||
f", {hostinfo['logicalcores']} cores with Hyper-Threading"
|
||||
if hostinfo["hyperthreading"]
|
||||
else ""
|
||||
)
|
||||
hostname = f"\n=== {hostinfo['hostname']}"
|
||||
logging.info(f"{hostname} {'=' * (get_terminal_width() - len(hostname) - 1)}")
|
||||
logging.info(f"\n{'Mfr/model:':<12} {hostinfo['machineID']}")
|
||||
@@ -46,7 +50,8 @@ logging.info(f"{'OS/Version:':<12} {hostinfo['osversion']}")
|
||||
|
||||
# OpenMP
|
||||
logging.info(
|
||||
"\n\n=== OpenMP capabilities (gprMax will not use Hyper-Threading " + "as there is no performance advantage)\n"
|
||||
"\n\n=== OpenMP capabilities (gprMax will not use Hyper-Threading "
|
||||
+ "as there is no performance advantage)\n"
|
||||
)
|
||||
logging.info(f"{'OpenMP threads: '} {hostinfo['physicalcores']}")
|
||||
|
||||
|
@@ -107,7 +107,9 @@ def merge_files(outputfiles, removefiles=False):
|
||||
availableoutputs = list(fin[path].keys())
|
||||
for output in availableoutputs:
|
||||
grp.create_dataset(
|
||||
output, (fout.attrs["Iterations"], len(outputfiles)), dtype=fin[path + "/" + output].dtype
|
||||
output,
|
||||
(fout.attrs["Iterations"], len(outputfiles)),
|
||||
dtype=fin[path + "/" + output].dtype,
|
||||
)
|
||||
|
||||
# For all receivers
|
||||
@@ -134,9 +136,14 @@ if __name__ == "__main__":
|
||||
+ "optionally removes the series of output files.",
|
||||
usage="cd gprMax; python -m tools.outputfiles_merge basefilename",
|
||||
)
|
||||
parser.add_argument("basefilename", help="base name of output file series including path")
|
||||
parser.add_argument(
|
||||
"--remove-files", action="store_true", default=False, help="flag to remove individual output files after merge"
|
||||
"basefilename", help="base name of output file series including path"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--remove-files",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="flag to remove individual output files after merge",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户