// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* // ** Copyright UCAR (c) 1990 - 2016 // ** University Corporation for Atmospheric Research (UCAR) // ** National Center for Atmospheric Research (NCAR) // ** Boulder, Colorado, USA // ** BSD licence applies - redistribution and use in source and binary // ** forms, with or without modification, are permitted provided that // ** the following conditions are met: // ** 1) If the software is modified to produce derivative works, // ** such modified software should be clearly marked, so as not // ** to confuse it with the version available from UCAR. // ** 2) Redistributions of source code must retain the above copyright // ** notice, this list of conditions and the following disclaimer. // ** 3) Redistributions in binary form must reproduce the above copyright // ** notice, this list of conditions and the following disclaimer in the // ** documentation and/or other materials provided with the distribution. // ** 4) Neither the name of UCAR nor the names of its contributors, // ** if any, may be used to endorse or promote products derived from // ** this software without specific prior written permission. // ** DISCLAIMER: THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS // ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED // ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* /////////////////////////////////////////////////////////////// // IwrfMoments // // Handle moments conversion to/from IWRF // // Mike Dixon, RAP, NCAR // P.O.Box 3000, Boulder, CO, 80307-3000, USA // // Feb 2012 // /////////////////////////////////////////////////////////////// #include #include #include using namespace std; ///////////////////////////////////////////// // convert from DsrRadar enums to Radx enums Radx::SweepMode_t IwrfMoments::getRadxSweepMode(int dsrScanMode) { switch (dsrScanMode) { case DS_RADAR_SECTOR_MODE: return Radx::SWEEP_MODE_SECTOR; case DS_RADAR_COPLANE_MODE: return Radx::SWEEP_MODE_COPLANE; case DS_RADAR_RHI_MODE: return Radx::SWEEP_MODE_RHI; case DS_RADAR_VERTICAL_POINTING_MODE: return Radx::SWEEP_MODE_VERTICAL_POINTING; case DS_RADAR_MANUAL_MODE: return Radx::SWEEP_MODE_POINTING; case DS_RADAR_SURVEILLANCE_MODE: return Radx::SWEEP_MODE_AZIMUTH_SURVEILLANCE; case DS_RADAR_EL_SURV_MODE: return Radx::SWEEP_MODE_ELEVATION_SURVEILLANCE; case DS_RADAR_SUNSCAN_MODE: return Radx::SWEEP_MODE_SUNSCAN; case DS_RADAR_POINTING_MODE: return Radx::SWEEP_MODE_POINTING; case DS_RADAR_FOLLOW_VEHICLE_MODE: return Radx::SWEEP_MODE_FOLLOW_VEHICLE; case DS_RADAR_SUNSCAN_RHI_MODE: return Radx::SWEEP_MODE_SUNSCAN_RHI; default: return Radx::SWEEP_MODE_AZIMUTH_SURVEILLANCE; } } Radx::PolarizationMode_t IwrfMoments::getRadxPolarizationMode(int dsrPolMode) { switch (dsrPolMode) { case DS_POLARIZATION_HORIZ_TYPE: return Radx::POL_MODE_HORIZONTAL; case DS_POLARIZATION_VERT_TYPE: return Radx::POL_MODE_VERTICAL; case DS_POLARIZATION_DUAL_TYPE: return Radx::POL_MODE_HV_SIM; case DS_POLARIZATION_DUAL_HV_ALT: return Radx::POL_MODE_HV_ALT; case DS_POLARIZATION_DUAL_HV_SIM: return Radx::POL_MODE_HV_SIM; case DS_POLARIZATION_DUAL_H_XMIT: return Radx::POL_MODE_HV_H_XMIT; case DS_POLARIZATION_DUAL_V_XMIT: return Radx::POL_MODE_HV_V_XMIT; case DS_POLARIZATION_RIGHT_CIRC_TYPE: case DS_POLARIZATION_LEFT_CIRC_TYPE: return Radx::POL_MODE_CIRCULAR; case DS_POLARIZATION_ELLIPTICAL_TYPE: default: return Radx::POL_MODE_HORIZONTAL; } } Radx::FollowMode_t IwrfMoments::getRadxFollowMode(int dsrMode) { switch (dsrMode) { case DS_RADAR_FOLLOW_MODE_SUN: return Radx::FOLLOW_MODE_SUN; case DS_RADAR_FOLLOW_MODE_VEHICLE: return Radx::FOLLOW_MODE_VEHICLE; case DS_RADAR_FOLLOW_MODE_AIRCRAFT: return Radx::FOLLOW_MODE_AIRCRAFT; case DS_RADAR_FOLLOW_MODE_TARGET: return Radx::FOLLOW_MODE_TARGET; case DS_RADAR_FOLLOW_MODE_MANUAL: return Radx::FOLLOW_MODE_MANUAL; default: return Radx::FOLLOW_MODE_NONE; } } Radx::PrtMode_t IwrfMoments::getRadxPrtMode(int dsrMode) { switch (dsrMode) { case DS_RADAR_PRF_MODE_FIXED: return Radx::PRT_MODE_FIXED; case DS_RADAR_PRF_MODE_STAGGERED_2_3: case DS_RADAR_PRF_MODE_STAGGERED_3_4: case DS_RADAR_PRF_MODE_STAGGERED_4_5: return Radx::PRT_MODE_STAGGERED; default: return Radx::PRT_MODE_FIXED; } } double IwrfMoments::getRadxPrtRatio(int prtMode) { switch (prtMode) { case DS_RADAR_PRF_MODE_FIXED: return 1.0; case DS_RADAR_PRF_MODE_STAGGERED_2_3: return 2.0 / 3.0; case DS_RADAR_PRF_MODE_STAGGERED_3_4: return 3.0 / 4.0; case DS_RADAR_PRF_MODE_STAGGERED_4_5: return 4.0 / 5.0; default: return 1.0; } }