Elaboradar  0.1

◆ write_dbz_coefficients()

void elaboradar::Assets::write_dbz_coefficients ( const radarelab::algo::DBZ dbz)

Write in $OUTPUT_Z_LOWRIS_DIR/MP_coeff the MP coefficients.

Parametri
[in]dbz- DBZ object with MP coefficients

Definizione alla linea 452 del file assets.cpp.

453 {
454  const char* dirname = getenv("OUTPUT_Z_LOWRIS_DIR");
455  if (!dirname) throw runtime_error("OUTPUT_Z_LOWRIS_DIR is not set");
456  string fname(dirname);
457  fname += "/MP_coeff";
458  File out(logging_category);
459  out.open(fname, "wb", "MP coefficients");
460 
461  unsigned char MP_coeff[2]; /* a/10 e b*10 per scrivere come 2 byte */
462  MP_coeff[0]=(unsigned char)(dbz.aMP/10);
463  MP_coeff[1]=(unsigned char)(dbz.bMP*10);
464 
465  fwrite(MP_coeff, sizeof(MP_coeff), 1, out);
466 }
Open a file taking its name from a given env variable.
Definition: utils.h:22

Referenzia radarelab::File::open().