zhuwq0 commited on
Commit
f5fc79f
1 Parent(s): 07e540e
merge_hdf5.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # %%
2
+ import os
3
+
4
+ import h5py
5
+ import matplotlib.pyplot as plt
6
+ from tqdm import tqdm
7
+
8
+ # %%
9
+ h5_dir = "waveform_h5"
10
+ h5_out = "waveform.h5"
11
+ h5_train = "waveform_train.h5"
12
+ h5_test = "waveform_test.h5"
13
+
14
+ h5_files = sorted(os.listdir(h5_dir))
15
+ train_files = h5_files[:-1]
16
+ test_files = h5_files[-1:]
17
+ print(f"train files: {train_files}")
18
+ print(f"test files: {test_files}")
19
+
20
+ # %%
21
+ with h5py.File(h5_out, "w") as fp:
22
+ # external linked file
23
+ for h5_file in h5_files:
24
+ with h5py.File(os.path.join(h5_dir, h5_file), "r") as f:
25
+ for event in tqdm(f.keys(), desc=h5_file, total=len(f.keys())):
26
+ if event not in fp:
27
+ fp[event] = h5py.ExternalLink(os.path.join(h5_dir, h5_file), event)
28
+ else:
29
+ print(f"{event} already exists")
30
+ continue
31
+
32
+ # %%
33
+ with h5py.File(h5_train, "w") as fp:
34
+ # external linked file
35
+ for h5_file in train_files:
36
+ with h5py.File(os.path.join(h5_dir, h5_file), "r") as f:
37
+ for event in tqdm(f.keys(), desc=h5_file, total=len(f.keys())):
38
+ if event not in fp:
39
+ fp[event] = h5py.ExternalLink(os.path.join(h5_dir, h5_file), event)
40
+ else:
41
+ print(f"{event} already exists")
42
+ continue
43
+
44
+ # %%
45
+ with h5py.File(h5_test, "w") as fp:
46
+ # external linked file
47
+ for h5_file in test_files:
48
+ with h5py.File(os.path.join(h5_dir, h5_file), "r") as f:
49
+ for event in tqdm(f.keys(), desc=h5_file, total=len(f.keys())):
50
+ if event not in fp:
51
+ fp[event] = h5py.ExternalLink(os.path.join(h5_dir, h5_file), event)
52
+ else:
53
+ print(f"{event} already exists")
54
+ continue
55
+
56
+ # %%
upload.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import HfApi
2
+
3
+ api = HfApi()
4
+
5
+ # Upload all the content from the local folder to your remote Space.
6
+ # By default, files are uploaded at the root of the repo
7
+ api.upload_folder(
8
+ folder_path="./",
9
+ repo_id="AI4EPS/quakeflow_nc",
10
+ repo_type="space",
11
+ )
waveform.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c35deb2e24f3c4b23c45ebe3c0e1217b79d6830fd17ce2e39eead44d480b5e02
3
- size 22334751
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a7e42bd35b211327a60b07bfe29e961e804488a30ac26961346e2d3e5de9e2a
3
+ size 21182406
waveform_h5/1987.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4bc378e8c370338d67aa51f2bde71509778cc6be47012e21709ef1c385ce75b8
3
- size 7686128
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b04da11734052555b474322ba144c44d28396e5c2f5326887b0d3a5ddc1dd7a
3
+ size 7691072
waveform_h5/1988.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:43d6e0e282e032f35ef6d505fd05313822fe91c80f1a2d3e82ac2aa982974ebf
3
- size 45763768
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8e76f81c6ea3ef8c6a87cf96af7c5bebbba2a2e30b84ea581f4f8fd26742c17
3
+ size 45808776
waveform_h5/1989.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fde67d8c22cc97b364e3517dc869a9dd949d3b12aea7fe24b7953e858dc680ca
3
- size 47878112
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7279d1249fb9cb55a77e4f584d8b5c415d93dc9cfc6b3d622d980cfc75e9d292
3
+ size 47927208
waveform_h5/1990.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2fbb6df6a074cb6faa4dc5f8c4dbefffa2eafff5765a730afd25e3e45b424142
3
- size 59909392
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a35e45769ab8bca1385eaa0d6d30f4c7d08b2fb51caa1b862abef712bc5a11c3
3
+ size 59972496
waveform_h5/1991.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f6f9896e27938178afeb5c1b79543956f893b44caa3fe616cc65d24807bed591
3
- size 61850152
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4f22a6b3c078e32f94db508a17f4168c855338df3335f73b940273d94bfaabd
3
+ size 61913672
waveform_h5/1992.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5042741fee7200e2266cc24d9e0919836d86bf2db721c70583bd9bcca923ffb7
3
- size 66831952
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2221a48c2c6b8163d02f805bf237c72e6c58e90967c4aa2e02c5196d74d67aaf
3
+ size 66901496
waveform_h5/1993.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b9478c0e2dd9160b9fda308cf3f9cb2f7c4db5d72754800784a6b63cafb3369c
3
- size 732304880
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f29b6fea2321909277fc1c721120de2390726f759d5672ae5df2023b147d6054
3
+ size 733055632
waveform_h5/1994.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c679a330b567693e65455956325649486d94226ea9021c47f4e5e09081239ad3
3
- size 643616712
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b6d044e1543920f365b7adeccc5a854b5e38f42858d21381069b0496ec528a0
3
+ size 644223672
waveform_h5/1995.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0134c1c55945def191cdf1be8a6822896d75e13140832b2bda8f743e043caa9c
3
- size 1809614056
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d983509787ff52c1f0eb964c8036f3c9d008ec9181d5a6d86400cf2b211eeae7
3
+ size 1811240360
waveform_h5/1996.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1a5543e7125214a74896fae6bbc5aceb4c8f7efead65cff2fb129976f1f4d636
3
- size 1856085320
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:620ad3a21195a281adb5e114e1abcd0bb9cfc11a2a0f4b626dedc85c9249df31
3
+ size 1857797960
waveform_h5/1997.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:273470be671b1ff648b30238588e96b2becd8547c853721fc181de6631670d3b
3
- size 2992318896
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae2cf7121c50673df2dab46ac70a1eb49b22c08b312e6ba49124b10ff98e621b
3
+ size 2995559488
waveform_h5/1998.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:07cfcaa6d037f426be7cf20dd2eb5efca70c3c718ef439564580aca06517623c
3
- size 2257734408
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:077c4492585f5ecb84b2837c7c4e3892cea50f5d543be556c9737aff862cca56
3
+ size 2259747456
waveform_h5/1999.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:236a13723b006c1e8513e4590e8b2cb3e9b45a41b8949cabf5cd441c1212be81
3
- size 2423970368
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dc670fa4b489df299d698651a6d7a082e2f4b416c696f60ebef841f1e37d9eb
3
+ size 2426102544
waveform_h5/2000.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:78af03f8607350b4de02edc5b6b6284431ab48cbcfd4d119156d881d6ca5f5ad
3
- size 450445480
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1f454e30b0aaa84cb093c87de38bee01d462da7121a25360701053d214136d9
3
+ size 450744888
waveform_h5/2001.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3192a3c2403d51b5066202f47ef5970dd74da99ac35def3ce25ef3fe3cf9e6bd
3
- size 947460368
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b585bb894cba5b088f975ddabe732995cd99eff118fceafc56811a22e9061f13
3
+ size 948373344
waveform_h5/2002.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4b315930e25ff33731fea5f89145f9e3ef263628fe4cec2ffab883b4f45ae106
3
- size 2491314224
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d32fc551a551034a00b34e406387c270043deda7014a3fe2370c65bf0377d254
3
+ size 2493741800
waveform_h5/2003.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d5ef5a67a5ff09496432cb3db634b9ab737ff77f7d5722233a3fa3e0a08dce74
3
- size 3712418896
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66dab8b9b4b13b7adcaffdca27bd67444d75936336e9bb4075215de1ca8cd23a
3
+ size 3711198200
waveform_h5/2004.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f09f6244b77a75e9c5d70973371920e3233e9886598402005321fde3fa58c59d
3
- size 6275149912
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:212377344242e23bbb440571f8d4fe9900aadbf611a39180931fa7e024653b8b
3
+ size 6281828960
waveform_h5/2005.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8432b5afbfbb558be71edede87e71097c1a0d08f511a85e8be935effed86a881
3
- size 3036493752
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a16037319b8972acdbc56326acd254fa6c14dd4c6d752383095aa0fa1c6ee46e
3
+ size 3039289120
waveform_h5/2006.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:27f2715a8487e3f6a1a6861fab13b1e6d7d45134e37247f4d0c10d725462e708
3
- size 2227564592
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c60dafe62f607ee7b6d5c8bcd51d0296716329ef13e067615d961a09da330e39
3
+ size 2059034240
waveform_h5/2007.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bb9cac8a01fcd746e4142970e522169a27c41aa272cfa01df919e959881f1faf
3
- size 4591923800
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55c7629b6dc3ef06e984da5ac882ab78fdc72a2064e8a8fe61bf1c18e30dd2dc
3
+ size 4046734864
waveform_h5/2008.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5628caec39df157d7f2c2a3b3b1e8960881416966e87e2b487fd0ef12d544426
3
- size 4116596960
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:407c1c2f83134a03b9d79d6e5f940951c84f37238c7265bc1f129bb6f7d79b94
3
+ size 4119983928
waveform_h5/2009.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cb1a73873835fb3c76c5979815eb91784fd8a0cc44dc77ea8253606dc09df67b
3
- size 4371663008
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5706b5e66f7c172f9aad7ea45490d7e4ba0bfa2d576689c3172cdcfb9220a30d
3
+ size 4364678000
waveform_h5/2010.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:802c5b51343beda61381f5db623005a84ea0858ace58152fdd561d795d135566
3
- size 4706472768
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c56defdcd8d9a4546aa2bb24a8e59883086f2041512f4d142d7cb106808ee44
3
+ size 4711142008
waveform_h5/2011.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2dfe0039d0c041dbaa628f5230f41d033e023172b5f8a0491b9c3458a1b59c5a
3
- size 5817371568
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:386fb508c3c1f299857b732429dd092a0a9c92f4a681e32feead6caa3692b9a9
3
+ size 5824740016
waveform_h5/2012.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e32f3656c035d9dcf7ecbf2717b403361153fcdbfed80d8d0f747646bc7a0504
3
- size 9804670096
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cf4c56c268ebc50ada05095ae2a04a8d1cafe71ba00944c9b23278bb5ce706a
3
+ size 9819829408
waveform_h5/2013.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:89b90550bc5c4ff25c879e69472c77389c341104f518202399ad69e4606c2408
3
- size 8702036232
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:339f997091a56c8f724f2356fecd8e83fc784583b42e06cd08255b527d2f4005
3
+ size 8711707096
waveform_h5/2014.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2d4def9cabb9170a0ba9266d786d85db8c185b1c65c05b76b488de1073cb1cbb
3
- size 12947594640
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2239cbc117190d0d28d2ae7b853e04e78795d955fa685eb1d9a7d9f590c6134
3
+ size 12961424776
waveform_h5/2015.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3b52103a965a65a40a2c8cd5c512a98c80c0c9bad4ba1e60473caa12e39f9828
3
- size 8767876816
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bec08fecffaa7115df39b6b34294ed36459977beb9e39822f154d09da816a4da
3
+ size 8777005976
waveform_h5/2016.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3aabf5ebded9ade1380cf56dbf455d519d06f3c5cdd91c00751a99750f9d4c6f
3
- size 9733202648
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a725a4fd2ceac32968fb2208891eb5f8fe1f4ecffa3a6e853d6f3984b9df322
3
+ size 9745085016
waveform_h5/2017.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:54f3374cdd5d1f50b03404609b0cc79f1babc9deaa21baf4f09aa9de4db6d585
3
- size 9122662280
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55e87624405edb6498a3bb9b2c075ad61d26696f467dffd7174def0d09eea278
3
+ size 9134398704
waveform_h5/2018.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6e2f82cf7765f8204469f7d2c3d9c90ef341b1ff28bc7ee63cd8a5a19414bde9
3
- size 7479412352
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fc7eab0f5feb07640805806c5e5c5afbab4903025c7d03096adc5d78d8072af
3
+ size 7486619824
waveform_h5/2019.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a936b46c0ef45be03daade7101302d8bbe3a933470e9c44b120383c5cac95934
3
- size 9101183312
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3efe0146ddd1fefd725c9b1fdc1204afa05b5d613d769654317f1fe79054bc9d
3
+ size 9111427136
waveform_h5/2020.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8bfe2e87a003ce3b752239d86386393da61bfaf60a2258070e62a8f235981d73
3
- size 9944875176
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08afb1a72ee1f6d4e610ffb9b44a191c4b7dddea19d42c3b2e7983e0f1fc7d75
3
+ size 9954396632
waveform_h5/2021.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:391f5ac1802f7d8e22873956be49f95fb3b62b250e0aa6def04903a8ebf6a7b3
3
- size 11294874288
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecf72fff79a40bdc61d512ab2472204ad6f2e9a0ec2f29948ea7064239c2430a
3
+ size 11305249256
waveform_h5/2022.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f566d903207a384c113b2b2c514ab29b8e6cb64d344e527ac2cc8501578ac40c
3
- size 8149456880
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a11b9e4d6c5522d89b195ff94632f2b8271c5de76be5a391f2c705f918c4c851
3
+ size 8147813400
waveform_h5/2023.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:08d7b31bc3e84725af071e0082472845e64ebe973774c06eaef5111807e9a981
3
- size 8642881336
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39bedcf5e2fbcb588fe0d69debae424e4a5ce2182372eb1685fc2db306cbc118
3
+ size 8646947144
waveform_test.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5447197e03d76acb26affc8381a9b45ea382d2c74d21328fbdf08562b4679ce3
3
- size 702636
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae7a8d18c5b55d0622250b6a60d393c6d18cb019d8c325558d5b2a694f4981f2
3
+ size 688187
waveform_train.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:99a4ab0fdf328b76dab7a12aabfee0f2cdfafeea60a5af2d74b5ef981dae8e63
3
- size 21655698
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab308d97259692613a084e6104f16a47a89f4fd63b487692694bec726b1fe919
3
+ size 20480067