Changeset 12706 for issm/trunk/src/modules/Ll2xy/Ll2xy.cpp
- Timestamp:
- 07/24/12 10:36:19 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/modules/Ll2xy/Ll2xy.cpp
r12331 r12706 25 25 /*checks on arguments on the matlab side: */ 26 26 if (nlhs > NLHS) { 27 Ll2xyUsage(); _error _("Ll2xy usage error");27 Ll2xyUsage(); _error2_("Ll2xy usage error"); 28 28 } 29 29 if (nrhs < NRHS) { 30 Ll2xyUsage(); _error _("Ll2xy usage error");30 Ll2xyUsage(); _error2_("Ll2xy usage error"); 31 31 } 32 32 … … 40 40 if(options->GetOption("central_meridian") || options->GetOption("standard_parallel")){ 41 41 options->Get(&cm,"central_meridian"); 42 if (verbose) printf(" cm=%g\n",cm);42 if (verbose) _printLine_(" cm=" << cm); 43 43 options->Get(&sp,"standard_parallel"); 44 if (verbose) printf(" sp=%g\n",sp);44 if (verbose) _printLine_(" sp=" << sp); 45 45 } 46 46 47 47 /*some checks*/ 48 if (verbose) printf("Checking inputs:\n");49 if (nlat != nlon) _error_("Must have same number of lat[%d] and lon[%d] coordinates.",nlat,nlon);48 if (verbose) _printLine_("Checking inputs:"); 49 if (nlat != nlon){_error2_("Must have same number of lat[" << nlat << "] and lon[" << nlon << "] coordinates.");} 50 50 else ncoord=nlat; 51 if (sgn != +1 && sgn != -1) _error _("Hemisphere sgn=%d must be +1 (north) or -1 (south).",sgn);52 if (fabs(cm) > 180.) _error _("Central meridian cm=%g must be between -180 (west) and +180 (east) degrees.",cm);53 if (sp < 0. || sp > 90.) _error _("Standard parallel sp=%g must be between 0 and 90 degrees (in specified hemisphere).",sp);51 if (sgn != +1 && sgn != -1) _error2_("Hemisphere sgn=" << sgn << " must be +1 (north) or -1 (south)."); 52 if (fabs(cm) > 180.) _error2_("Central meridian cm=" << cm << " must be between -180 (west) and +180 (east) degrees."); 53 if (sp < 0. || sp > 90.) _error2_("Standard parallel sp=" << sp << " must be between 0 and 90 degrees (in specified hemisphere)."); 54 54 55 55 x=(double*)mxMalloc(ncoord*sizeof(double)); … … 74 74 75 75 void Ll2xyUsage(void){ 76 _p rintf_(true,"Ll2xy - lat/long to x/y coordinate transformation module:\n");77 _p rintf_(true,"\n");78 _p rintf_(true," This module transforms lat/long to x/y coordinates.\n");79 _p rintf_(true,"\n");80 _p rintf_(true," Usage:\n");81 _p rintf_(true," [x,y]=Ll2xy(lat,lon,sgn,'param name',param,...);\n");82 _p rintf_(true,"\n");83 _p rintf_(true," lat latitude coordinates (double vector)\n");84 _p rintf_(true," lon longitude coordinates (double vector)\n");85 _p rintf_(true," sgn sign for hemisphere (double, +1 (north) or -1 (south))\n");86 _p rintf_(true,"\n");87 _p rintf_(true," central_meridian central meridian (double, optional, but must specify with sp)\n");88 _p rintf_(true," standard_parallel standard parallel (double, optional, but must specify with cm)\n");89 _p rintf_(true,"\n");90 _p rintf_(true," x x coordinates (double vector)\n");91 _p rintf_(true," y y coordinates (double vector)\n");92 _p rintf_(true,"\n");93 _p rintf_(true," Examples:\n");94 _p rintf_(true," [x,y]=Ll2xy(lat,lon, 1);\n");95 _p rintf_(true," [x,y]=Ll2xy(lat,lon, 1,'central_meridian',45,'standard_parallel',70);\n");96 _p rintf_(true," [x,y]=Ll2xy(lat,lon,-1,'central_meridian', 0,'standard_parallel',71);\n");97 _p rintf_(true,"\n");76 _pprintLine_("Ll2xy - lat/long to x/y coordinate transformation module:"); 77 _pprintLine_(""); 78 _pprintLine_(" This module transforms lat/long to x/y coordinates."); 79 _pprintLine_(""); 80 _pprintLine_(" Usage:"); 81 _pprintLine_(" [x,y]=Ll2xy(lat,lon,sgn,'param name',param,...);"); 82 _pprintLine_(""); 83 _pprintLine_(" lat latitude coordinates (double vector)"); 84 _pprintLine_(" lon longitude coordinates (double vector)"); 85 _pprintLine_(" sgn sign for hemisphere (double, +1 (north) or -1 (south))"); 86 _pprintLine_(""); 87 _pprintLine_(" central_meridian central meridian (double, optional, but must specify with sp)"); 88 _pprintLine_(" standard_parallel standard parallel (double, optional, but must specify with cm)"); 89 _pprintLine_(""); 90 _pprintLine_(" x x coordinates (double vector)"); 91 _pprintLine_(" y y coordinates (double vector)"); 92 _pprintLine_(""); 93 _pprintLine_(" Examples:"); 94 _pprintLine_(" [x,y]=Ll2xy(lat,lon, 1);"); 95 _pprintLine_(" [x,y]=Ll2xy(lat,lon, 1,'central_meridian',45,'standard_parallel',70);"); 96 _pprintLine_(" [x,y]=Ll2xy(lat,lon,-1,'central_meridian', 0,'standard_parallel',71);"); 97 _pprintLine_(""); 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.