/*************************************************************************** * Copyright (C) 2006 by Nicolas PASCAL * * pascal@icare-pc12 * * * * 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., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "modisfiledata.h" int main(int argc, char *argv[]) { // MODISFileData fd("/home/pascal/DATA/LIENS/MODIS/MYD021KM/2006/2006_12_28/MYD021KM.A2006362.0000.005.2006363172729.hdf"); // MODISFileData fd("/DATA/LIENS/MODIS/MYD05_L2/2007/2007_03_01/MYD05_L2.A2007060.0050.005.2007068205433.hdf"); MODISFileData fd("/DATA/LIENS/MODIS/MYD03/2009/2009_01_01/MYD03.A2009001.0000.005.2009330051638.hdf"); /* print out some informations */ cout<<"Product "< (787,842) lon = -170.42566; if ( fd.get_index ( lat, lon, -1., idx ) ) printf ( "(%f,%f) -> [%d,%d]\n", lat, lon, idx[0], idx[1] ); fd.free_geolocation_data(); /* --- MYD021KM --- */ // fd.load_geolocation_data(); // cout<<"-------------------------------------"< (0,0) // lon = 12.0974045; // if (fd.get_index(lat,lon,-1.,idx)) // cout<<"("< (0,269) // lon = 32.527287; // if (fd.get_index(lat,lon,-1.,idx)) // cout<<"("< (405,269) // lon = 29.480896; // if (fd.get_index(lat,lon,-1.,idx)) // cout<<"("< (405,0) // lon = 7.288439; // if (fd.get_index(lat,lon,-1.,idx)) // cout<<"("< (180,332) // lon = 21.352146; // if ( fd.get_index(lat,lon,-1.,idx) ) // cout<<"("< 5km ("< should be (1972,2) // cout<<"5km to 1km indexes : ("< ("< ("< ("<