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

Refactor telemetry to use xarray #134

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mraspaud
Copy link
Member

This PR refactors the telemetry fetching to use xarray, and in the case of POD, the hmf frames are also decoded in a clearer manner.

@mraspaud mraspaud self-assigned this Oct 18, 2024
Copy link
Member

@sfinkens sfinkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Just some minor questions

Comment on lines +83 to +84
ict = ds["ICT"].mean(dim="back_scan").data[:, -3:]
space = ds["space_counts"].mean(dim="back_scan").data[:, -3:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could

.data[:, -3:]

be replaced with

.sel(channel_name=slice(-3, None)).data

?


hmf_array = decode_tele[:, :103].view(dtype=hmf_dtype).squeeze()
prt_counts = xr.DataArray(hmf_array["telemetry"]["PRT"],
dims=["scan_line_index", "PRT_measurement"])

# getting ICT counts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could also remove the comments

return potential_tbm_header.copy()
data_set_name = cls._decode_data_set_name(data_set_name)
tbm_header = potential_tbm_header.copy()
tbm_header["data_set_name"] = data_set_name.decode().strip("\x80").encode()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the .decode().strip().encode() part be moved to _decode_data_set_name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants