/* normalize_cal_factors.cpp */ /* remap Copyright (C) 2006 Fabrice Ducos, fabrice.ducos@icare.univ-lille1.fr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "libxrit.h" inline double sqr(double x) { return x*x; } void normalize_seviri_factors(int met8_channel, double &slope, double &offset /* unused */) { const double seviri_wavelength[] = { /* in micrometers */ 0.6, 0.8, 1.6, 3.9, 6.2, 7.3, 8.703, 9.7, 10.745, 11.910, 13.4 }; const double old_slope = slope; const double old_offset = offset; assert(met8_channel >= 0 && met8_channel <= 11); offset = -old_offset/old_slope; slope = 10.*old_slope/sqr(seviri_wavelength[met8_channel]); } void normalize_seviri_factors(const char *dataset, double &slope, double &offset) { int met8_channel = xrit_met8_channel(dataset); normalize_seviri_factors(met8_channel, slope, offset); /* offset not changed */ }