Skip to content

Refactor telemetry to use xarray#134

Open
mraspaud wants to merge 3 commits into
pytroll:mainfrom
mraspaud:refactor-to-xarray-from-the-start
Open

Refactor telemetry to use xarray#134
mraspaud wants to merge 3 commits into
pytroll:mainfrom
mraspaud:refactor-to-xarray-from-the-start

Conversation

@mraspaud
Copy link
Copy Markdown
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
Copy Markdown
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 thread pygac/calibration/noaa.py
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
Copy Markdown
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

?

Comment thread pygac/pod_reader.py
prt_counts = xr.DataArray(hmf_array["telemetry"]["PRT"],
dims=["scan_line_index", "PRT_measurement"])

# getting ICT counts
Copy link
Copy Markdown
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

Comment thread pygac/pod_reader.py
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
Copy Markdown
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