Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nishikawa/io/#96 #97

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
#96 add unit
  • Loading branch information
KaoruNishikawa committed May 25, 2021
commit 4b0719cb1d74b300355bf777cbcd68951f06b841
17 changes: 16 additions & 1 deletion nasco_analysis/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,25 @@ def convert(mode: bytes) -> float:
for key in reindexed_weather_set.keys():
coords[key] = ("t", reindexed_weather_set[key])

unit = {
"in_humi": "percent",
"out_humi": "percent",
"wind_sp": "m/s",
"wind_dir": "deg",
"press": "hPa",
"rain": "mm",
"v_lsr": "km/s",
}
unit.update(dict.fromkeys(["in_temp", "out_temp"], "K"))
unit.update(dict.fromkeys(["cabin_temp1", "cabin_temp2"], "K"))
unit.update(dict.fromkeys(["dome_temp1", "dome_temp2"], "K"))
unit.update(dict.fromkeys(["gen_temp1", "gen_temp2"], "K"))
unit.update(dict.fromkeys(["az", "el", "ra", "dec", "l", "b"], "deg"))

self.data = (
self.data_set[main_data_field]
.assign_coords(coords)
.assign_attrs(self.encoder_set.attrs)
.assign_attrs(self.encoder_set.attrs, unit=unit)
)
return self.data

Expand Down