Created
January 24, 2017 08:22
-
-
Save Chandler/ab35853ad2722c06893f3f1eacf0f251 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render_single_kai_pixel(bands, hyperion_pixel): | |
weighted_R = [] | |
weighted_G = [] | |
weighted_B = [] | |
used_bands = [] | |
for band in bands: | |
if band >= 320 and band <= 1000: | |
used_bands.append(band) | |
weighted_R.append(hyperion_pixel(band) * KAI_R(band)) | |
weighted_G.append(hyperion_pixel(band) * KAI_G(band)) | |
weighted_B.append(hyperion_pixel(band) * KAI_B(band)) | |
camera_R = (numpy.trapz(weighted_R, used_bands, dx=bandwidth) * (1/constant_scaling_factor)) | |
camera_G = (numpy.trapz(weighted_G, used_bands, dx=bandwidth) * (1/constant_scaling_factor)) | |
camera_B = (numpy.trapz(weighted_B, used_bands, dx=bandwidth) * (1/constant_scaling_factor)) | |
return (camera_R, camera_G, camera_B) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment