-
Notifications
You must be signed in to change notification settings - Fork 0
/
atlas_module_noise.py
executable file
·39 lines (30 loc) · 1.08 KB
/
atlas_module_noise.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
## Author: Daryn White, [email protected]
"""
Simple script to fix cyclic data within Atlas subsurface RAM
"""
import sys
import os
import argparse
import tao.atlas.ram as RAM
from numpy import nan as NAN
parser = argparse.ArgumentParser(
prog="atlas_module_noise",
description="Simple script to fix cyclic data within Atlas subsurface RAM",
)
parser.add_argument("file", metavar="file", help="RAM file for editing")
parser.add_argument("serial", type=int, help="Serial number of module")
parser.add_argument("depth", type=int, help="Depth of module")
parser.add_argument("val", type=float, help="Value the module is jumping to")
args = parser.parse_args()
ram_file = RAM.File(args.file)
frame = ram_file.frame
module = frame.loc[:, (str(args.serial), str(args.depth))]
module[module == args.val] = NAN
os.rename(args.file, args.file + "_orig")
ram_file.writeAtlas(frame, output=args.file)
sys.stdout.write(
f"""
Module {args.serial} at {args.depth}m has had all {args.val} removed.
See the new {args.file} file; {args.file}_orig saved for reference."""
)