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

Avoid implicit changes to ict and space counts in thermal calibration #77

Open
carloshorn opened this issue Aug 14, 2020 · 2 comments
Open

Comments

@carloshorn
Copy link
Collaborator

To avoid an implicit change of the input arrays, I would move the interpolation of missing/wrong data in the ICT and space counts to the POD/KLM specific reader method get_telemetry or use a copy instead of changing the input in-place.

pygac/pygac/calibration.py

Lines 409 to 425 in 8a7f11e

# Thresholds to flag missing/wrong data for interpolation
ict_threshold = 100
space_threshold = 100
if channel == 3:
zeros = ict < ict_threshold
nonzeros = np.logical_not(zeros)
ict[zeros] = np.interp((zeros).nonzero()[0],
(nonzeros).nonzero()[0],
ict[nonzeros])
zeros = space < space_threshold
nonzeros = np.logical_not(zeros)
space[zeros] = np.interp((zeros).nonzero()[0],
(nonzeros).nonzero()[0],
space[nonzeros])

@sfinkens
Copy link
Member

I like the idea to move this to the POD/KLM specific get_telemetry methods. There are probably a number of methods in pygac which change data in-place and would need a refactoring. This one's a good start!

@mraspaud
Copy link
Member

Sounds good, go ahead!

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

No branches or pull requests

3 participants