function rBA = get_power_ratio(imA, imB)
  % rBA = get_power_ratio(imA, imB)
  %
  % find apparent power ratio between 2 images
  %
  % Example:
  % rBA = get_power_ratio(imHDR, imHDRa);
  % [ix40, ix40_data] = make_HDR_image('ITMX', '2016-07-16-00-21-45');
  % [ix02, ix02_data] = make_HDR_image('ITMX', '2016-07-15-23-14-05');
  % rBA = get_power_ratio(ix02, ix40)


  % eliminate saturated pixels
  nn = find(imA < 250 & imB < 250);
  imA = imA(nn);
  imB = imB(nn);
  
  % find brightest pixels
  if max(imA) > max(imB)
    [imA, nn] = sort(imA, 'descend');
    imB = imB(nn);
  else
    [imB, nn] = sort(imB, 'descend');
    imA = imA(nn);
  end
  
  % use ratio of brightest pixels
  nn = 1:100;
  rBA = mean(imB(nn) ./ imA(nn));

  %plot(imA(nn), imB(nn), '.'); grid on
end
