[..] La fonction [scl] fscan_eosscl

Code
int fscan_eos_xpl(){ scltracefa(§, ƒ, ); scltracefc("scl-%s (%s) : %s\n", sclver(), sclsec(), temps_char(0)); scltracefc(" < hdf-eos-%s\n\n", sclver_eos()); std::string eosname="AST_L1B_003_09212000113746_09232003073119.hdf", eospath="./don/hdf/"+eosname; finfo_eos(eospath.c_str()); std::string dsname="TIR_Swath", dfname="ImageData10"; int scltype=0/*double*/, dimn; void **eos=fscan_eos(eospath.c_str(), dsname.c_str(), dfname.c_str(), scltype, &dimn); int *crdn=(int*)eos[0], vxn=crdn[0], xi, vyn=crdn[1], yi; double **val=(double**)eos[1]; double xa=0, xe=(double)vxn-1, ya=0, ye=(double)vyn-1; scl::string_c imgname=scl::string_c(ƒ)+"_"+dsname+"_"+dfname+".pdf", imgpath="./srt/"+imgname; grafmat_dis(imgpath.c_str(), vxn, vyn, val, "grid", "on", "colormap", "paruline", "subtitlex", imgname.c_str(), "linespeca", "-a", ); //--------------------------------------------------------------------- //[>LONGITUDE] //--------------------------------------------------------------------- scl::string_c gfname="Longitude"; eos=fscan_eos(eospath.c_str(), dsname.c_str(), gfname.c_str(), scltype, &dimn); crdn=(int*)eos[0]; int xn=crdn[0], yn=crdn[1]; double **lon=(double**)eos[1]; double *x=newtablin(xn, xa, xe), *y=newtablin(yn, ya, ye); //----------------------------------------------------------------- //[>RÉGRESSION PLANAIRE] //----------------------------------------------------------------- // equation du plan a estimer : x/a+y/b+z/c=1 int tn=xn*yn, ti=0; double **H=newmat<double>(tn, 3); for(xi=0;xi<xn;xi++){ for(yi=0;yi<yn;yi++){ H[ti][0]=x[xi]; H[ti][1]=y[yi]; H[ti][2]=lon[xi][yi]; ti++; } } // Pseudo-inverse double **_H=newmat<double>(3, tn); pinv(tn, 3, H, _H); double _a=0, _b=0, _c=0; // _H*[1;1;..;1] for(ti=0;ti<tn;ti++){ _a+=_H[0][ti]; _b+=_H[1][ti]; _c+=_H[2][ti]; } // Coefficients du plan double a_lon=1/_a, b_lon=1/_b, c_lon=1/_c; scltracefc("Plan Lon.: a=%lf, b=%lf, c=%lf\n", a_lon, b_lon, c_lon); //----------------------------------------------------------------- //[<RÉGRESSION PLANAIRE] //----------------------------------------------------------------- imgname.clear(); imgname=scl::string_c(ƒ)+"_"+dsname+"_"+gfname+".svg"; imgpath.clear(); imgpath="./srt/"+imgname; scl::string_c titlex="Plan approché : a="+num_str<double>(a_lon)+ ", b="+num_str<double>(b_lon)+", c="+num_str<double>(c_lon); grafmat_dis(imgpath.c_str(), xn, yn, lon, "grid", "on", "colormap", "paruline", "subtitlex", imgname.c_str(), "x", x, "y", y, "titlex", titlex.c_str(), "linespeca", "-a", ); //--------------------------------------------------------------------- //[<LONGITUDE] //--------------------------------------------------------------------- //--------------------------------------------------------------------- //[>LATITUDE] //--------------------------------------------------------------------- gfname.clear(); gfname="Latitude"; eos=fscan_eos(eospath.c_str(), dsname.c_str(), gfname.c_str(), scltype, &dimn); crdn=(int*)eos[0]; //xn=crdn[0]; yn=crdn[1]; double **lat=(double**)eos[1]; //double *x=newtablin(xn, xa, xe), *y=newtablin(yn, ya, ye); //----------------------------------------------------------------- //[>RÉGRESSION PLANAIRE] //----------------------------------------------------------------- // equation du plan a estimer : x/a+y/b+z/c=1 /*int tn=xn*yn,*/ ti=0; //double **H=newmat<double>(tn, 3), for(xi=0;xi<xn;xi++){ for(yi=0;yi<yn;yi++){ /*H[ti][0]=x[xi]; H[ti][1]=y[yi];*/ H[ti][2]=lat[xi][yi]; ti++; } } // Pseudo-inverse /*double **_H=newmat<double>(3, tn);*/ pinv(tn, 3, H, _H); /*double*/ _a=0; _b=0; _c=0; // _H*[1;1;...;1] for(ti=0;ti<tn;ti++){ _a+=_H[0][ti]; _b+=_H[1][ti]; _c+=_H[2][ti]; } // Coefficients du plan double a_lat=1/_a, b_lat=1/_b, c_lat=1/_c; scltracefc("Plan Lat.: a=%lf, b=%lf, c=%lf\n", a_lat, b_lat, c_lat); //----------------------------------------------------------------- //[<RÉGRESSION PLANAIRE] //----------------------------------------------------------------- imgname.clear(); imgname=scl::string_c(ƒ)+"_"+dsname+"_"+gfname+".svg"; imgpath.clear(); imgpath="./srt/"+imgname; titlex.clear(); titlex="Plan approché : a="+num_str<double>(a_lat)+ ", b="+num_str<double>(b_lat)+", c="+num_str<double>(c_lat); grafmat_dis(imgpath.c_str(), xn, yn, lat, "grid", "on", "colormap", "paruline", "subtitlex", imgname.c_str(), "x", x, "y", y, "titlex", titlex.c_str(), "linespeca", "-a", ); //--------------------------------------------------------------------- //[<LATITUDE] //--------------------------------------------------------------------- // Dynamique géodésique (🗺 dislin) double lona=rd, lone=-rd, clon, lon_rad; double lata=rd, late=-rd, clat, lat_rad; double cnul=0, cx, cy, cz; for(xi=0;xi<xn;xi++){ for(yi=0;yi<yn;yi++){ clon=lon[xi][yi]; lon_rad=clon/180*π; clat=lat[xi][yi]; lat_rad=clat/180*π; // Passage coordonnées géocentriques/sphériques (🗺 hdf-eos) // vers coordonnées géodésiques (🗺 dislin) llac_xyze(1, &lon_rad, &lat_rad, &cnul, &cx, &cy, &cz); xyze_llg(1, &cx, &cy, &cz, &clon, &clat); clon=clon/π*180; clat=clat/π*180; if(lona>clon){ lona=clon; } if(lone<clon){ lone=clon; } if(lata>clat){ lata=clat; } if(late<clat){ late=clat; } } } // Surface et longueur d'un pixel rectifié double sx=(lone-lona)*(late-lata)/(((double)vxn)*((double)vyn)), lx=(sx); int stlonn=(int)round((lone-lona)/lx), stloni; double *stlon=newtablin(stlonn, lona, lone); int stlatn=(int)round((late-lata)/lx), stlati; double *stlat=newtablin(stlatn, lata, late); int stn = stlonn*stlatn, sti; scltracefc("stn=lonn*latn=%d*%d=%d\n", stlonn, stlatn, stn); double *stx=new double[stn], *sty=new double[stn]; int *stin = new int[stn]; for (stloni=0;stloni<stlonn;stloni++){ clon=stlon[stloni]; lon_rad=clon/180*π; for (stlati=0;stlati<stlatn;stlati++){ clat=stlat[stlati]; lat_rad=clat/180*π; // Passage géodésique (🗺 dislin) vers // géocentrique (🗺 hdf-eos) llg_llc(1, &lon_rad, &lat_rad, &clon, &clat); clon=clon/π*180; clat=clat/π*180; sti = stlati + stloni*stlatn; // Résolution du sytème // x/a_lon + y/b_lon + lon/c_lon = 1 // x/a_lat + y/b_lat + lat/c_lat = 1 stx[sti]=(b_lon-b_lat-(clon*b_lon/c_lon-clat*b_lat/c_lat))/ (b_lon/a_lon-b_lat/a_lat); sty[sti]=(a_lon-a_lat-(clon*a_lon/c_lon-clat*a_lat/c_lat))/ (a_lon/b_lon-a_lat/b_lat); /*scltracefc("stx[%d]=%lf, sty[%d]=%lf\n", sti, stx[sti], sti, sty[sti]);*/ //🔬 } } //--------------------------------------------------------------------- // Interpolation bilinéaire double *stval = new double[stn]; tic(); interpmat(vxn, vyn, val, , xa, xe, ya, ye, stn,stx,sty,stval,,,stin); scltracefc("Duree de l'interpolation bilineaire=%lf [s]\n", tac()/103); double **vmat=tab_mat<double>(stlonn, stlatn, stval, 2); int **inmat = tab_mat<int>(stlonn, stlatn, stin, 2); imgname.clear(); imgname=std::string(ƒ)+"_"+dsname+"_"+dfname+"_rectifie.pdf", imgpath.clear(); imgpath="./srt/"+imgname; double iuemlon_deg=-4.562854, iuemlat_deg=48.358529; // WGS84 tic(); grafmat_dis(imgpath.c_str(), stlonn, stlatn, vmat, "x", stlon, "y", stlat, "instatus", inmat, "curve", 1, &iuemlon_deg, &iuemlat_deg, "linespec", "l*", "subtitle", "Champ rectifié", "title", imgname.c_str(), "xlabel", "Z-range: [<azrange>]", "geographic", "flat", "colormap", "paruline", "legend", "IUEM (WGS84)", "legcorn", "ura", "linespeca", "-a", ); // Libr. memoire deletemat<double>(stlonn, &vmat); free(stlon); stlon=; free(stlat); stlat=; deletemat<int>(stlonn, &inmat); scltracefe(§, ƒ, ); return 0; } /* ƒ décorée par 🔬 le 21-03-2025 21:05:02 */
Sortie
[>..\xpl\src\sclhdf.eos.xpl.cpp.fscan_eos_xpl] scl-25.03 (gwin64) : 21-03-2025 21:05:02 < hdf-eos-2.19 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [>HDF-EOS FILE INFORMATIONS] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> OS benchmark: - sizeof(double)=8 - sizeof(float) =4 - sizeof(int) =4 - sizeof(long) =4 filepath : './don/hdf/AST_L1B_003_09212000113746_09232003073119.hdf' - version : 'HDFEOS_V2.8' - type : SWATH - 'VNIR_Swath' - Dimension map: GeoTrack/ImageLine - offset : 0 - increment: 420 - Dimension map: GeoXtrack/ImagePixel - offset : 0 - increment: 498 - Dimension map: GeoTrack/ImageLine3B - offset : 400 - increment: 420 - Geo field: 'Latitude' - Type: FLOAT64 (8 [byte]) - Size: [11][11] - Geo field: 'Longitude' - Type: FLOAT64 (8 [byte]) - Size: [11][11] - Data field: 'ImageData1' - Type: UINT8 (1 [byte]) - Size: [4200][4980] - Data field: 'ImageData2' - Type: UINT8 (1 [byte]) - Size: [4200][4980] - Data field: 'ImageData3N' - Type: UINT8 (1 [byte]) - Size: [4200][4980] - Data field: 'ImageData3B' - Type: UINT8 (1 [byte]) - Size: [4600][4980] - 'SWIR_Swath' - Dimension map: GeoTrack/ImageLine - offset : 0 - increment: 210 - Dimension map: GeoXtrack/ImagePixel - offset : 0 - increment: 249 - Geo field: 'Latitude' - Type: FLOAT64 (8 [byte]) - Size: [11][11] - Geo field: 'Longitude' - Type: FLOAT64 (8 [byte]) - Size: [11][11] - Data field: 'ImageData4' - Type: UINT8 (1 [byte]) - Size: [2100][2490] - Data field: 'ImageData5' - Type: UINT8 (1 [byte]) - Size: [2100][2490] - Data field: 'ImageData6' - Type: UINT8 (1 [byte]) - Size: [2100][2490] - Data field: 'ImageData7' - Type: UINT8 (1 [byte]) - Size: [2100][2490] - Data field: 'ImageData8' - Type: UINT8 (1 [byte]) - Size: [2100][2490] - Data field: 'ImageData9' - Type: UINT8 (1 [byte]) - Size: [2100][2490] - 'TIR_Swath' - Dimension map: GeoTrack/ImageLine - offset : 0 - increment: 70 - Dimension map: GeoXtrack/ImagePixel - offset : 0 - increment: 83 - Geo field: 'Latitude' - Type: FLOAT64 (8 [byte]) - Size: [11][11] - Geo field: 'Longitude' - Type: FLOAT64 (8 [byte]) - Size: [11][11] - Data field: 'ImageData10' - Type: UINT16 (2 [byte]) - Size: [700][830] - Data field: 'ImageData11' - Type: UINT16 (2 [byte]) - Size: [700][830] - Data field: 'ImageData12' - Type: UINT16 (2 [byte]) - Size: [700][830] - Data field: 'ImageData13' - Type: UINT16 (2 [byte]) - Size: [700][830] - Data field: 'ImageData14' - Type: UINT16 (2 [byte]) - Size: [700][830] - type : GRID [not available] - type : POINT [not available] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [<HDF-EOS FILE INFORMATIONS] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 21.03.2025 Time : 21:05:03 Pageformat: DA4L << << Vectors : 1301 Warnings: 0 Fileformat: PDF << << Metafile: ./srt/fscan_eos_xpl_TIR_Swath_ImageData10.pdf << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Plan Lon.: a=-20173.501061, b=4254.037309, c=-5.077153 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 21.03.2025 Time : 21:05:03 Pageformat: DA4L << << Vectors : 1300 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/fscan_eos_xpl_TIR_Swath_Longitude.svg << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Plan Lat.: a=61297.404633, b=290797.808838, c=48.661846 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 21.03.2025 Time : 21:05:03 Pageformat: DA4L << << Vectors : 1302 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/fscan_eos_xpl_TIR_Swath_Latitude.svg << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< stn=lonn*latn=988*588=580944 Duree de l'interpolation bilineaire=0.024125 [s] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 21.03.2025 Time : 21:05:04 Pageformat: DA4L << << Vectors : 8597 Warnings: 0 Fileformat: PDF << << Metafile: ./srt/fscan_eos_xpl_TIR_Swath_ImageData10_rectif << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [<..\xpl\src\sclhdf.eos.xpl.cpp.fscan_eos_xpl]