当前位置: 首页>>代码示例>>C++>>正文


C++ errRep函数代码示例

本文整理汇总了C++中errRep函数的典型用法代码示例。如果您正苦于以下问题:C++ errRep函数的具体用法?C++ errRep怎么用?C++ errRep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了errRep函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: smf_validate_smfData

int smf_validate_smfData( const smfData * data, int hashdr, int hasfile,
                          int *status ) {

  if (*status != SAI__OK) return 0;

  if ( data == NULL ) {
    *status = SAI__ERROR;
    errRep( FUNC_NAME,
            "Supplied smfData is a NULL pointer. Possible programming error.",
            status);
    return 0;
  }

  if ( hasfile && data->file == NULL ) {
    *status = SAI__ERROR;
    errRep( FUNC_NAME,
            "No file associated with supplied smfData. "
            "Possible programming error.", status );
    return 0;
  }

  if (hashdr) return smf_validate_smfHead( data->hdr, 0, 0, status );

  return 1;

}
开发者ID:astrobuff,项目名称:starlink,代码行数:26,代码来源:smf_validate_smfData.c

示例2: smf_check_flat

void smf_check_flat ( const smfData *data, int *status ) {

  smfDA *da;
  smf_dtype dtype;

  if ( *status != SAI__OK ) return;
  if ( !data ) {
    *status = SAI__ERROR;
    errRep("", "Error checking if data are flatfielded. smfData is null."
           " (possible programming error)", status );
    return;
  }

  /* Retrieve the smfDa struct */
  da = data->da;
  dtype = data->dtype;

  /* Data need flatfielding if da is defined */
  if ( da == NULL || dtype == SMF__DOUBLE) {
    /* No raw data struct => data flatfielded */
    *status = SMF__FLATN;
    errRep(FUNC_NAME, "Data are already flatfielded", status);
  }

}
开发者ID:astrobuff,项目名称:starlink,代码行数:25,代码来源:smf_check_flat.c

示例3: fts2_getmirrorpositions

void fts2_getmirrorpositions(smfData* data, double* positions, int* size, int* status)
{
  if(*status != SAI__OK) { return; }

  char ftsMode[SZFITSTR];
  size_t count      = 0;    /* Size */
  HDSLoc* hdsLoc    = NULL; /* Pointer to HDS location */
  HDSLoc* hdsLocPos = NULL; /* Pointer to mirror positions */

  smf_fits_getS(data->hdr, "FTS_MODE", ftsMode, sizeof(ftsMode), status);
  if(strncmp(ftsMode, "FSCAN", 5) == 0 ) {
    hdsLoc = smf_get_xloc(data, "JCMTSTATE", "EXT", "READ", 0, 0, status);
    datFind(hdsLoc, "FTS_POS", &hdsLocPos, status);
    datSize(hdsLocPos, &count, status);
    datGetVD(hdsLocPos, count, positions, &count, status);
    *size = (int) count;
  } else if(strncmp(ftsMode, "STEPINT", 7) == 0 ) {
    *status = SAI__ERROR;
    errRep(FUNC_NAME, "STEPINT mode is NOT supported!", status);
  } else {
    *status = SAI__ERROR;
    errRep(FUNC_NAME, "Unknown Scan Mode is found!", status);
  }

  if(hdsLoc) { datAnnul(&hdsLoc, status); }
  if(hdsLocPos) { datAnnul(&hdsLocPos, status); }
}
开发者ID:andrecut,项目名称:starlink,代码行数:27,代码来源:fts2_getmirrorpositions.c

示例4: smf_find_dateobs

void smf_find_dateobs( const smfHead* hdr, double *dateobs, double *dateend,
                       int *status) {

  /* initialise error condition before checking status */
  if (dateobs) *dateobs = VAL__BADD;
  if (dateend) *dateend = VAL__BADD;

  if (*status != SAI__OK) return;

  if (dateobs == NULL && dateend == NULL) {
    *status = SAI__ERROR;
    errRep(" ", FUNC_NAME " called with both dateobs and dateend NULL"
           " (possible programming error)", status);
    return;
  }

  if (!smf_validate_smfHead(hdr, 0, 0, status)) return;

  if (!hdr->allState && !hdr->fitshdr) {
    *status = SAI__ERROR;
    errRep( " ","Can not find date of observation without FITS header "
            "or JCMTSTATE extension", status );
    return;
  }

  if (dateobs) *dateobs = smf__find_utc( hdr, 1, status );
  if (dateend) *dateend = smf__find_utc( hdr, 0, status );
  return;
}
开发者ID:astrobuff,项目名称:starlink,代码行数:29,代码来源:smf_find_dateobs.c

示例5: smf_map_getpixsize

double smf_map_getpixsize( const smfData *data, int *status ) {

  double at[3]={0,0,0};         /* Grid coords. where we check the scale */
  int naxes;                    /* Number of axes */
  double pixsize=VAL__BADD;     /* The pixel size */
  double pixscl[3];

  if( *status != SAI__OK ) return pixsize;

  if( !data ) {
    *status = SAI__ERROR;
    errRep( "", FUNC_NAME ": NULL smfData supplied", status );
    return pixsize;
  }

  if( !data->hdr || !data->hdr->wcs ) {
    *status = SAI__ERROR;
    errRep( "", FUNC_NAME ": no header, or missing WCS", status );
    return pixsize;
  }

  /* Check number of axes in the frameset. It will usually be 3 because
     we have a frequency axis of length 1 for normal SMURF maps */
  naxes = astGetI( data->hdr->wcs, "naxes" );
  if( (naxes < 2) || (naxes > 3) ) {
    *status = SAI__ERROR;
    errRep( "", FUNC_NAME
            ": Frameset does not appear to corresond to a 2-d map", status );
    return pixsize;
  }

  /* Take the average of the x- and y-pixel spacings in radians at the
     centre of the map, and then convert to arcsec */

  at[0] = -(data->lbnd[0]-1);
  at[1] = -(data->lbnd[1]-1);

  kpgPixsc( data->hdr->wcs, at, pixscl, NULL, NULL, 0, status );
  if( *status == SAI__OK ) {
    pixsize = (pixscl[0] + pixscl[1])/2.;
    pixsize *= DR2AS;

    msgOutiff( MSG__DEBUG, "", FUNC_NAME
               ": determined pixel size from WCS at map coordinates (%g,%g) "
               "to be %g arcsec", status, at[0], at[1], pixsize );
  } else {
    *status = SAI__ERROR;
    errRep( "", FUNC_NAME ": could not determine pixel size from WCS", status );
  }


  return pixsize;
}
开发者ID:astrobuff,项目名称:starlink,代码行数:53,代码来源:smf_map_getpixsize.c

示例6: smf_dtype_sz

size_t smf_dtype_sz( const smf_dtype dtype, int *status ) {

  size_t retval = 0;

  if (*status != SAI__OK) return retval;

  /* now switch on data type */
  switch( dtype ) {
  case SMF__INTEGER:
    retval = sizeof(int);
    break;
  case SMF__FLOAT:
    retval = sizeof(float);
    break;
  case SMF__DOUBLE:
    retval = sizeof(double);
    break;
  case SMF__USHORT:
    retval = sizeof(unsigned short);
    break;
  case SMF__UBYTE:
    retval = sizeof(unsigned char);
    break;
  default:
    retval = 0;
    *status = SMF__BDTYP;
    msgSeti( "TC", dtype );
    errRep(FUNC_NAME, "Unable to determine size of datatype. Data typecode was ^TC", status );
  }

  return retval;
}
开发者ID:astrobuff,项目名称:starlink,代码行数:32,代码来源:smf_dtype_sz.c

示例7: smf_map_or_malloc

void * smf_map_or_malloc (size_t nelem, smf_dtype type, int zero, int indf,
                          const char * comp, int *status ) {

  void *pntr[3];     /* ndfMap pointers */
  int nout = 0;      /* number of elements mapped */

  if (*status != SAI__OK) return NULL;

  /* just malloc if we do not have a file */
  if ( indf == NDF__NOID) {
     if( zero ) {
       return astCalloc( nelem, smf_dtype_sz(type, status) );
     } else {
       return astMalloc( nelem*smf_dtype_sz(type, status) );
     }
  }

  ndfMap( indf, comp, smf_dtype_str(type, status),
          (zero ? "WRITE/ZERO" : "WRITE"), pntr, &nout, status);

  if (nelem != (size_t)nout && *status == SAI__OK) {
    ndfUnmap( indf, comp, status );
    *status = SAI__ERROR;
    msgSetc( "COMP", comp );
    msgSeti( "ORI", nelem );
    msgSeti( "NOUT", nout );
    errRep(" ", "Mapping ^COMP in NDF but size differs from that listed in smfData attributes (^ORI != ^NOUT)", status);
    pntr[0] = NULL;
  }
  return pntr[0];
}
开发者ID:astrobuff,项目名称:starlink,代码行数:31,代码来源:smf_map_or_malloc.c

示例8: smf_create_smfDA

smfDA *
smf_create_smfDA( int * status ) {

  smfDA * da = NULL;   /* File components */

  if (*status != SAI__OK) return NULL;

  da = astMalloc( 1*sizeof(*da) );

  if (*status != SAI__OK) {
    errRep(FUNC_NAME,"Unable to allocate memory for smfDA structure",
	   status );
    return NULL;
  }

  /* Initialise smfDA */
  da->flatcal = NULL;
  da->flatpar = NULL;
  da->dksquid = NULL;
  da->flatmeth = SMF__FLATMETH_NULL;
  da->nflat = 0;
  da->refres = VAL__BADD;
  da->heatval = NULL;
  da->nheat = 0;

  return da;
}
开发者ID:astrobuff,项目名称:starlink,代码行数:27,代码来源:smf_create_smfDA.c

示例9: smf_model_getptr

smf_calcmodelptr smf_model_getptr( smf_modeltype type, int *status) {

  /* Local Variables */
  smf_calcmodelptr retval = NULL;

  /* Main routine */
  if (*status != SAI__OK) return NULL;

  switch( type ) {

  case SMF__COM:
    retval = (smf_calcmodelptr) &smf_calcmodel_com;
    break;

  case SMF__EXT:
    retval = (smf_calcmodelptr) &smf_calcmodel_ext;
    break;

  case SMF__NOI:
    retval = (smf_calcmodelptr) &smf_calcmodel_noi;
    break;

  case SMF__DKS:
    retval = (smf_calcmodelptr) &smf_calcmodel_dks;
    break;

  case SMF__GAI:
    retval = (smf_calcmodelptr) &smf_calcmodel_gai;
    break;

  case SMF__FLT:
    retval = (smf_calcmodelptr) &smf_calcmodel_flt;
    break;

  case SMF__PLN:
    retval = (smf_calcmodelptr) &smf_calcmodel_pln;
    break;

  case SMF__SMO:
    retval = (smf_calcmodelptr) &smf_calcmodel_smo;
    break;

  case SMF__TWO:
    retval = (smf_calcmodelptr) &smf_calcmodel_two;
    break;

  case SMF__TMP:
    retval = (smf_calcmodelptr) &smf_calcmodel_tmp;
    break;

  default:
    msgSetc( "NM", smf_model_getname(type, status) );
    *status = SAI__ERROR;
    errRep( "", FUNC_NAME
            ": Invalid smf_modeltype given (^NM), or no function available.",
	   status);
  }

  return retval;
}
开发者ID:andrecut,项目名称:starlink,代码行数:60,代码来源:smf_model_getptr.c

示例10: smf_dream_getgrid

void smf_dream_getgrid( const AstKeyMap *keymap, double *gridstep, int *ngrid,
                        int gridminmax[4], int gridpts[DREAM__MXGRID][2],
                        int *status) {

  /* Local variables */
  int k;                     /* Loop counter */
  int tmp;                   /* General purpose temporary variable */
  int xgrid;                 /* X position in reconstruction grid */
  int ygrid;                 /* Y position in reconstruction grid */

  /* Check status */
  if (*status != SAI__OK) return;

  /* Retrieve relevant settings from config file */
  if( !astMapGet0D( keymap, "GRIDSTEP", gridstep ) ) {
    *gridstep = 6.28; /* Define default value */
  }

  /* Get the grid extent, prefill it just in case */
  gridminmax[XMIN] = 0;
  gridminmax[XMAX] = 1;
  gridminmax[YMIN] = 0;
  gridminmax[YMAX] = 1;
  if( !astMapGet1I( keymap, "GRIDMINMAX", 4, &tmp, gridminmax ) ) {
    *status = SAI__ERROR;
    errRep(FUNC_NAME, "GRIDXMIN unspecified", status);
  }

  if ( *status == SAI__OK ) {
    /* Check gridxmax > gridxmin etc: swap them round by default? */
    if ( gridminmax[XMIN] > gridminmax[XMAX] ) {
      msgOutif(MSG__VERB," ", "Xmin > Xmax: swapping them round", status );
      tmp = gridminmax[XMIN];
      gridminmax[XMIN] = gridminmax[XMAX];
      gridminmax[XMAX] = tmp;
    }
    if ( gridminmax[YMIN] > gridminmax[YMAX] ) {
      msgOutif(MSG__VERB," ", "Ymin > Ymax: swapping them round", status );
      tmp = gridminmax[YMIN];
      gridminmax[YMIN] = gridminmax[YMAX];
      gridminmax[YMAX] = tmp;
    }

    /* Create gridpts array from min/max extent */
    *ngrid = ((gridminmax[XMAX] - gridminmax[XMIN] + 1) *
	      (gridminmax[YMAX] - gridminmax[YMIN] + 1));
    k = 0;
    for ( ygrid=gridminmax[YMIN]; ygrid<=gridminmax[YMAX]; ygrid++ ) {
      for ( xgrid=gridminmax[XMIN]; xgrid<=gridminmax[XMAX]; xgrid++ ) {
        gridpts[k][0] = xgrid;
        gridpts[k][1] = ygrid;
        k++;
      }
    }

  }

}
开发者ID:astrobuff,项目名称:starlink,代码行数:58,代码来源:smf_dream_getgrid.c

示例11: adamtest

void adamtest ( int * status ) {

  if (*status != SAI__OK) return;

  msgOut("MSG1", "This text should not appear for msgOut", status );
  msgSeti("TEST", 5);
  msgOut(" ", "     Testing ^^ %% % $ $$ %ET - $TESTOBJ ^TEST",status);
  msgOut( " ", "  Testing $ %ET Again %%ET ^^$", status );
  msgOut(" ", "$$DOLLAR ^^CARET %%PERCENT at start of string", status);

  /* Make up a bad status */
  *status = MSG__SYNER;
  errRep( " ", "This is the error message ^STATUS embedded",
          status );

  errRep( "MSG1", "This text should not appear", status );

  errRep( " ", "Should be expanded: %ET as 'EXPOSURE_TIME'", status);

  errRep( " ", "Object $TESTOBJ %s %XX should be somewhere", status );

  errRep( " ", "Multiple %ET and ^STATUS and %TESTOBJ and %BLAH", status );

  errRep( " ", "Double up %% escape $$ characters", status );

  msgSetc( "X1", STRING );
  msgSetc( "X2", STRING);
  msgSetc( "X3", STRING);
  msgSetc( "X4", STRING);
  msgSetc( "X5", STRING);
  msgSetc( "X6", STRING);
  errRep( " ","Overflow: ^X1:^X2:^X3:^X4:^X5:^X6", status );

}
开发者ID:astrobuff,项目名称:starlink,代码行数:34,代码来源:adamtest.c

示例12: errRep

AstKeyMap *smf_subinst_keymap( smf_subinst_t subinst, const smfData * indata,
                               const Grp * igrp, size_t idx, int * status ) {

  const smfHead * hdr = NULL;        /* Header of file to be examined */
  size_t i;
  smfData * sub_data = NULL;         /* File to be examined */
  AstKeyMap * sub_instruments;       /* Keymap to be filled */

  if (*status != SAI__OK) return NULL;

  if (subinst == SMF__SUBINST_NONE && !indata && !igrp) {
    *status = SAI__ERROR;
    errRep( "", "Must supply either a subinst, a smfData or a Grp"
            " (possible programming error)", status );
    return NULL;
  }

  /* Create new keymap */
  sub_instruments = astKeyMap( " " );

  /* prefill with the list of known sub-instruments. */
  for (i = 0; i < SMF__SUBINST_NSUBINST; i++ ) {
    const char * substr = smf_subinst_str( i, status );
    if (substr) astMapPut0I( sub_instruments, substr, 0, NULL );
  }

  /* If the current sub-instrument has not been supplied, get it from the file.
     Use indata in preference to the group */
  if( subinst == SMF__SUBINST_NONE ) {
    if (indata) {
      hdr = indata->hdr;
    } else {
      smf_open_file( igrp, idx, "READ", SMF__NOCREATE_DATA, &sub_data, status );
      if (sub_data) {
        hdr = sub_data->hdr;
      }
    }
    if (hdr) subinst = smf_calc_subinst( hdr, status );
  }

  /* flag this as being the relevant sub-instrument */
  if (subinst != SMF__SUBINST_NSUBINST ) {
    const char * substr = smf_subinst_str( subinst, status );
    if (substr) {
      astMapPut0I( sub_instruments, substr, 1, NULL );
    }
  }

  if (sub_data) smf_close_file( &sub_data, status );

  /* Free the keymap if we have bad status */
  if (*status != SAI__OK && sub_instruments) {
    sub_instruments = astAnnul( sub_instruments );
  }

  return sub_instruments;
}
开发者ID:andrecut,项目名称:starlink,代码行数:57,代码来源:smf_subinst_keymap.c

示例13: smf_raw2current

double smf_raw2current( smfHead *hdr, int *status ) {

  /* Local Variables */
  double raw2current=VAL__BADD; /* Conversion factor */
  double dateobs=VAL__BADD;     /* UTC MJD at observation start */
  double dateconst=VAL__BADD;   /* UTC MJD when constant changes */
  AstTimeFrame *tf = NULL;      /* time frame for date conversion */

  /* Main routine */
  if( *status != SAI__OK ) return VAL__BADD;

  /* Get the MJD for start of the observation */
  smf_find_dateobs( hdr, &dateobs, NULL, status );

  /* Convert ISO dates for when the values changed to MJDs for comparison */
  tf = astTimeFrame( " " );
  astSet( tf, "TimeScale=UTC" );
  astSet( tf, "TimeOrigin=%s", "2011-06-04T00:00:00" );
  dateconst = astGetD( tf, "TimeOrigin" );

  if( (*status==SAI__OK) && (dateobs!=VAL__BADD) && (dateconst!=VAL__BADD) ) {
    if( dateobs < dateconst) {

      /* Prior to 2011-06-04 we use the following value. According to
         Dan 1.52e-13 was the measured factor for mce mode 1
         (unfiltered output) on some old prototype array. The 3.3
         multiplier corrected the conversion for mce mode 2 (filtered
         output). Note that SIMULT is defined in smurf_par.h */

      raw2current = SIMULT * 3.3 * 1.52e-13;
    } else {

      /* Later the MCE low-pass filter was modified to accomodate a
         faster sample rate. With the new firmware on s8a the measured
         factor for mce mode 1 (unfiltered output) is 1.56e-13 and to
         correct for mce mode 2 (filtered output) requires a 1/1.15
         multiplier. */

      raw2current = SIMULT * 1.56e-13 / 1.15;
    }
  }

  if( (*status==SAI__OK) && (raw2current==VAL__BADD) ) {
    *status = SAI__ERROR;
    errRep( "", FUNC_NAME ": was unable to determine conversion factor",
            status );
  }

  msgOutiff( MSG__DEBUG, "", FUNC_NAME ": calculated a value of %lf", status,
             raw2current );

  /* Clean up */
  tf = astAnnul( tf );

  return raw2current;
}
开发者ID:astrobuff,项目名称:starlink,代码行数:56,代码来源:smf_raw2current.c

示例14: error

void    error(int num, char *msg1, char *msg2)
{
    int status;

    status = SAI__ERROR;
    msgSetc( "TOK1", msg1 );
    msgSetc( "TOK2", msg2 );
    errRep( " ", "^TOK1 ^TOK2", &status );

    longjmp( env, num );
}
开发者ID:Starlink,项目名称:starextract,代码行数:11,代码来源:fitsmisc.c

示例15: smf_addmap1

void smf_addmap1( double *map1, double *mapweight1, int *hitsmap1,
                  double *mapvar1, smf_qual_t *mapqual1, double *map2,
                  double *mapweight2, int *hitsmap2, double *mapvar2,
                  smf_qual_t *mapqual2, dim_t msize, int *status ) {

  /* Local Variables */
  dim_t i;                   /* Loop counter */

  /* Main routine */
  if (*status != SAI__OK) return;

  /* Check for NULL inputs */
  if( (map1==NULL) || (mapweight1==NULL) || (hitsmap1==NULL) ||
      (mapvar1==NULL) || (map2==NULL) || (mapweight2==NULL) ||
      (hitsmap2==NULL) || (mapvar2==NULL) ) {
      *status = SAI__ERROR;
      errRep(FUNC_NAME, "Addmap failed due to NULL inputs.", status);
      return;
  }

  /* Loop over every pixel and store the weighted values in arrays associated
     with map1 */

  for( i=0; i<msize; i++ ) {
    if( (map1[i] == VAL__BADD) || (mapvar1[i] == VAL__BADD) ) {
      /* If bad pixel in map1 just copy map2 regardless */
      map1[i] = map2[i];
      mapweight1[i] = mapweight2[i];
      hitsmap1[i] = hitsmap2[i];
      mapvar1[i] = mapvar2[i];
      mapqual1[i] = mapqual2[i];
    } else if( (map2[i] != VAL__BADD) && (mapvar2[i] != VAL__BADD) ) {
      /* Add together if both maps have good pixels */
      if( (mapvar1[i]<=0) || (mapvar2[i]<=0) ) {
	*status = SAI__ERROR;
	errRepf("", FUNC_NAME ": invalid variance(s) <=0 detected (%g and %g)", status,
                mapvar1[i], mapvar2[i]);
	return;
      } else {
        double w = 1./mapvar1[i] + 1./mapvar2[i];

        map1[i] = (map1[i]/mapvar1[i] + map2[i]/mapvar2[i])/w;
        mapweight1[i] += mapweight2[i];
        hitsmap1[i] += hitsmap2[i];
        mapqual1[i] &= mapqual2[i];
	mapvar1[i] = 1. / w;
      }
    }
  }

}
开发者ID:andrecut,项目名称:starlink,代码行数:51,代码来源:smf_addmap1.c


注:本文中的errRep函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。