Ignore:
Timestamp:
07/24/12 10:36:19 (13 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 12703

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/modules/Ll2xy/Ll2xy.cpp

    r12331 r12706  
    2525        /*checks on arguments on the matlab side: */
    2626        if (nlhs > NLHS) {
    27                 Ll2xyUsage(); _error_("Ll2xy usage error");
     27                Ll2xyUsage(); _error2_("Ll2xy usage error");
    2828        }
    2929        if (nrhs < NRHS) {
    30                 Ll2xyUsage(); _error_("Ll2xy usage error");
     30                Ll2xyUsage(); _error2_("Ll2xy usage error");
    3131        }
    3232
     
    4040        if(options->GetOption("central_meridian") || options->GetOption("standard_parallel")){
    4141                options->Get(&cm,"central_meridian");
    42                 if (verbose) printf("  cm=%g\n",cm);
     42                if (verbose) _printLine_("  cm=" << cm);
    4343                options->Get(&sp,"standard_parallel");
    44                 if (verbose) printf("  sp=%g\n",sp);
     44                if (verbose) _printLine_("  sp=" << sp);
    4545        }
    4646
    4747        /*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.");}
    5050        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).");
    5454
    5555        x=(double*)mxMalloc(ncoord*sizeof(double));
     
    7474
    7575void Ll2xyUsage(void){
    76         _printf_(true,"Ll2xy - lat/long to x/y coordinate transformation module:\n");
    77         _printf_(true,"\n");
    78         _printf_(true,"   This module transforms lat/long to x/y coordinates.\n");
    79         _printf_(true,"\n");
    80         _printf_(true,"   Usage:\n");
    81         _printf_(true,"      [x,y]=Ll2xy(lat,lon,sgn,'param name',param,...);\n");
    82         _printf_(true,"\n");
    83         _printf_(true,"      lat         latitude coordinates (double vector)\n");
    84         _printf_(true,"      lon         longitude coordinates (double vector)\n");
    85         _printf_(true,"      sgn         sign for hemisphere (double, +1 (north) or -1 (south))\n");
    86         _printf_(true,"\n");
    87         _printf_(true,"      central_meridian     central meridian (double, optional, but must specify with sp)\n");
    88         _printf_(true,"      standard_parallel    standard parallel (double, optional, but must specify with cm)\n");
    89         _printf_(true,"\n");
    90         _printf_(true,"      x           x coordinates (double vector)\n");
    91         _printf_(true,"      y           y coordinates (double vector)\n");
    92         _printf_(true,"\n");
    93         _printf_(true,"   Examples:\n");
    94         _printf_(true,"      [x,y]=Ll2xy(lat,lon, 1);\n");
    95         _printf_(true,"      [x,y]=Ll2xy(lat,lon, 1,'central_meridian',45,'standard_parallel',70);\n");
    96         _printf_(true,"      [x,y]=Ll2xy(lat,lon,-1,'central_meridian', 0,'standard_parallel',71);\n");
    97         _printf_(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_("");
    9898}
Note: See TracChangeset for help on using the changeset viewer.