#include "Level1Data.h" #include "GATS_Utilities.hpp" #include #include #include using namespace GATS_Utilities; extern "C" void decide_to_process (int* ichando, int* nch, int* igdo, int* ngdo, double* exolock, int* skipit) { *skipit = 0; // set skipit to false double lock = *exolock * 10800. / M_PI ; // lock down in ArcMinutes std::cout << " lock down (arcmin) " << lock << std::endl; int* i2 = std::find(ichando, ichando+ *nch, 2); //band2 int* i17 = std::find(ichando, ichando+ *nch, 17); //band 17 or channel 1 DV int* i16 = std::find(ichando, ichando+ *nch, 16); //band16 NO int* i24 = std::find(ichando, ichando+ *nch, 24); //band 24 or channel 8 DV int* t = std::find_if( igdo, igdo+ *ngdo, std::bind2nd(std::less(), 0) ) ; if( std::distance(igdo, t) < *ngdo ) { // this is a temperature retrieval don't skip at all return; } bool band2 = (std::distance(ichando, i2) < *nch || std::distance(ichando, i17) < *nch), nochan = (std::distance(ichando, i16) < *nch || std::distance(ichando, i24) < *nch), aerosol=false; int idg; for(int i=0; i< *ngdo; ++i ) { if( igdo[i] > 10000) { idg = igdo[i] / 10000; } else { idg = igdo[i] ; } if(!aerosol && idg >= 9000) { aerosol = true ; } } if(lock <= 14.0 || lock >= 18.) { // less than 8 arcminutes from top edge /* Go ahead an retrieve everything for the 13 arcminue offset data if(! aerosol && !band2) { // if not an aerosol retrieval and not band 2 skipit *skipit = 1; } */ } else { // greater than 8 arcminutes from top edge if( band2 && ::gLevel1Data.EventNo() < 27886) { *skipit = 1; } } // we're going to try out NO retrievals here if (nochan && ::gLevel1Data.ThermalChiSq(16) < 0.0 ) *skipit = 1; // Skip bad Thermal Chi Sq fits }