Skip to content

Commit

Permalink
Update channel_metadata in synthetic
Browse files Browse the repository at this point in the history
- instead of using a flat dict with metadata, use nested dict
- first layer denotes the channel type ("electric" or "magnetic")
  • Loading branch information
kkappler committed Nov 30, 2023
1 parent d6c9d83 commit 218eab8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions aurora/test_utils/synthetic/make_mth5_from_asc.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ def create_run_ts_from_synthetic_run(run, df, channel_nomenclature="default"):
"time_period.start": run.start,
}
if col in [EX, EY]:
meta_dict["units"] = "millivolts per kilometer"
channel_metadata = {"electric": meta_dict}
chts = ChannelTS(
channel_type="electric", data=data, channel_metadata=meta_dict
channel_type="electric", data=data, channel_metadata=channel_metadata
)
# add metadata to the channel here
chts.channel_metadata.dipole_length = 50
if col == EY:
chts.channel_metadata.measurement_azimuth = 90.0

elif col in [HX, HY, HZ]:
meta_dict["units"] = "nanotesla"
channel_metadata = {"magnetic": meta_dict}
chts = ChannelTS(
channel_type="magnetic", data=data, channel_metadata=meta_dict
channel_type="magnetic", data=data, channel_metadata=channel_metadata
)
if col == HY:
chts.channel_metadata.measurement_azimuth = 90.0
Expand Down Expand Up @@ -406,11 +406,11 @@ def create_test4_h5(

def main(file_version="0.1.0"):
file_version = "0.2.0"
create_test1_h5(file_version=file_version)
create_test1_h5_with_nan(file_version=file_version)
create_test2_h5(file_version=file_version)
create_test12rr_h5(file_version=file_version)
create_test3_h5(file_version=file_version)
# create_test1_h5(file_version=file_version)
# create_test1_h5_with_nan(file_version=file_version)
# create_test2_h5(file_version=file_version)
# create_test12rr_h5(file_version=file_version)
# create_test3_h5(file_version=file_version)
create_test4_h5(file_version=file_version)


Expand Down

0 comments on commit 218eab8

Please sign in to comment.