/*************************************************************************** * 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 "parasolfiledata.h" int main(int argc, char *argv[]) { unsigned short nb_bytes; double slope,offset; unsigned char *count_data=NULL; // unsigned short *ushort_count_data=NULL; double* scaled_data=NULL; string param,var; // double val; bool show_val_display=true; string filename("/home/pascal/DATA/PARASOL/RB2/2006/2006_12_28/P3L2TRGB048015KL"); PARASOLFileData pfd(filename); int nb_data=pfd.get_nb_data(); // ***** test some attributes building ***** cout<<"-------------------------------------------------------"<(pfd.get_line_data()); // unsigned short* col=const_cast(pfd.get_col_data()); // if (show_val_display) { // cout<<"line\tcolumn"< using pixel indexes // pixel_coord[0]=167;pixel_coord[1]=865; // first pixel // pfd.get_index(pixel_coord,rec_idx); // cout< test lat_lon_to_grid methods // float lat_minmax[2]; // float lon_minmax[2]; // // pixel_coord[0]=170;pixel_coord[1]=877; // pfd.grid_to_geolocation(pixel_coord,lat_minmax,lon_minmax); // cout<<"pixel ("< lat ("< pixel ("< pixel ("< pixel ("< using lat,lon coordinates // float lat,lon; // first pixel // lat = 0.; // lon=0.; // pfd.get_index(lat,lon,rec_idx); // cout<(pfd.read_count_data(count_data,param.c_str())); scaled_data=static_cast(pfd.read_scaled_data(scaled_data,param.c_str())); if (count_data!=NULL && scaled_data!=NULL) { if (show_val_display) { cout<<"Record\tCount\tScaled"<(pfd.read_count_data(count_data,param.c_str())); scaled_data=static_cast(pfd.read_scaled_data(scaled_data,param.c_str())); if (count_data!=NULL && scaled_data!=NULL) { if (show_val_display) { cout<<"Record\tCount\tScaled"<(pfd.read_count_data(ushort_count_data,param.c_str())); // scaled_data=static_cast(pfd.read_scaled_data(scaled_data,param.c_str())); // if (ushort_count_data!=NULL && scaled_data!=NULL) { // if (show_val_display) { // cout<<"Record\tCount\tScaled"<(pfd.read_count_data(count_data,param.c_str())); // scaled_data=static_cast(pfd.read_scaled_data(scaled_data,param.c_str())); // if (count_data!=NULL && scaled_data!=NULL) { // if (show_val_display) { // cout<<"Record\tCount\tScaled"<