diff --git a/data/table_files/met_header_columns_V12.0.txt b/data/table_files/met_header_columns_V12.0.txt index 3f4785edf5..9795951640 100644 --- a/data/table_files/met_header_columns_V12.0.txt +++ b/data/table_files/met_header_columns_V12.0.txt @@ -7,7 +7,7 @@ V12.0 : STAT : MCTC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID V12.0 : STAT : MCTS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_CAT ACC ACC_NCL ACC_NCU ACC_BCL ACC_BCU HK HK_BCL HK_BCU HSS HSS_BCL HSS_BCU GER GER_BCL GER_BCU HSS_EC HSS_EC_BCL HSS_EC_BCU EC_VALUE V12.0 : STAT : MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX OBS_SID OBS_LAT OBS_LON OBS_LVL OBS_ELV FCST OBS OBS_QC OBS_CLIMO_MEAN OBS_CLIMO_STDEV OBS_CLIMO_CDF FCST_CLIMO_MEAN FCST_CLIMO_STDEV V12.0 : STAT : SEEPS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL ODFL ODFH OLFD OLFH OHFD OHFL PF1 PF2 PF3 PV1 PV2 PV3 MEAN_FCST MEAN_OBS SEEPS -V12.0 : STAT : SEEPS_MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE OBS_SID OBS_LAT OBS_LON FCST OBS OBS_QC FCST_CAT OBS_CAT P1 P2 T1 T2 SEEPS +V12.0 : STAT : SEEPS_MPR: VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE OBS_SID OBS_LAT OBS_LON FCST OBS OBS_QC FCST_CAT OBS_CAT P1 P2 T1 T2 SEEPS V12.0 : STAT : NBRCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBS FBS_BCL FBS_BCU FSS FSS_BCL FSS_BCU AFSS AFSS_BCL AFSS_BCU UFSS UFSS_BCL UFSS_BCU F_RATE F_RATE_BCL F_RATE_BCU O_RATE O_RATE_BCL O_RATE_BCU V12.0 : STAT : NBRCTC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FY_OY FY_ON FN_OY FN_ON V12.0 : STAT : NBRCTS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL BASER BASER_NCL BASER_NCU BASER_BCL BASER_BCU FMEAN FMEAN_NCL FMEAN_NCU FMEAN_BCL FMEAN_BCU ACC ACC_NCL ACC_NCU ACC_BCL ACC_BCU FBIAS FBIAS_BCL FBIAS_BCU PODY PODY_NCL PODY_NCU PODY_BCL PODY_BCU PODN PODN_NCL PODN_NCU PODN_BCL PODN_BCU POFD POFD_NCL POFD_NCU POFD_BCL POFD_BCU FAR FAR_NCL FAR_NCU FAR_BCL FAR_BCU CSI CSI_NCL CSI_NCU CSI_BCL CSI_BCU GSS GSS_BCL GSS_BCU HK HK_NCL HK_NCU HK_BCL HK_BCU HSS HSS_BCL HSS_BCU ODDS ODDS_NCL ODDS_NCU ODDS_BCL ODDS_BCU LODDS LODDS_NCL LODDS_NCU LODDS_BCL LODDS_BCU ORSS ORSS_NCL ORSS_NCU ORSS_BCL ORSS_BCU EDS EDS_NCL EDS_NCU EDS_BCL EDS_BCU SEDS SEDS_NCL SEDS_NCU SEDS_BCL SEDS_BCU EDI EDI_NCL EDI_NCU EDI_BCL EDI_BCU SEDI SEDI_NCL SEDI_NCU SEDI_BCL SEDI_BCU BAGSS BAGSS_BCL BAGSS_BCU @@ -36,6 +36,10 @@ V12.0 : STAT : SSIDX : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID V12.0 : MODE : OBJ : VERSION MODEL N_VALID GRID_RES DESC FCST_LEAD FCST_VALID FCST_ACCUM OBS_LEAD OBS_VALID OBS_ACCUM FCST_RAD FCST_THR OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE OBJECT_ID OBJECT_CAT CENTROID_X CENTROID_Y CENTROID_LAT CENTROID_LON AXIS_ANG LENGTH WIDTH AREA AREA_THRESH CURVATURE CURVATURE_X CURVATURE_Y COMPLEXITY INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_USER INTENSITY_SUM CENTROID_DIST BOUNDARY_DIST CONVEX_HULL_DIST ANGLE_DIFF ASPECT_DIFF AREA_RATIO INTERSECTION_AREA UNION_AREA SYMMETRIC_DIFF INTERSECTION_OVER_AREA CURVATURE_RATIO COMPLEXITY_RATIO PERCENTILE_INTENSITY_RATIO INTEREST V12.0 : MODE : CTS : VERSION MODEL N_VALID GRID_RES DESC FCST_LEAD FCST_VALID FCST_ACCUM OBS_LEAD OBS_VALID OBS_ACCUM FCST_RAD FCST_THR OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE FIELD TOTAL FY_OY FY_ON FN_OY FN_ON BASER FMEAN ACC FBIAS PODY PODN POFD FAR CSI GSS HK HSS ODDS LODDS ORSS EDS SEDS EDI SEDI BAGSS +V12.0 : MTD : 2DSINGLE : VERSION MODEL DESC FCST_LEAD FCST_VALID OBS_LEAD OBS_VALID T_DELTA FCST_T_BEG FCST_T_END FCST_RAD FCST_THR OBS_T_BEG OBS_T_END OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBJECT_ID OBJECT_CAT TIME_INDEX AREA CENTROID_X CENTROID_Y CENTROID_LAT CENTROID_LON AXIS_ANG INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_USER +V12.0 : MTD : 3DSINGLE : VERSION MODEL DESC FCST_LEAD FCST_VALID OBS_LEAD OBS_VALID T_DELTA FCST_T_BEG FCST_T_END FCST_RAD FCST_THR OBS_T_BEG OBS_T_END OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBJECT_ID OBJECT_CAT CENTROID_X CENTROID_Y CENTROID_T CENTROID_LAT CENTROID_LON X_DOT Y_DOT AXIS_ANG VOLUME START_TIME END_TIME CDIST_TRAVELLED INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_USER +V12.0 : MTD : 3DPAIR : VERSION MODEL DESC FCST_LEAD FCST_VALID OBS_LEAD OBS_VALID T_DELTA FCST_T_BEG FCST_T_END FCST_RAD FCST_THR OBS_T_BEG OBS_T_END OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBJECT_ID OBJECT_CAT SPACE_CENTROID_DIST TIME_CENTROID_DELTA AXIS_DIFF SPEED_DELTA DIRECTION_DIFF VOLUME_RATIO START_TIME_DELTA END_TIME_DELTA INTERSECTION_VOLUME DURATION_DIFF INTEREST + V12.0 : TCST : TCMPR : VERSION AMODEL BMODEL DESC STORM_ID BASIN CYCLONE STORM_NAME INIT LEAD VALID INIT_MASK VALID_MASK LINE_TYPE TOTAL INDEX LEVEL WATCH_WARN INITIALS ALAT ALON BLAT BLON TK_ERR X_ERR Y_ERR ALTK_ERR CRTK_ERR ADLAND BDLAND AMSLP BMSLP AMAX_WIND BMAX_WIND AAL_WIND_34 BAL_WIND_34 ANE_WIND_34 BNE_WIND_34 ASE_WIND_34 BSE_WIND_34 ASW_WIND_34 BSW_WIND_34 ANW_WIND_34 BNW_WIND_34 AAL_WIND_50 BAL_WIND_50 ANE_WIND_50 BNE_WIND_50 ASE_WIND_50 BSE_WIND_50 ASW_WIND_50 BSW_WIND_50 ANW_WIND_50 BNW_WIND_50 AAL_WIND_64 BAL_WIND_64 ANE_WIND_64 BNE_WIND_64 ASE_WIND_64 BSE_WIND_64 ASW_WIND_64 BSW_WIND_64 ANW_WIND_64 BNW_WIND_64 ARADP BRADP ARRP BRRP AMRD BMRD AGUSTS BGUSTS AEYE BEYE ADIR BDIR ASPEED BSPEED ADEPTH BDEPTH NUM_MEMBERS TRACK_SPREAD TRACK_STDEV MSLP_STDEV MAX_WIND_STDEV V12.0 : TCST : TCDIAG : VERSION AMODEL BMODEL DESC STORM_ID BASIN CYCLONE STORM_NAME INIT LEAD VALID INIT_MASK VALID_MASK LINE_TYPE TOTAL INDEX DIAG_SOURCE TRACK_SOURCE FIELD_SOURCE (N_DIAG) DIAG_[0-9]* VALUE_[0-9]* V12.0 : TCST : PROBRIRW : VERSION AMODEL BMODEL DESC STORM_ID BASIN CYCLONE STORM_NAME INIT LEAD VALID INIT_MASK VALID_MASK LINE_TYPE ALAT ALON BLAT BLON INITIALS TK_ERR X_ERR Y_ERR ADLAND BDLAND RIRW_BEG RIRW_END RIRW_WINDOW AWIND_END BWIND_BEG BWIND_END BDELTA BDELTA_MAX BLEVEL_BEG BLEVEL_END (N_THRESH) THRESH_[0-9]* PROB_[0-9]* diff --git a/data/table_files/met_header_columns_V12.1.txt b/data/table_files/met_header_columns_V12.1.txt index 751811b102..bbdeaa1e03 100644 --- a/data/table_files/met_header_columns_V12.1.txt +++ b/data/table_files/met_header_columns_V12.1.txt @@ -7,7 +7,7 @@ V12.1 : STAT : MCTC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID V12.1 : STAT : MCTS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_CAT ACC ACC_NCL ACC_NCU ACC_BCL ACC_BCU HK HK_BCL HK_BCU HSS HSS_BCL HSS_BCU GER GER_BCL GER_BCU HSS_EC HSS_EC_BCL HSS_EC_BCU EC_VALUE V12.1 : STAT : MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX OBS_SID OBS_LAT OBS_LON OBS_LVL OBS_ELV FCST OBS OBS_QC OBS_CLIMO_MEAN OBS_CLIMO_STDEV OBS_CLIMO_CDF FCST_CLIMO_MEAN FCST_CLIMO_STDEV V12.1 : STAT : SEEPS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL ODFL ODFH OLFD OLFH OHFD OHFL PF1 PF2 PF3 PV1 PV2 PV3 MEAN_FCST MEAN_OBS SEEPS -V12.1 : STAT : SEEPS_MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE OBS_SID OBS_LAT OBS_LON FCST OBS OBS_QC FCST_CAT OBS_CAT P1 P2 T1 T2 SEEPS +V12.1 : STAT : SEEPS_MPR: VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE OBS_SID OBS_LAT OBS_LON FCST OBS OBS_QC FCST_CAT OBS_CAT P1 P2 T1 T2 SEEPS V12.1 : STAT : NBRCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBS FBS_BCL FBS_BCU FSS FSS_BCL FSS_BCU AFSS AFSS_BCL AFSS_BCU UFSS UFSS_BCL UFSS_BCU F_RATE F_RATE_BCL F_RATE_BCU O_RATE O_RATE_BCL O_RATE_BCU V12.1 : STAT : NBRCTC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FY_OY FY_ON FN_OY FN_ON V12.1 : STAT : NBRCTS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL BASER BASER_NCL BASER_NCU BASER_BCL BASER_BCU FMEAN FMEAN_NCL FMEAN_NCU FMEAN_BCL FMEAN_BCU ACC ACC_NCL ACC_NCU ACC_BCL ACC_BCU FBIAS FBIAS_BCL FBIAS_BCU PODY PODY_NCL PODY_NCU PODY_BCL PODY_BCU PODN PODN_NCL PODN_NCU PODN_BCL PODN_BCU POFD POFD_NCL POFD_NCU POFD_BCL POFD_BCU FAR FAR_NCL FAR_NCU FAR_BCL FAR_BCU CSI CSI_NCL CSI_NCU CSI_BCL CSI_BCU GSS GSS_BCL GSS_BCU HK HK_NCL HK_NCU HK_BCL HK_BCU HSS HSS_BCL HSS_BCU ODDS ODDS_NCL ODDS_NCU ODDS_BCL ODDS_BCU LODDS LODDS_NCL LODDS_NCU LODDS_BCL LODDS_BCU ORSS ORSS_NCL ORSS_NCU ORSS_BCL ORSS_BCU EDS EDS_NCL EDS_NCU EDS_BCL EDS_BCU SEDS SEDS_NCL SEDS_NCU SEDS_BCL SEDS_BCU EDI EDI_NCL EDI_NCU EDI_BCL EDI_BCU SEDI SEDI_NCL SEDI_NCU SEDI_BCL SEDI_BCU BAGSS BAGSS_BCL BAGSS_BCU @@ -36,6 +36,10 @@ V12.1 : STAT : SSIDX : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID V12.1 : MODE : OBJ : VERSION MODEL N_VALID GRID_RES DESC FCST_LEAD FCST_VALID FCST_ACCUM OBS_LEAD OBS_VALID OBS_ACCUM FCST_RAD FCST_THR OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE OBJECT_ID OBJECT_CAT CENTROID_X CENTROID_Y CENTROID_LAT CENTROID_LON AXIS_ANG LENGTH WIDTH AREA AREA_THRESH CURVATURE CURVATURE_X CURVATURE_Y COMPLEXITY INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_USER INTENSITY_SUM CENTROID_DIST BOUNDARY_DIST CONVEX_HULL_DIST ANGLE_DIFF ASPECT_DIFF AREA_RATIO INTERSECTION_AREA UNION_AREA SYMMETRIC_DIFF INTERSECTION_OVER_AREA CURVATURE_RATIO COMPLEXITY_RATIO PERCENTILE_INTENSITY_RATIO INTEREST V12.1 : MODE : CTS : VERSION MODEL N_VALID GRID_RES DESC FCST_LEAD FCST_VALID FCST_ACCUM OBS_LEAD OBS_VALID OBS_ACCUM FCST_RAD FCST_THR OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE FIELD TOTAL FY_OY FY_ON FN_OY FN_ON BASER FMEAN ACC FBIAS PODY PODN POFD FAR CSI GSS HK HSS ODDS LODDS ORSS EDS SEDS EDI SEDI BAGSS +V12.1 : MTD : 2DSINGLE : VERSION MODEL DESC FCST_LEAD FCST_VALID OBS_LEAD OBS_VALID T_DELTA FCST_T_BEG FCST_T_END FCST_RAD FCST_THR OBS_T_BEG OBS_T_END OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBJECT_ID OBJECT_CAT TIME_INDEX AREA CENTROID_X CENTROID_Y CENTROID_LAT CENTROID_LON AXIS_ANG INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_USER +V12.1 : MTD : 3DSINGLE : VERSION MODEL DESC FCST_LEAD FCST_VALID OBS_LEAD OBS_VALID T_DELTA FCST_T_BEG FCST_T_END FCST_RAD FCST_THR OBS_T_BEG OBS_T_END OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBJECT_ID OBJECT_CAT CENTROID_X CENTROID_Y CENTROID_T CENTROID_LAT CENTROID_LON X_DOT Y_DOT AXIS_ANG VOLUME START_TIME END_TIME CDIST_TRAVELLED INTENSITY_10 INTENSITY_25 INTENSITY_50 INTENSITY_75 INTENSITY_90 INTENSITY_USER +V12.1 : MTD : 3DPAIR : VERSION MODEL DESC FCST_LEAD FCST_VALID OBS_LEAD OBS_VALID T_DELTA FCST_T_BEG FCST_T_END FCST_RAD FCST_THR OBS_T_BEG OBS_T_END OBS_RAD OBS_THR FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBJECT_ID OBJECT_CAT SPACE_CENTROID_DIST TIME_CENTROID_DELTA AXIS_DIFF SPEED_DELTA DIRECTION_DIFF VOLUME_RATIO START_TIME_DELTA END_TIME_DELTA INTERSECTION_VOLUME DURATION_DIFF INTEREST + V12.1 : TCST : TCMPR : VERSION AMODEL BMODEL DESC STORM_ID BASIN CYCLONE STORM_NAME INIT LEAD VALID INIT_MASK VALID_MASK LINE_TYPE TOTAL INDEX LEVEL WATCH_WARN INITIALS ALAT ALON BLAT BLON TK_ERR X_ERR Y_ERR ALTK_ERR CRTK_ERR ADLAND BDLAND AMSLP BMSLP AMAX_WIND BMAX_WIND AAL_WIND_34 BAL_WIND_34 ANE_WIND_34 BNE_WIND_34 ASE_WIND_34 BSE_WIND_34 ASW_WIND_34 BSW_WIND_34 ANW_WIND_34 BNW_WIND_34 AAL_WIND_50 BAL_WIND_50 ANE_WIND_50 BNE_WIND_50 ASE_WIND_50 BSE_WIND_50 ASW_WIND_50 BSW_WIND_50 ANW_WIND_50 BNW_WIND_50 AAL_WIND_64 BAL_WIND_64 ANE_WIND_64 BNE_WIND_64 ASE_WIND_64 BSE_WIND_64 ASW_WIND_64 BSW_WIND_64 ANW_WIND_64 BNW_WIND_64 ARADP BRADP ARRP BRRP AMRD BMRD AGUSTS BGUSTS AEYE BEYE ADIR BDIR ASPEED BSPEED ADEPTH BDEPTH NUM_MEMBERS TRACK_SPREAD TRACK_STDEV MSLP_STDEV MAX_WIND_STDEV V12.1 : TCST : TCDIAG : VERSION AMODEL BMODEL DESC STORM_ID BASIN CYCLONE STORM_NAME INIT LEAD VALID INIT_MASK VALID_MASK LINE_TYPE TOTAL INDEX DIAG_SOURCE TRACK_SOURCE FIELD_SOURCE (N_DIAG) DIAG_[0-9]* VALUE_[0-9]* V12.1 : TCST : PROBRIRW : VERSION AMODEL BMODEL DESC STORM_ID BASIN CYCLONE STORM_NAME INIT LEAD VALID INIT_MASK VALID_MASK LINE_TYPE ALAT ALON BLAT BLON INITIALS TK_ERR X_ERR Y_ERR ADLAND BDLAND RIRW_BEG RIRW_END RIRW_WINDOW AWIND_END BWIND_BEG BWIND_END BDELTA BDELTA_MAX BLEVEL_BEG BLEVEL_END (N_THRESH) THRESH_[0-9]* PROB_[0-9]* diff --git a/docs/Users_Guide/appendixC.rst b/docs/Users_Guide/appendixC.rst index a6bbb0fe51..7d0f944624 100644 --- a/docs/Users_Guide/appendixC.rst +++ b/docs/Users_Guide/appendixC.rst @@ -92,7 +92,7 @@ By dividing the counts in the cells by the overall total, T, the joint proportio The values in :numref:`table_2X2` can also be used to compute the F, O, and H relative frequencies that are produced by the NCEP Verification System, and the Point-Stat tool provides an option to produce the statistics in this form. In terms of the other statistics computed by the Point-Stat tool, F is equivalent to the Mean Forecast; H is equivalent to POD; and O is equivalent to the Base Rate. All of these statistics are defined in the subsections below. The Point-Stat tool also provides the total number of observations, **T**. -The categorical verification measures produced by the Point-Stat and Grid-Stat tools are described in the following subsections. They are presented in the order shown in :numref:`table_PS_format_info_FHO` through :numref:`table_PS_format_info_CTS_cont`. +The categorical verification measures produced by the Point-Stat and Grid-Stat tools are described in the following subsections. They are presented in the order shown in :numref:`table_PS_format_info_FHO` through :numref:`table_PS_format_info_CTS`. TOTAL ----- diff --git a/docs/Users_Guide/ensemble-stat.rst b/docs/Users_Guide/ensemble-stat.rst index 7ee5dada75..08d76b2193 100644 --- a/docs/Users_Guide/ensemble-stat.rst +++ b/docs/Users_Guide/ensemble-stat.rst @@ -518,474 +518,580 @@ The format of the STAT and ASCII output of the Ensemble-Stat tool are described .. _table_ES_header_info_es_out: -.. list-table:: Header information for each file ensemble-stat outputs +.. list-table:: Header information for Ensemble-Stat STAT output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - HEADER - - - - * - Column Number - Header Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string designating model name + - String * - 3 - DESC - User-provided text string describing the verification task + - String * - 4 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 5 - FCST_VALID_BEG - Forecast valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 6 - FCST_VALID_END - Forecast valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 7 - OBS_LEAD - Observation lead time in HHMMSS format + - Time String * - 8 - OBS_VALID_BEG - Observation valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 9 - OBS_VALID_END - Observation valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 10 - FCST_VAR - Model variable + - String * - 11 - FCST_UNITS - Units for model variable + - String * - 12 - FCST_LEV - - Selected Vertical level for forecast + - Selected vertical level for forecast + - String * - 13 - OBS_VAR - Observation variable + - String * - 14 - OBS_UNITS - Units for observation variable + - String * - 15 - OBS_LEV - - Selected Vertical level for observations + - Selected vertical level for observations + - String * - 16 - OBTYPE - Type of observation selected + - String * - 17 - VX_MASK - Verifying masking region indicating the masking grid or polyline region applied + - String * - 18 - INTERP_MTHD - Interpolation method applied to forecasts + - String * - 19 - INTERP_PNTS - Number of points used in interpolation method + - Integer * - 20 - FCST_THRESH - The threshold applied to the forecast + - Threshold String * - 21 - OBS_THRESH - The threshold applied to the observations + - Threshold String * - 22 - COV_THRESH - - The minimum fraction of valid ensemble members required to calculate statistics. + - The minimum fraction of valid ensemble members required to calculate statistics + - Threshold String * - 23 - ALPHA - Error percent value used in confidence intervals + - Double * - 24 - LINE_TYPE - - Output line types are listed in :numref:`table_ES_header_info_es_out_RHIST` through :numref:`table_ES_header_info_es_out_SSVAR`. + - Output line types are listed in :numref:`table_ES_header_info_es_out_ECNT` through :numref:`table_ES_header_info_es_out_SSVAR` + - String .. _table_ES_header_info_es_out_ECNT: .. list-table:: Format information for ECNT (Ensemble Continuous Statistics) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - ECNT OUTPUT FORMAT - - - - * - Column Number - ECNT Column Name - Description + - Data Type * - 24 - ECNT - Ensemble Continuous Statistics line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - N_ENS - Number of ensemble values + - Integer * - 27 - CRPS - The Continuous Ranked Probability Score (normal distribution) + - Double * - 28 - CRPSS - The Continuous Ranked Probability Skill Score (normal distribution) + - Double * - 29 - IGN - The Ignorance Score + - Double * - 30 - ME - The Mean Error of the ensemble mean (unperturbed or supplied) + - Double * - 31 - RMSE - The Root Mean Square Error of the ensemble mean (unperturbed or supplied) + - Double * - 32 - SPREAD - The square root of the mean of the variance of the unperturbed ensemble member values at each observation location + - Double * - 33 - ME_OERR - The Mean Error of the PERTURBED ensemble mean (e.g. with Observation Error) + - Double * - 34 - RMSE_OERR - The Root Mean Square Error of the PERTURBED ensemble mean (e.g. with Observation Error) + - Double * - 35 - SPREAD_OERR - The square root of the mean of the variance of the PERTURBED ensemble member values (e.g. with Observation Error) at each observation location + - Double * - 36 - SPREAD_PLUS_OERR - The square root of the sum of unperturbed ensemble variance and the observation error variance - * - 37 + - Double + * - 37 - CRPSCL - Climatological Continuous Ranked Probability Score (normal distribution) + - Double * - 38 - CRPS_EMP - The Continuous Ranked Probability Score (empirical distribution) + - Double * - 39 - CRPSCL_EMP - Climatological Continuous Ranked Probability Score (empirical distribution) - * - 40 + - Double + * - 40 - CRPSS_EMP - The Continuous Ranked Probability Skill Score (empirical distribution) - * - 41 + - Double + * - 41 - CRPS_EMP_FAIR - The Continuous Ranked Probability Score (empirical distribution) adjusted by the mean absolute difference of the ensemble members + - Double * - 42 - SPREAD_MD - The pairwise Mean Absolute Difference of the unperturbed ensemble members + - Double * - 43 - MAE - The Mean Absolute Error of the ensemble mean (unperturbed or supplied) + - Double * - 44 - MAE_OERR - The Mean Absolute Error of the PERTURBED ensemble mean (e.g. with Observation Error) + - Double * - 45 - BIAS_RATIO - The Bias Ratio + - Double * - 46 - N_GE_OBS - The number of ensemble values greater than or equal to their observations + - Integer * - 47 - ME_GE_OBS - The Mean Error of the ensemble values greater than or equal to their observations + - Double * - 48 - N_LT_OBS - The number of ensemble values less than their observations + - Integer * - 49 - ME_LT_OBS - The Mean Error of the ensemble values less than or equal to their observations + - Double * - 50 - IGN_CONV_OERR - Error-convolved logarithmic scoring rule (i.e. ignornance score) from Equation 5 of :ref:`Ferro, 2017 ` + - Double * - 51 - IGN_CORR_OERR - Error-corrected logarithmic scoring rule (i.e. ignornance score) from Equation 7 of :ref:`Ferro, 2017 ` + - Double .. _table_ES_header_info_es_out_RPS: .. list-table:: Format information for RPS (Ranked Probability Score) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - RPS OUTPUT FORMAT - - - - * - Column Number - RPS Column Name - Description + - Data Type * - 24 - RPS - Ranked Probability Score line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - N_PROB - Number of probability thresholds (i.e. number of ensemble members in Ensemble-Stat) + - Integer * - 27 - RPS_REL - RPS Reliability, mean of the reliabilities for each RPS threshold + - Double * - 28 - RPS_RES - RPS Resolution, mean of the resolutions for each RPS threshold + - Double * - 29 - RPS_UNC - RPS Uncertainty, mean of the uncertainties for each RPS threshold + - Double * - 30 - RPS - - Ranked Probability Score, mean of the Brier Scores for each RPS threshold OR mean of the climatology-based probabilistic ensemble members + - Ranked Probability Score, mean of the Brier Scores for each RPS threshold OR mean of the climatology-based probabilistic ensemble members + - Double * - 31 - RPSS - Ranked Probability Skill Score relative to external climatology OR relative to a fixed climatology value of one divided by the number of ensemble members when using climatology-based probabilistic ensemble members + - Double * - 32 - RPSS_SMPL - Ranked Probability Skill Score relative to sample climatology + - Double .. _table_ES_header_info_es_out_RHIST: .. list-table:: Format information for RHIST (Ranked Histogram) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - RHIST OUTPUT FORMAT - - - - * - Column Number - RHIST Column Name - Description + - Data Type * - 24 - RHIST - Ranked Histogram line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - N_RANK - Number of possible ranks for observation + - Integer * - 27 - RANK_i - - Count of observations with the i-th rank (repeated) + - Count of observations with the ith rank (repeated) + - Integer .. _table_ES_header_info_es_out_PHIST: .. list-table:: Format information for PHIST (Probability Integral Transform Histogram) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - PHIST OUTPUT FORMAT - - - - * - Column Number - PHIST Column Name - Description + - Data Type * - 24 - PHIST - Probability Integral Transform line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - BIN_SIZE - Probability interval width + - Double * - 27 - N_BIN - Total number of probability intervals + - Integer * - 28 - BIN_i - Count of observations in the ith probability bin (repeated) + - Integer .. _table_ES_header_info_es_out_RELP: .. list-table:: Format information for RELP (Relative Position) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - RELP OUTPUT FORMAT - - - - * - Column Number - RELP Column Name - Description + - Data Type * - 24 - RELP - Relative Position line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - N_ENS - Number of ensemble members + - Integer * - 27 - RELP_i - - Number of times the i-th ensemble member's value was closest to the observation (repeated). When n members tie, 1/n is assigned to each member. + - Number of times the ith ensemble member's value was closest to the observation (repeated). When n members tie, 1/n is assigned to each member. + - Double .. _table_ES_header_info_es_out_ORANK: - + .. list-table:: Format information for ORANK (Observation Rank) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - ORANK OUTPUT FORMAT - - - - * - Column Number - ORANK Column Name - Description + - Data Type * - 24 - ORANK - Observation Rank line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - INDEX - - Line number in ORANK file + - Index for the current ensemble pair + - Integer * - 27 - OBS_SID - Station Identifier + - String * - 28 - OBS_LAT - Latitude of the observation + - Double * - 29 - OBS_LON - Longitude of the observation + - Double * - 30 - OBS_LVL - Level of the observation + - Double * - 31 - OBS_ELV - Elevation of the observation + - Double * - 32 - OBS - Value of the observation + - Double * - 33 - PIT - Probability Integral Transform + - Double * - 34 - RANK - Rank of the observation + - Integer * - 35 - N_ENS_VLD - Number of valid ensemble values + - Integer * - 36 - N_ENS - Number of ensemble values + - Integer * - 37 - ENS_i - Value of the ith ensemble member (repeated) + - Double * - Last-9 - OBS_QC - Quality control string for the observation + - String * - Last-8 - ENS_MEAN - The unperturbed ensemble mean value + - Double * - Last-7 - OBS_CLIMO_MEAN - Observation climatological mean value (named CLIMO_MEAN prior to met-12.0.0) + - Double * - Last-6 - SPREAD - The spread (standard deviation) of the unperturbed ensemble member values + - Double * - Last-5 - ENS_MEAN _OERR - - The PERTURBED ensemble mean (e.g. with Observation Error). + - The PERTURBED ensemble mean (e.g. with Observation Error) + - Double * - Last-4 - SPREAD_OERR - - The spread (standard deviation) of the PERTURBED ensemble member values (e.g. with Observation Error). + - The spread (standard deviation) of the PERTURBED ensemble member values (e.g. with Observation Error) + - Double * - Last-3 - SPREAD_PLUS_OERR - - The square root of the sum of the unperturbed ensemble variance and the observation error variance. + - The square root of the sum of the unperturbed ensemble variance and the observation error variance + - Double * - Last-2 - OBS_CLIMO_STDEV - Observation climatological standard deviation value (named CLIMO_STDEV prior to met-12.0.0) + - Double * - Last-1 - FCST_CLIMO_MEAN - Forecast climatological mean value + - Double * - Last - FCST_CLIMO_STDEV - Forecast climatological standard deviation value - + - Double + .. role:: raw-html(raw) :format: html -.. _table_ES_header_info_es_out_SSVAR: +.. _table_ES_header_info_es_out_SSVAR: .. list-table:: Format information for SSVAR (Spread/Skill Variance) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - SSVAR OUTPUT FORMAT - - - - * - Column Number - SSVAR Column Name - Description + - Data Type * - 24 - SSVAR - Spread/Skill Variance line type + - String * - 25 - TOTAL - Count of observations + - Integer * - 26 - N_BIN - Number of bins for current forecast run + - Integer * - 27 - BIN_i - Index of the current bin + - Integer * - 28 - BIN_N - Number of points in bin i + - Integer * - 29 - VAR_MIN - Minimum variance + - Double * - 30 - VAR_MAX - Maximum variance + - Double * - 31 - VAR_MEAN - Average variance + - Double * - 32 - FBAR - Average forecast value + - Double * - 33 - OBAR - Average observed value + - Double * - 34 - FOBAR - Average product of forecast and observation + - Double * - 35 - FFBAR - Average of forecast squared + - Double * - 36 - OOBAR - Average of observation squared + - Double * - 37-38 - FBAR_NCL, :raw-html:`
` FBAR_NCU - Mean forecast normal upper and lower confidence limits + - Double * - 39-41 - FSTDEV, :raw-html:`
` FSTDEV_NCL, :raw-html:`
` FSTDEV_NCU - Standard deviation of the error including normal upper and lower confidence limits + - Double * - 42-43 - OBAR_NCL, :raw-html:`
` OBAR_NCU - Mean observation normal upper and lower confidence limits + - Double * - 44-46 - OSTDEV, :raw-html:`
` OSTDEV_NCL, :raw-html:`
` OSTDEV_NCU - Standard deviation of the error including normal upper and lower confidence limits + - Double * - 47-49 - PR_CORR, :raw-html:`
` PR_CORR_NCL, :raw-html:`
` PR_CORR_NCU - Pearson correlation coefficient including normal upper and lower confidence limits + - Double * - 50-52 - ME, :raw-html:`
` ME_NCL, :raw-html:`
` ME_NCU - Mean error including normal upper and lower confidence limits + - Double * - 53-55 - ESTDEV, :raw-html:`
` ESTDEV_NCL, :raw-html:`
` ESTDEV_NCU - Standard deviation of the error including normal upper and lower confidence limits + - Double * - 56 - MBIAS - Magnitude bias + - Double * - 57 - MSE - Mean squared error + - Double * - 58 - BCMSE - Bias corrected root mean squared error + - Double * - 59 - RMSE - Root mean squared error + - Double diff --git a/docs/Users_Guide/grid-stat.rst b/docs/Users_Guide/grid-stat.rst index a70159c4e0..b45fbe9521 100644 --- a/docs/Users_Guide/grid-stat.rst +++ b/docs/Users_Guide/grid-stat.rst @@ -494,119 +494,145 @@ The format of the STAT and ASCII output of the Grid-Stat tool are the same as th .. _table_GS_header_info_gs_outputs: -.. list-table:: Header information for each file grid-stat outputs +.. list-table:: Header information for Grid-Stat STAT output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - HEADER - - - - * - Column Number - Header Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string designating model name + - String * - 3 - DESC - User-provided text string describing the verification task + - String * - 4 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 5 - FCST_VALID_BEG - Forecast valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 6 - FCST_VALID_END - Forecast valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 7 - OBS_LEAD - Observation lead time in HHMMSS format + - Time String * - 8 - OBS_VALID_BEG - Observation valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 9 - OBS_VALID_END - Observation valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 10 - FCST_VAR - Model variable + - String * - 11 - FCST_UNITS - Units for model variable + - String * - 12 - FCST_LEV - - Selected Vertical level for forecast + - Selected vertical level for forecast + - String * - 13 - OBS_VAR - Observation variable + - String * - 14 - OBS_UNITS - Units for observation variable + - String * - 15 - OBS_LEV - - Selected Vertical level for observations + - Selected vertical level for observations + - String * - 16 - OBTYPE - User-provided text string designating the observation type + - String * - 17 - VX_MASK - Verifying masking region indicating the masking grid or polyline region applied + - String * - 18 - INTERP_MTHD - Interpolation method applied to forecast field + - String * - 19 - INTERP_PNTS - Number of points used by interpolation method + - Integer * - 20 - FCST_THRESH - The threshold applied to the forecast + - Threshold String * - 21 - OBS_THRESH - The threshold applied to the observations + - Threshold String * - 22 - COV_THRESH - Proportion of observations in specified neighborhood which must exceed obs_thresh + - Threshold String * - 23 - ALPHA - Error percent value used in confidence intervals + - Double * - 24 - LINE_TYPE - Various line type options, refer to :numref:`point_stat-output` and the tables below. + - String .. _table_GS_format_info_NBRCTC: .. list-table:: Format information for NBRCTC (Neighborhood Contingency Table Counts) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - NBRCTC OUTPUT FORMAT - - - - * - Column Number - NBRCTC Column Name - Description + - Data Type * - 24 - NBRCTC - Neighborhood Contingency Table Counts line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - FY_OY - - Number of forecast yes and observation yes + - Sum of weights for hits (forecast yes and observation yes) + - Double * - 27 - FY_ON - - Number of forecast yes and observation no + - Sum of weights for false alarms (forecast yes and observation no) + - Double * - 28 - FN_OY - - Number of forecast no and observation yes + - Sum of weights for misses (forecast no and observation yes) + - Double * - 29 - FN_ON - - Number of forecast no and observation no + - Sum of weights for correct negatives (forecast no and observation no) + - Double .. role:: raw-html(raw) :format: html @@ -615,268 +641,313 @@ The format of the STAT and ASCII output of the Grid-Stat tool are the same as th .. list-table:: Format information for NBRCTS (Neighborhood Contingency Table Statistics) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - NBRCTS OUTPUT FORMAT - - - - * - Column Number - NBRCTS Column Name - Description + - Data Type * - 24 - NBRCTS - Neighborhood Contingency Table Statistics line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26-30 - BASER, :raw-html:`
` BASER_NCL, :raw-html:`
` BASER_NCU, :raw-html:`
` BASER_BCL, :raw-html:`
` BASER_BCU - Base rate including normal and bootstrap upper and lower confidence limits + - Double * - 31-35 - FMEAN, :raw-html:`
` FMEAN_NCL, :raw-html:`
` FMEAN_NCU, :raw-html:`
` FMEAN_BCL, :raw-html:`
` FMEAN_BCU - Forecast mean including normal and bootstrap upper and lower confidence limits + - Double * - 36-40 - ACC, :raw-html:`
` ACC_NCL, :raw-html:`
` ACC_NCU, :raw-html:`
` ACC_BCL, :raw-html:`
` ACC_BCU - Accuracy including normal and bootstrap upper and lower confidence limits + - Double * - 41-43 - FBIAS, :raw-html:`
` FBIAS_BCL, :raw-html:`
` FBIAS_BCU - Frequency Bias including bootstrap upper and lower confidence limits + - Double * - 44-48 - PODY, :raw-html:`
` PODY_NCL, :raw-html:`
` PODY_NCU, :raw-html:`
` PODY_BCL, :raw-html:`
` PODY_BCU - Probability of detecting yes including normal and bootstrap upper and lower confidence limits + - Double * - 49-53 - PODN, :raw-html:`
` PODN_NCL, :raw-html:`
` PODN_NCU, :raw-html:`
` PODN_BCL, :raw-html:`
` PODN_BCU - Probability of detecting no including normal and bootstrap upper and lower confidence limits + - Double * - 54-58 - POFD, :raw-html:`
` POFD_NCL, :raw-html:`
` POFD_NCU, :raw-html:`
` POFD_BCL, :raw-html:`
` POFD_BCU - Probability of false detection including normal and bootstrap upper and lower confidence limits + - Double * - 59-63 - FAR, :raw-html:`
` FAR_NCL, :raw-html:`
` FAR_NCU, :raw-html:`
` FAR_BCL, :raw-html:`
` FAR_BCU - False alarm ratio including normal and bootstrap upper and lower confidence limits + - Double * - 64-68 - CSI, :raw-html:`
` CSI_NCL, :raw-html:`
` CSI_NCU, :raw-html:`
` CSI_BCL, :raw-html:`
` CSI_BCU - Critical Success Index including normal and bootstrap upper and lower confidence limits + - Double * - 69-71 - GSS, :raw-html:`
` GSS_BCL, :raw-html:`
` GSS_BCU - Gilbert Skill Score including bootstrap upper and lower confidence limits - -.. _table_GS_format_info_NBRCTS_cont: - -.. role:: raw-html(raw) - :format: html - -.. list-table:: Format information for NBRCTS (Neighborhood Contingency Table Statistics) output line type, continued from above - :widths: auto - :header-rows: 1 - - * - Column Number - - NBRCTS Column Name - - Description + - Double * - 72-76 - HK, :raw-html:`
` HK_NCL, :raw-html:`
` HK_NCU, :raw-html:`
` HK_BCL, :raw-html:`
` HK_BCU - Hanssen-Kuipers Discriminant including normal and bootstrap upper and lower confidence limits + - Double * - 77-79 - HSS, :raw-html:`
` HSS_BCL, :raw-html:`
` HSS_BCU - Heidke Skill Score including bootstrap upper and lower confidence limits + - Double * - 80-84 - ODDS, :raw-html:`
` ODDS_NCL, :raw-html:`
` ODDS_NCU, :raw-html:`
` ODDS_BCL, :raw-html:`
` ODDS_BCU - Odds Ratio including normal and bootstrap upper and lower confidence limits + - Double * - 85-89 - LODDS, :raw-html:`
` LODDS_NCL, :raw-html:`
` LODDS_NCU, :raw-html:`
` LODDS_BCL, :raw-html:`
` LODDS_BCU - Logarithm of the Odds Ratio including normal and bootstrap upper and lower confidence limits + - Double * - 90-94 - ORSS, :raw-html:`
` ORSS _NCL, :raw-html:`
` ORSS _NCU, :raw-html:`
` ORSS _BCL, :raw-html:`
` ORSS _BCU - Odds Ratio Skill Score including normal and bootstrap upper and lower confidence limits + - Double * - 95-99 - EDS, :raw-html:`
` EDS _NCL, :raw-html:`
` EDS _NCU, :raw-html:`
` EDS _BCL, :raw-html:`
` EDS _BCU - Extreme Dependency Score including normal and bootstrap upper and lower confidence limits + - Double * - 100-104 - SEDS, :raw-html:`
` SEDS _NCL, :raw-html:`
` SEDS _NCU, :raw-html:`
` SEDS _BCL SEDS _BCU - Symmetric Extreme Dependency Score including normal and bootstrap upper and lower confidence limits + - Double * - 105-109 - EDI, :raw-html:`
` EDI _NCL, :raw-html:`
` EDI _NCU, :raw-html:`
` EDI _BCL, :raw-html:`
` EDI _BCU - Extreme Dependency Index including normal and bootstrap upper and lower confidence limits + - Double * - 110-114 - SEDI, :raw-html:`
` SEDI _NCL, :raw-html:`
` SEDI _NCU, :raw-html:`
` SEDI _BCL,SEDI _BCU - Symmetric Extremal Dependency Index including normal and bootstrap upper and lower confidence limits + - Double * - 115-117 - BAGSS, :raw-html:`
` BAGSS_BCL, :raw-html:`
` BAGSS_BCU - Bias-Adjusted Gilbert Skill Score including bootstrap upper and lower confidence limits + - Double .. role:: raw-html(raw) :format: html .. _table_GS_format_info_NBRCNT: - + .. list-table:: Format information for NBRCNT(Neighborhood Continuous Statistics) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - NBRCNT OUTPUT FORMAT - - - - * - Column Number - NBRCNT Column Name - Description + - Data Type * - 24 - NBRCNT - Neighborhood Continuous statistics line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26-28 - FBS, :raw-html:`
` FBS_BCL, :raw-html:`
` FBS_BCU - Fractions Brier Score including bootstrap upper and lower confidence limits + - Double * - 29-31 - FSS, :raw-html:`
` FSS_BCL, :raw-html:`
` FSS_BCU - Fractions Skill Score including bootstrap upper and lower confidence limits + - Double * - 32-34 - AFSS, :raw-html:`
` AFSS_BCL, :raw-html:`
` AFSS_BCU - Asymptotic Fractions Skill Score including bootstrap upper and lower confidence limits + - Double * - 35-37 - UFSS, :raw-html:`
` UFSS_BCL, :raw-html:`
` UFSS_BCU - Uniform Fractions Skill Score including bootstrap upper and lower confidence limits + - Double * - 38-40 - F_RATE, :raw-html:`
` F_RATE _BCL, :raw-html:`
` F_RATE _BCU - Forecast event frequency including bootstrap upper and lower confidence limits + - Double * - 41-43 - O_RATE, :raw-html:`
` O _RATE _BCL, :raw-html:`
` O _RATE _BCU - Observed event frequency including bootstrap upper and lower confidence limits + - Double .. _table_GS_format_info_GRAD: .. list-table:: Format information for GRAD (Gradient Statistics) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - GRAD OUTPUT FORMAT - - - - * - Column Number - GRAD Column Name - Description + - Data Type * - 24 - GRAD - Gradient Statistics line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - FGBAR - Mean of absolute value of forecast gradients + - Double * - 27 - OGBAR - Mean of absolute value of observed gradients + - Double * - 28 - MGBAR - Mean of maximum of absolute values of forecast and observed gradients + - Double * - 29 - EGBAR - Mean of absolute value of forecast minus observed gradients + - Double * - 30 - S1 - S1 score + - Double * - 31 - S1_OG - S1 score with respect to observed gradient + - Double * - 32 - FGOG_RATIO - Ratio of forecast and observed gradients + - Double * - 33 - DX - Gradient size in the X-direction + - Double * - 34 - DY - Gradient size in the Y-direction + - Double .. _table_GS_format_info_DMAP: .. list-table:: Format information for DMAP (Distance Map) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - DMAP OUTPUT FORMAT - - - - * - Column Number - DMAP Column Name - Description + - Data Type * - 24 - DMAP - Distance Map line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - FY - Number of forecast events + - Integer * - 27 - OY - Number of observation events + - Integer * - 28 - FBIAS - Frequency Bias + - Double * - 29 - BADDELEY - Baddeley's :math:`\Delta` Metric + - Double * - 30 - HAUSDORFF - Hausdorff Distance + - Double * - 31 - MED_FO - Mean-error Distance from observation to forecast + - Double * - 32 - MED_OF - Mean-error Distance from forecast to observation + - Double * - 33 - MED_MIN - Minimum of MED_FO and MED_OF + - Double * - 34 - MED_MAX - Maximum of MED_FO and MED_OF + - Double * - 35 - MED_MEAN - Mean of MED_FO and MED_OF + - Double * - 36 - FOM_FO - Pratt's Figure of Merit from observation to forecast + - Double * - 37 - FOM_OF - Pratt's Figure of Merit from forecast to observation + - Double * - 38 - FOM_MIN - Minimum of FOM_FO and FOM_OF + - Double * - 39 - FOM_MAX - Maximum of FOM_FO and FOM_OF + - Double * - 40 - FOM_MEAN - Mean of FOM_FO and FOM_OF + - Double * - 41 - ZHU_FO - Zhu's Measure from observation to forecast + - Double * - 42 - ZHU_OF - Zhu's Measure from forecast to observation + - Double * - 43 - ZHU_MIN - Minimum of ZHU_FO and ZHU_OF + - Double * - 44 - ZHU_MAX - Maximum of ZHU_FO and ZHU_OF + - Double * - 45 - ZHU_MEAN - Mean of ZHU_FO and ZHU_OF + - Double * - 46 - G - :math:`G` distance measure + - Double * - 47 - GBETA - :math:`G_\beta` distance measure + - Double * - 48 - BETA_VALUE - Beta value used to compute :math:`G_\beta` + - Double If requested using the **nc_pairs_flag** dictionary in the configuration file, a NetCDF file containing the matched pair and forecast minus observation difference fields for each combination of variable type/level and masking region applied will be generated. The contents of this file are determined by the contents of the nc_pairs_flag dictionary. The output NetCDF file is named similarly to the other output files: **grid_stat_PREFIX_ HHMMSSL_YYYYMMDD_HHMMSSV_pairs.nc**. Commonly available NetCDF utilities such as ncdump or ncview may be used to view the contents of the output file. @@ -886,10 +957,8 @@ The output NetCDF file contains the dimensions and variables shown in :numref:`t .. list-table:: Dimensions defined in NetCDF matched pair output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - grid_stat NETCDF DIMENSIONS - - * - NetCDF Dimension - Description * - Lat @@ -897,34 +966,36 @@ The output NetCDF file contains the dimensions and variables shown in :numref:`t * - Lon - Dimension of the longitude (i.e. Number of grid points in the East-West direction) - + .. role:: raw-html(raw) :format: html - + .. _table_GS_var_NetCDF_matched_pair_out: .. list-table:: A selection of variables that can appear in the NetCDF matched pair output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - grid_stat NETCDF VARIABLES - - - - * - NetCDF Variable - Dimension - Description + - Data Type * - FCST_VAR_LVL_MASK _INTERP_MTHD _INTERP_PNTS - lat, lon - For each model variable (VAR), vertical level (LVL), masking region (MASK), and, if applicable, smoothing operation (INTERP_MTHD and INTERP_PNTS), the forecast value is listed for each point in the mask. + - Float * - OBS_VAR_LVL_MASK DIFF_FCSTVAR - lat, lon - - For each model variable (VAR), vertical level (LVL), and masking region (MASK), the observation value is listed for each point in the mask . + - For each model variable (VAR), vertical level (LVL), and masking region (MASK), the observation value is listed for each point in the mask. + - Float * - DIFF_FCSTVAR :raw-html:`
` _FCSTLVL :raw-html:`
` _OBSVAR :raw-html:`
` _OBSLVL_MASK :raw-html:`
` _INTERP_MTHD :raw-html:`
` _INTERP_PNTS - lat, lon - For each model variable (VAR), vertical level (LVL), masking region (MASK), and, if applicable, smoothing operation (INTERP_MTHD and INTERP_PNTS), the difference (forecast - observation) is computed for each point in the mask. + - Float * - FCST_XGRAD_DX FCST_YGRAD_DX OBS_XGRAD_DY OBS_YGRAD_DY - lat, lon - List the gradient of the forecast and observation fields computed in the grid-x and grid-y directions where DX and DY indicate the gradient direction and size. + - Float The STAT output files described for grid_stat may be used as inputs to the Stat-Analysis tool. For more information on using the Stat-Analysis tool to create stratifications and aggregations of the STAT files produced by grid_stat, please see :numref:`stat-analysis`. diff --git a/docs/Users_Guide/gsi-tools.rst b/docs/Users_Guide/gsi-tools.rst index a6e80a448e..edef8733f2 100644 --- a/docs/Users_Guide/gsi-tools.rst +++ b/docs/Users_Guide/gsi-tools.rst @@ -23,7 +23,7 @@ gsid2mpr Usage The usage statement for the GSID2MPR tool is shown below: .. code-block:: none - + Usage: gsid2mpr gsi_file_1 [gsi_file_2 ... gsi_file_n] [-swap] @@ -64,7 +64,7 @@ Optional Arguments for gsid2mpr An example of the gsid2mpr calling sequence is shown below: .. code-block:: none - + gsid2mpr diag_conv_ges.mem001 \ -set_hdr MODEL GSI_MEM001 \ -outdir out @@ -81,41 +81,48 @@ The GSID2MPR tool writes the same set of MPR output columns for the conventional .. list-table:: Format information for GSI Diagnostic Conventional MPR (Matched Pair) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - GSI DIAGNOSTIC CONVENTIONAL MPR OUTPUT FILE * - Column Number - Column Name - Description + - Data Type * - 1-37 - - - Standard MPR columns described in :numref:`table_PS_format_info_MPR`. + - Standard MPR columns described in :numref:`table_PS_format_info_MPR` + - Varies * - 38 - OBS_PRS - Model pressure value at the observation height (hPa) + - Double * - 39 - OBS_ERR_IN - PrepBUFR inverse observation error + - Double * - 40 - OBS_ERR_ADJ - read_PrepBUFR inverse observation error + - Double * - 41 - OBS_ERR_FIN - Final inverse observation error + - Double * - 42 - PREP_USE - read_PrepBUFR usage + - Integer * - 43 - ANLY_USE - Analysis usage (1 for yes, -1 for no) + - Integer * - 44 - SETUP_QC - Setup quality control + - Integer * - 45 - QC_WGHT - Non-linear quality control relative weight + - Double .. role:: raw-html(raw) @@ -123,113 +130,144 @@ The GSID2MPR tool writes the same set of MPR output columns for the conventional .. list-table:: Format information for GSI Diagnostic Radiance MPR (Matched Pair) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - GSI DIAGNOSTIC RADIANCE MPR OUTPUT FILE * - Column Number - Column Name - Description + - Data Type * - 1-37 - - - - Standard MPR columns described in :numref:`table_PS_format_info_MPR`. + - + - Standard MPR columns described in :numref:`table_PS_format_info_MPR` + - Varies * - 38 - CHAN_USE - Channel used (1 for yes, -1 for no) + - Integer * - 39 - SCAN_POS - Sensor scan position + - Integer * - 40 - SAT_ZNTH - Satellite zenith angle (degrees) + - Double * - 41 - SAT_AZMTH - Satellite azimuth angle (degrees) + - Double * - 42 - SUN_ZNTH - Solar zenith angle (degrees) + - Double * - 43 - SUN_AZMTH - Solar azimuth angle (degrees) + - Double * - 44 - SUN_GLNT - Sun glint angle (degrees) + - Double * - 45 - FRAC_WTR - Fractional coverage by water + - Double * - 46 - FRAC_LND - Fractional coverage by land + - Double * - 47 - FRAC_ICE - Fractional coverage by ice + - Double * - 48 - FRAC_SNW - Fractional coverage by snow + - Double * - 49 - SFC_TWTR - Surface temperature over water (K) + - Double * - 50 - SFC_TLND - Surface temperature over land (K) + - Double * - 51 - SFC_TICE - Surface temperature over ice (K) + - Double * - 52 - SFC_TSNW - Surface temperature over snow (K) + - Double * - 53 - TSOIL - Soil temperature (K) + - Double * - 54 - SOILM - Soil moisture + - Double * - 55 - LAND_TYPE - Surface land type + - Integer * - 56 - FRAC_VEG - Vegetation fraction + - Double * - 57 - SNW_DPTH - Snow depth + - Double * - 58 - SFC_WIND - Surface wind speed (m/s) + - Double * - 59 - FRAC_CLD CLD_LWC - Cloud fraction (%) :raw-html:`
` Cloud liquid water (kg/m**2) (microwave only) + - Double * - 60 - CTOP_PRS TC_PWAT - Cloud top pressure (hPa) :raw-html:`
` Total column precip. water (km/m**2) (microwave only) + - Double * - 61 - TFND - Foundation temperature: Tr + - Double * - 62 - TWARM - Diurnal warming: d(Tw) at depth zob + - Double * - 63 - TCOOL - Sub-layer cooling: d(Tc) at depth zob + - Double * - 64 - TZFND - d(Tz)/d(Tr) + - Double * - 65 - OBS_ERR - Inverse observation error + - Double * - 66 - FCST_NOBC - Brightness temperature with no bias correction (K) + - Double * - 67 - SFC_EMIS - Surface emissivity + - Double * - 68 - STABILITY - Stability index + - Double * - 69 - PRS_MAX_WGT - Pressure of the maximum weighing function + - Double The gsid2mpr output may be passed to the Stat-Analysis tool to derive additional statistics. In particular, users should consider running the **aggregate_stat** job type to read MPR lines and compute partial sums (SL1L2), continuous statistics (CNT), contingency table counts (CTC), or contingency table statistics (CTS). Stat-Analysis has been enhanced to parse any extra columns found at the end of the input lines. Users can filter the values in those extra columns using the **-column_thresh**, **-column_str**, and **-column_str_exc** job command options. @@ -254,7 +292,7 @@ gsidens2orank Usage The usage statement for the GSIDENS2ORANK tool is shown below: .. code-block:: none - + Usage: gsidens2orank ens_file_1 ... ens_file_n | ens_file_list -out path @@ -315,116 +353,142 @@ The GSID2MPR tool writes the same set of ORANK output columns for the convention .. list-table:: Format information for GSI Diagnostic Conventional ORANK (Observation Rank) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - GSI DIAGNOSTIC CONVENTIONAL ORANK OUTPUT FILE * - Column Number - Column Name - Description + - Data Type * - 1-? - - - Standard ORANK columns described in :numref:`table_ES_header_info_es_out_ORANK`. + - Standard ORANK columns described in :numref:`table_ES_header_info_es_out_ORANK` + - Varies * - Last-2 - N_USE - Number of members with ANLY_USE = 1 + - Integer * - Last-1 - PREP_USE - read_PrepBUFR usage + - Integer * - Last - SETUP_QC - Setup quality control + - Integer .. list-table:: Format information for GSI Diagnostic Radiance ORANK (Observation Rank) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - GSI DIAGNOSTIC RADIANCE ORANK OUTPUT FILE * - Column Number - Column Name - Description + - Data Type * - 1-? - - - Standard ORANK columns described in :numref:`table_ES_header_info_es_out_ORANK`. + - Standard ORANK columns described in :numref:`table_ES_header_info_es_out_ORANK` + - Varies * - Last-24 - N_USE - Number of members with OBS_QC = 0 + - Integer * - Last-23 - CHAN_USE - Channel used (1 for yes, -1 for no) + - Integer * - Last-22 - SCAN_POS - Sensor scan position + - Integer * - Last-21 - SAT_ZNTH - Satellite zenith angle (degrees) + - Double * - Last-20 - SAT_AZMTH - Satellite azimuth angle (degrees) + - Double * - Last-19 - SUN_ZNTH - Solar zenith angle (degrees) + - Double * - Last-18 - SUN_AZMTH - Solar azimuth angle (degrees) + - Double * - Last-17 - SUN_GLNT - Sun glint angle (degrees) + - Double * - Last-16 - FRAC_WTR - Fractional coverage by water + - Double * - Last-15 - FRAC_LND - Fractional coverage by land + - Double * - Last-14 - FRAC_ICE - Fractional coverage by ice + - Double * - Last-13 - FRAC_SNW - Fractional coverage by snow + - Double * - Last-12 - SFC_TWTR - Surface temperature over water (K) + - Double * - Last-11 - SFC_TLND - Surface temperature over land (K) + - Double * - Last-10 - SFC_TICE - Surface temperature over ice (K) + - Double * - Last-9 - SFC_TSNW - Surface temperature over snow (K) + - Double * - Last-8 - TSOIL - Soil temperature (K) + - Double * - Last-7 - SOILM - Soil moisture + - Double * - Last-6 - LAND_TYPE - Surface land type + - Integer * - Last-5 - FRAC_VEG - Vegetation fraction + - Double * - Last-4 - SNW_DPTH - Snow depth + - Double * - Last-3 - TFND - Foundation temperature: Tr + - Double * - Last-2 - TWARM - Diurnal warming: d(Tw) at depth zob + - Double * - Last-1 - TCOOL - Sub-layer cooling: d(Tc) at depth zob + - Double * - Last - TZFND - d(Tz)/d(Tr) + - Double The gsidens2orank output may be passed to the Stat-Analysis tool to derive additional statistics. In particular, users should consider running the **aggregate_stat** job type to read ORANK lines and ranked histograms (RHIST), probability integral transform histograms (PHIST), and spread-skill variance output (SSVAR). Stat-Analysis has been enhanced to parse any extra columns found at the end of the input lines. Users can filter the values in those extra columns using the **-column_thresh**, **-column_str**, and **-column_str_exc** job command options. diff --git a/docs/Users_Guide/mode-td.rst b/docs/Users_Guide/mode-td.rst index 70c594f430..2642ea7d2f 100644 --- a/docs/Users_Guide/mode-td.rst +++ b/docs/Users_Guide/mode-td.rst @@ -384,227 +384,277 @@ The contents of the OBJECT_ID and OBJECT_CAT columns identify the objects using .. list-table:: Text Header Columns :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - HEADER * - Column - Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string giving model name + - String * - 3 - DESC - User-provided text string describing the verification task + - String * - 4 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 5 - FCST_VALID - Forecast valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 6 - OBS_LEAD - Observation lead time in HHMMSS format + - Time String * - 7 - OBS_VALID - Observation valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 8 - T_DELTA - Time separation between input data files in HHMMSS format + - Time String * - 9 - FCST_T_BEG - Forecast time convolution begin offset + - Integer * - 10 - FCST_T_END - Forecast time convolution end offset + - Integer * - 11 - FCST_RAD - Forecast convolution radius in grid units + - Integer * - 12 - FCST_THR - Forecast convolution threshold + - Threshold String * - 13 - OBS_T_BEG - Observation time convolution begin offset + - Integer * - 14 - OBS_T_END - Observation time convolution end offset + - Integer * - 15 - OBS_RAD - Observation convolution radius in grid units + - Integer * - 16 - OBS_THR - Observation convolution threshold + - Threshold String * - 17 - FCST_VAR - Forecast variable + - String * - 18 - FCST_UNITS - Units for forecast variable + - String * - 19 - FCST_LEV - Forecast vertical level + - String * - 20 - OBS_VAR - Observation variable + - String * - 21 - OBS_UNITS - Units for observation variable + - String * - 22 - OBS_LEV - Observation vertical level + - String .. _table_mtd-2D-Attributes: -.. list-table:: 2D Attribute +.. list-table:: 2D Object Attributes :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - 2D Attribute Columns - * - Column - - Name + * - Column Number + - 2D Column Name - Description + - Data Type * - 23 - OBJECT_ID - Object number + - String * - 24 - OBJECT_CAT - Object category + - String * - 25 - TIME_INDEX - Time index of slice + - Integer * - 26 - AREA - 2D cross-sectional area (in grid squares) + - Integer * - 27-28 - CENTROID_X,_Y - Location of centroid (in grid units) + - Double * - 29-30 - CENTROID_LAT,_LON - Location of centroid (in lat/lon degrees) + - Double * - 31 - AXIS_ANG - Angle that the axis makes with the grid x direction (in degrees) + - Double * - 32-36 - INTENSITY_10,_25,_50,_75,_90 - 10th, 25th, 50th, 75th, and 90th percentile intensity in time slice (various units) + - Double * - 37 - INTENSITY_NN - User-specified percentile intensity in time slice (various units) + - Double .. _table_mtd-3D-single-attributes: -.. list-table:: 3D Single Attribute +.. list-table:: 3D Single Object Attributes :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - 3D Single Attribute Columns - * - Column - - Name + * - Column Number + - 3D Single Column Name - Description + - Data Type * - 23 - OBJECT_ID - Object number + - String * - 24 - OBJECT_CAT - Object category + - String * - 25-26 - CENTROID_X,_Y - Location of the centroid (in grid units) + - Double * - 27 - CENTROID_T - Time coordinate of centroid (in time steps) + - Double * - 28-29 - CENTROID_LAT,_LON - Location of the centroid (in lat/lon degrees) + - Double * - 30 - X_DOT - X component of object velocity (in grid units per time step) + - Double * - 31 - Y_DOT - Y component of object velocity (in grid units per time step) + - Double * - 32 - AXIS_ANG - Angle that the axis plane of an object makes with the grid x direction (in degrees) + - Double * - 33 - VOLUME - 3D object volume (integer count of 3D spacetime cells) + - Integer * - 34 - START_TIME - Object start time (in time steps) + - Integer * - 35 - END_TIME - Object end time (in time steps) + - Integer * - 36 - CDIST_TRAVELLED - Total great circle distance travelled by the 2D spatial centroid over the lifetime of the 3D object (in kilometers) + - Double * - 37-41 - INTENSITY_10,_25,_50,_75,_90 - 10th, 25th, 50th, 75th, and 90th percentile intensity in spacetime object (various units) + - Double * - 42 - INTENSITY_NN - User-specified percentile intensity in spacetime object (various units) + - Double .. _table_mtd-3D-Pair-Attribute: -.. list-table:: 3D Pair Attribute +.. list-table:: 3D Pair Object Attributes :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - 3D Pair Attribute Columns - * - Column - - Name + * - Column Number + - 3D Pair Column Name - Description + - Data Type * - 23 - OBJECT_ID - Object number + - String * - 24 - OBJECT_CAT - Object category + - String * - 25 - SPACE_CENTROID_DIST - Cartesian distance between :math:`(x,y)` coordinates of object spacetime centroids (in grid units) + - Double * - 26 - TIME_CENTROID_DELTA - Observation minus forecast difference in *t* temporal index of object spacetime centroid (in time steps) + - Double * - 27 - AXIS_DIFF - Angle between the spatial axis plane angles (in degrees, from 0 to 90) + - Double * - 28 - SPEED_DELTA - Forecast minus observation speed difference (in grid units per time step) + - Double * - 29 - DIRECTION_DIFF - Difference in object direction of movement (in degrees, from 0 to 180) + - Double * - 30 - VOLUME_RATIO - Forecast 3D object volume divided by observation 3D object volume (unitless) + - Double * - 31 - START_TIME_DELTA - Forecast minus observation starting time step (in time steps) + - Integer * - 32 - END_TIME_DELTA - Forecast minus observation ending time step (in time steps) + - Integer * - 33 - INTERSECTION_VOLUME - 3D object intersection volume (integer count of 3D spacetime cells) + - Integer * - 34 - DURATION_DIFF - Forecast minus observation difference in object lifetimes (in time steps) + - Integer * - 35 - INTEREST - Total interest for this object pair (unitless) + - Double **NetCDF File** diff --git a/docs/Users_Guide/mode.rst b/docs/Users_Guide/mode.rst index 6088e993ea..fe0bbc8577 100644 --- a/docs/Users_Guide/mode.rst +++ b/docs/Users_Guide/mode.rst @@ -121,6 +121,10 @@ When regridding to the FCST or OBS field (e.g. to_grid = FCST), the first field "file_type" can be set independently for each input in multivariate mode. If not set for an input, MET uses file names and file content to determine the type. +In multivariate mode, with quilt=**FALSE**, for all inputs the number of forecast and observation convolution radii and thresholds must all match. One configuration of MODE will be run for each group of settings in those lists. + +In multivariate mode, with quilt=**TRUE**, for all inputs the number of forecast and observation convolution radii must match and the number of forecast and observation convolution thresholds must match. When each input has N radii and M thresholds, NxM configurations of MODE will be run. + When setting a threshold to a percentile, some choices require both an observation input and a forecast input. When this is the case, it's assumed the indices match, so for example if forecast input 1 has such a percentile setting, then observation input 1 will be used to compute the percentile. Percentiles in which this will happen are: * SFP in an observation input. @@ -319,7 +323,7 @@ The **conv_radius** entry defines the radius of the circular convolution applied The **conv_thresh** entry specifies the threshold values to be applied to the convolved field to define objects. By default, objects are defined using a convolution threshold of 5.0. Multiple convolution thresholds may be specified as an array (e.g. **conv_thresh = [ >=5.0, >=10.0, >=15.0 ];)**. -Multiple convolution radii and thresholds and processed using the logic defined by the **quilt** entry. +Multiple convolution radii and thresholds are processed using the logic defined by the **quilt** entry. The logic specific to multivariate mode is described in the multivariate mode section above. The **vld_thresh** entry must be set between 0 and 1. When performing the circular convolution step if the proportion of bad data values in the convolution area is greater than or equal to this threshold, the resulting convolved value will be bad data. If the proportion is less than this threshold, the convolution will be performed on only the valid data. By default, the **vld_thresh** is set to 0.5. @@ -577,158 +581,204 @@ The MODE tool creates two ASCII output files. The first ASCII file contains cont .. list-table:: Format of MODE CTS output file. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - mode ASCII - - CONTINGENCY TABLE - - OUTPUT FORMAT * - Column Number - - MODE CTS Column Name + - CTS Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string giving model name + - String * - 3 - N_VALID - Number of valid data points + - Integer * - 4 - GRID_RES - User-provided nominal grid resolution + - Double * - 5 - DESC - User-provided text string describing the verification task + - String * - 6 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 7 - FCST_VALID - Forecast valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 8 - FCST_ACCUM - Forecast accumulation time in HHMMSS format + - Time String * - 9 - OBS_LEAD - Observation lead time in HHMMSS format; when field2 is actually an observation, this should be "000000" + - Time String * - 10 - OBS_VALID - Observation valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 11 - OBS_ACCUM - Observation accumulation time in HHMMSS format + - Time String * - 12 - FCST_RAD - - Forecast convolution radius in grid units + - Forecast convolution radius in grid units + - Integer * - 13 - FCST_THR - Forecast convolution threshold + - Threshold String * - 14 - OBS_RAD - - Observation convolution radius in grid units + - Observation convolution radius in grid units + - Integer * - 15 - OBS_THR - Observation convolution threshold + - Threshold String * - 16 - FCST_VAR - Forecast variable + - String * - 17 - FCST_UNITS - Units for model variable + - String * - 18 - FCST_LEV - Forecast vertical level + - String * - 19 - OBS_VAR - Observation variable + - String * - 20 - OBS_UNITS - Units for observation variable + - String * - 21 - OBS_LEV - Observation vertical level + - String * - 22 - OBTYPE - User-provided observation type + - String * - 23 - FIELD - Field type for this line:* RAW for the raw input fields * OBJECT for the resolved object fields + - String * - 24 - TOTAL - Total number of matched pairs + - Integer * - 25 - FY_OY - - Number of forecast yes and observation yes + - Number of hits (forecast yes and observation yes) + - Integer * - 26 - FY_ON - - Number of forecast yes and observation no + - Number of false alarms (forecast yes and observation no) + - Integer * - 27 - FN_OY - - Number of forecast no and observation yes + - Number of misses (forecast no and observation yes) + - Integer * - 28 - FN_ON - - Number of forecast no and observation no + - Number of correct negatives (forecast no and observation no) + - Integer * - 29 - BASER - Base rate + - Double * - 30 - FMEAN - Forecast mean + - Double * - 31 - ACC - Accuracy + - Double * - 32 - FBIAS - Frequency Bias + - Double * - 33 - PODY - Probability of detecting yes + - Double * - 34 - PODN - Probability of detecting no + - Double * - 35 - POFD - Probability of false detection + - Double * - 36 - FAR - False alarm ratio + - Double * - 37 - CSI - Critical Success Index + - Double * - 38 - GSS - Gilbert Skill Score + - Double * - 39 - HK - Hanssen-Kuipers Discriminant + - Double * - 40 - HSS - Heidke Skill Score + - Double * - 41 - ODDS - Odds Ratio + - Double * - 42 - LODDS - Logarithm of the Odds Ratio + - Double * - 43 - ORSS - Odds Ratio Skill Score + - Double * - 44 - EDS - Extreme Dependency Score + - Double * - 45 - SEDS - Symmetric Extreme Dependency Score + - Double * - 46 - EDI - Extreme Dependency Index + - Double * - 47 - SEDI - Symmetric Extremal Dependency Index + - Double * - 48 - BAGSS - Bias-Adjusted Gilbert Skill Score + - Double This first file uses the following naming convention: @@ -745,14 +795,11 @@ These object identifiers are described in :numref:`MODE_object_attribute`. :format: html .. _MODE_object_attribute: - + .. list-table:: Object identifier descriptions for MODE object attribute output file. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - mode ASCII OBJECT - - IDENTIFIER DESCRIPTIONS * - Object identifier (object_id) - Valid Data Columns - Description of valid data @@ -777,168 +824,217 @@ The contents of the columns in this ASCII file are summarized in :numref:`MODE_o .. list-table:: Format of MODE object attribute output files. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - mode ASCII OBJECT - - ATTRIBUTE OUTPUT FORMAT - - - * - Column - - MODE Column Name + * - Column Number + - Object Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string designating model name + - String * - 3 - N_VALID - Number of valid data points + - Integer * - 4 - GRID_RES - User-provided nominal grid resolution + - Double * - 5 - DESC - User-provided text string describing the verification task + - String * - 6 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 7 - FCST_VALID - Forecast valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 8 - FCST_ACCUM - Forecast accumulation time in HHMMSS format + - Time String * - 9 - OBS_LEAD - Observation lead time in HHMMSS format; when field2 is actually an observation, this should be "000000" + - Time String * - 10 - OBS_VALID - Observation valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 11 - OBS_ACCUM - Observation accumulation time in HHMMSS format + - Time String * - 12 - FCST_RAD - Forecast convolution radius in grid squares + - Integer * - 13 - FCST_THR - Forecast convolution threshold + - Threshold String * - 14 - OBS_RAD - Observation convolution radius in grid squares + - Integer * - 15 - OBS_THR - Observation convolution threshold + - Threshold String * - 16 - FCST_VAR - Forecast variable + - String * - 17 - FCST_UNITS - Units for forecast variable + - String * - 18 - FCST_LEV - Forecast vertical level + - String * - 19 - OBS_VAR - Observation variable + - String * - 20 - OBS_UNITS - Units for observation variable + - String * - 21 - OBS_LEV - Observation vertical level + - String * - 22 - OBTYPE - User-provided observation type + - String * - 23 - OBJECT_ID - Object numbered from 1 to the number of objects in each field + - String * - 24 - OBJECT_CAT - Object category indicating to which cluster object it belongs + - String * - 25-26 - CENTROID_X, _Y - Location of the centroid (in grid units) + - Double * - 27-28 - CENTROID_LAT, _LON - Location of the centroid (in lat/lon degrees) + - Double * - 29 - AXIS_ANG - Object axis angle (in degrees) + - Double * - 30 - LENGTH - Length of the enclosing rectangle (in grid units) + - Double * - 31 - WIDTH - Width of the enclosing rectangle (in grid units) + - Double * - 32 - AREA - Object area (in grid squares) + - Integer * - 33 - AREA_THRESH - Area of the object containing data values in the raw field that meet the object definition threshold criteria (in grid squares) + - Integer * - 34 - CURVATURE - Radius of curvature of the object defined in terms of third order moments (in grid units) + - Double * - 35-36 - CURVATURE_X, _Y - Center of curvature (in grid coordinates) + - Double * - 37 - COMPLEXITY - Ratio of the difference between the area of an object and the area of its convex hull divided by the area of the complex hull (unitless) + - Double * - 38-42 - INTENSITY_10, _25, _50, _75, _90 - 10th, 25th, 50th, 75th, and 90th percentiles of intensity of the raw field within the object (various units) + - Double * - 43 - INTENSITY_NN - The percentile of intensity chosen for use in the PERCENTILE_INTENSITY_RATIO column (variable units) + - Double * - 44 - INTENSITY_SUM - Sum of the intensities of the raw field within the object (variable units) + - Double * - 45 - CENTROID_DIST - Distance between two objects centroids (in grid units) + - Double * - 46 - BOUNDARY_DIST - Minimum distance between the boundaries of two objects (in grid units) + - Double * - 47 - CONVEX_HULL :raw-html:`
` \_DIST - Minimum distance between the convex hulls of two objects (in grid units) + - Double * - 48 - ANGLE_DIFF - Difference between the axis angles of two objects (in degrees) + - Double * - 49 - ASPECT_DIFF - Absolute value of the difference between the aspect ratios of two objects (unitless) + - Double * - 50 - AREA_RATIO - The forecast object area divided by the observation object area (unitless) :raw-html:`
` **NOTE:** Prior to MET version 10.0.0, the AREA_RATIO was defined as the lesser of the two object areas divided by the greater of the two. + - Double * - 51 - INTERSECTION :raw-html:`
` \_AREA - Intersection area of two objects (in grid squares) + - Double * - 52 - UNION_AREA - Union area of two objects (in grid squares) + - Double * - 53 - SYMMETRIC_DIFF - Symmetric difference of two objects (in grid squares) + - Double * - 54 - INTERSECTION :raw-html:`
` \_OVER_AREA - Ratio of intersection area to the lesser of the forecast and observation object areas (unitless) + - Double * - 55 - CURVATURE :raw-html:`
` \_RATIO - Ratio of the curvature of two objects defined as the lesser of the two divided by the greater of the two (unitless) + - Double * - 56 - COMPLEXITY :raw-html:`
` \_RATIO - Ratio of complexities of two objects defined as the lesser of the forecast complexity divided by the observation complexity or its reciprocal (unitless) + - Double * - 57 - PERCENTILE :raw-html:`
` \_INTENSITY :raw-html:`
` \_RATIO - Ratio of the nth percentile (INTENSITY_NN column) of intensity of the two objects defined as the lesser of the forecast intensity divided by the observation intensity or its reciprocal (unitless) + - Double * - 58 - INTEREST - Total interest value computed for a pair of simple objects (unitless) + - Double **NetCDF Output** @@ -950,10 +1046,8 @@ The dimensions and variables included in the mode NetCDF files are described in .. list-table:: NetCDF dimensions for MODE output. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - mode NETCDF DIMENSIONS - - * - NetCDF Dimension - Description * - lat @@ -993,174 +1087,225 @@ The dimensions and variables included in the mode NetCDF files are described in .. list-table:: Variables contained in MODE NetCDF output. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - mode NETCDF VARIABLES - - * - NetCDF Variable - Dimension - Description + - Data Type * - lat - lat, lon - Latitude + - Float * - lon - lat, lon - Longitude + - Float * - fcst_raw - lat, lon - Forecast raw values + - Float * - fcst_obj_raw - lat, lon - Forecast Object Raw Values + - Float * - fcst_obj_id - lat, lon - Simple forecast object id number for each grid point + - Integer * - fcst_clus_id - lat, lon - Cluster forecast object id number for each grid point + - Integer * - obs_raw - lat, lon - Observation Raw Values + - Float * - obs_obj_raw - lat, lon - Observation Object Raw Values + - Float * - obs_obj_id - \- - Simple observation object id number for each grid point + - Integer * - obs_clus_id - \- - Cluster observation object id number for each grid point + - Integer * - fcst_conv_radius - \- - Forecast convolution radius + - Integer * - obs_conv_radius - \- - Observation convolution radius + - Integer * - fcst_conv :raw-html:`
` \_threshold - \- - Forecast convolution threshold + - String * - obs_conv :raw-html:`
` \_threshold - \- - Observation convolution threshold + - String * - n_fcst_simp - \- - Number of simple forecast objects + - Integer * - n_obs_simp - \- - Number of simple observation objects + - Integer * - n_clus - \- - Number of cluster objects + - Integer * - fcst_simp_bdy :raw-html:`
` \_start - fcst_simp - Forecast Simple Boundary Starting Index + - Integer * - fcst_simp_bdy :raw-html:`
` \_npts - fcst_simp - Number of Forecast Simple Boundary Points + - Integer * - fcst_simp_bdy :raw-html:`
` \_lat - fcst_simp_bdy - Forecast Simple Boundary Latitude + - Float * - fcst_simp_bdy :raw-html:`
` \_lon - fcst_simp_bdy - Forecast Simple Boundary Longitude + - Float * - fcst_simp_bdy_x - fcst_simp_bdy - Forecast Simple Boundary X-Coordinate + - Integer * - fcst_simp_bdy_y - fcst_simp_bdy - Forecast Simple Boundary Y-Coordinate + - Integer * - fcst_simp_hull :raw-html:`
` \_start - fcst_simp - Forecast Simple Convex Hull Starting Index + - Integer * - fcst_simp_hull :raw-html:`
` \_npts - fcst_simp - Number of Forecast Simple Convex Hull Points + - Integer * - fcst_simp_hull :raw-html:`
` \_lat - fcst_simp_hull - Forecast Simple Convex Hull Point Latitude + - Float * - fcst_simp_hull :raw-html:`
` \_lon - fcst_simp_hull - Forecast Simple Convex Hull Point Longitude + - Float * - fcst_simp_hull_x - fcst_simp_hull - Forecast Simple Convex Hull Point X-Coordinate + - Integer * - fcst_simp_hull_y - fcst_simp_hull - Forecast Simple Convex Hull Point Y-Coordinate + - Integer * - obs_simp_bdy :raw-html:`
` \_start - obs_simp - Observation Simple Boundary Starting Index + - Integer * - obs_simp_bdy \_npts - obs_simp - Number of Observation Simple Boundary Points + - Integer * - obs_simp_bdy :raw-html:`
` \_lat - obs_simp_bdy - Observation Simple Boundary Point Latitude + - Float * - obs_simp_bdy :raw-html:`
` \_lon - obs_simp_bdy - Observation Simple Boundary Point Longitude + - Float * - obs_simp_bdy_x - obs_simp_bdy - Observation Simple Boundary Point X-Coordinate + - Integer * - obs_simp_bdy_y - obs_simp_bdy - Observation Simple Boundary Point Y-Coordinate + - Integer * - obs_simp_hull :raw-html:`
` \_start - obs_simp - Observation Simple Convex Hull Starting Index + - Integer * - obs_simp_hull :raw-html:`
` \_npts - obs_simp - Number of Observation Simple Convex Hull Points + - Integer * - obs_simp_hull :raw-html:`
` \_lat - obs_simp_hull - Observation Simple Convex Hull Point Latitude + - Float * - obs_simp_hull :raw-html:`
` \_lon - obs_simp_hull - Observation Simple Convex Hull Point Longitude + - Float * - obs_simp_hull_x - obs_simp_hull - Observation Simple Convex Hull Point X-Coordinate + - Integer * - obs_simp_hull_y - obs_simp_hull - Observation Simple Convex Hull Point Y-Coordinate + - Integer * - fcst_clus_hull :raw-html:`
` \_start - fcst_clus - Forecast Cluster Convex Hull Starting Index + - Integer * - fcst_clus_hull :raw-html:`
` \_npts - fcst_clus - Number of Forecast Cluster Convex Hull Points + - Integer * - fcst_clus_hull :raw-html:`
` \_lat - fcst_clus_hull - Forecast Cluster Convex Hull Point Latitude + - Float * - fcst_clus_hull :raw-html:`
` \_lon - fcst_clus_hull - Forecast Cluster Convex Hull Point Longitude + - Float * - fcst_clus_hull_x - fcst_clus_hull - Forecast Cluster Convex Hull Point X-Coordinate + - Integer * - fcst_clus_hull_y - fcst_clus_hull - Forecast Cluster Convex Hull Point Y-Coordinate + - Integer * - obs_clus_hull :raw-html:`
` \_start - obs_clus - Observation Cluster Convex Hull Starting Index + - Integer * - obs_clus_hull :raw-html:`
` \_npts - obs_clus - Number of Observation Cluster Convex Hull Points + - Integer * - obs_clus_hull :raw-html:`
` \_lat - obs_clus_hull - Observation Cluster Convex Hull Point Latitude + - Float * - obs_clus_hull :raw-html:`
` \_lon - obs_clus_hull - Observation Cluster Convex Hull Point Longitude + - Float * - obs_clus_hull_x - obs_clus_hull - Observation Cluster Convex Hull Point X-Coordinate + - Integer * - obs_clus_hull_y - obs_clus_hull - Observation Cluster Convex Hull Point Y-Coordinate - + - Integer + **Postscript File** Lastly, the MODE tool creates a PostScript plot summarizing the features-based approach used in the verification. The PostScript plot is generated using internal libraries and does not depend on an external plotting package. The generation of this PostScript output can be disabled using the **ps_plot_flag** configuration file option. diff --git a/docs/Users_Guide/point-stat.rst b/docs/Users_Guide/point-stat.rst index edf3315c3a..50fd7c3015 100644 --- a/docs/Users_Guide/point-stat.rst +++ b/docs/Users_Guide/point-stat.rst @@ -524,150 +524,180 @@ The first set of header columns are common to all of the output files generated .. _table_PS_header_info_point-stat_out: -.. list-table:: Common STAT header columns. +.. list-table:: Header information for Point-Stat STAT output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - HEADER - - - - * - Column Number - Header Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string designating model name + - String * - 3 - DESC - User-provided text string describing the verification task + - String * - 4 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 5 - FCST_VALID_BEG - Forecast valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 6 - FCST_VALID_END - Forecast valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 7 - OBS_LEAD - Observation lead time in HHMMSS format + - Time String * - 8 - OBS_VALID_BEG - Observation valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 9 - OBS_VALID_END - Observation valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 10 - FCST_VAR - Model variable + - String * - 11 - FCST_UNITS - Units for model variable + - String * - 12 - FCST_LEV - - Selected Vertical level for forecast + - Selected vertical level for forecast + - String * - 13 - OBS_VAR - Observation variable + - String * - 14 - OBS_UNITS - Units for observation variable + - String * - 15 - OBS_LEV - - Selected Vertical level for observations + - Selected vertical level for observations + - String * - 16 - OBTYPE - Observation message type selected + - String * - 17 - VX_MASK - Verifying masking region indicating the masking grid or polyline region applied + - String * - 18 - INTERP_MTHD - Interpolation method applied to forecasts + - String * - 19 - INTERP_PNTS - Number of points used in interpolation method + - Integer * - 20 - FCST_THRESH - The threshold applied to the forecast + - Threshold String * - 21 - OBS_THRESH - The threshold applied to the observations + - Threshold String * - 22 - COV_THRESH - NA in Point-Stat + - Threshold String * - 23 - ALPHA - Error percent value used in confidence intervals + - Double * - 24 - LINE_TYPE - - Output line types are listed in tables :numref:`table_PS_format_info_FHO` through :numref:`table_PS_format_info_MPR`. + - Output line types are listed in tables :numref:`table_PS_format_info_FHO` through :numref:`table_PS_format_info_SEEPS`. + - String .. _table_PS_format_info_FHO: .. list-table:: Format information for FHO (Forecast, Hit rate, Observation rate) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - FHO OUTPUT FORMAT - - - - * - Column Number - FHO Column Name - Description + - Data Type * - 24 - FHO - Forecast, Hit, Observation line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - F_RATE - Forecast rate + - Double * - 27 - H_RATE - Hit rate + - Double * - 28 - O_RATE - Observation rate + - Double .. _table_PS_format_info_CTC: .. list-table:: Format information for CTC (Contingency Table Counts) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - CTC OUTPUT FORMAT - - - - * - Column Number - CTC Column Name - Description + - Data Type * - 24 - CTC - Contingency Table Counts line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - FY_OY - - Number of forecast yes and observation yes + - Sum of weights for hits (forecast yes and observation yes) + - Double * - 27 - FY_ON - - Number of forecast yes and observation no + - Sum of weights for false alarms (forecast yes and observation no) + - Double * - 28 - FN_OY - - Number of forecast no and observation yes + - Sum of weights for misses (forecast no and observation yes) + - Double * - 29 - FN_ON - - Number of forecast no and observation no + - Sum of weights for correct negatives (forecast no and observation no) + - Double * - 30 - EC_VALUE - Expected correct rate, used for CTS HSS_EC + - Double .. role:: raw-html(raw) :format: html @@ -676,102 +706,108 @@ The first set of header columns are common to all of the output files generated .. list-table:: Format information for CTS (Contingency Table Statistics) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - CTS OUTPUT FORMAT - - - - * - Column Number - CTS Column Name - Description + - Data Type * - 24 - CTS - Contingency Table Statistics line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26-30 - BASER, :raw-html:`
` BASER_NCL, :raw-html:`
` BASER_NCU, :raw-html:`
` BASER_BCL, :raw-html:`
` BASER_BCU - Base rate including normal and bootstrap upper and lower confidence limits + - Double * - 31-35 - FMEAN, :raw-html:`
` FMEAN_NCL, :raw-html:`
` FMEAN_NCU, :raw-html:`
` FMEAN_BCL, :raw-html:`
` FMEAN_BCU - Forecast mean including normal and bootstrap upper and lower confidence limits + - Double * - 36-40 - ACC, :raw-html:`
` ACC_NCL, :raw-html:`
` ACC_NCU, :raw-html:`
` ACC_BCL, :raw-html:`
` ACC_BCU - Accuracy including normal and bootstrap upper and lower confidence limits + - Double * - 41-43 - FBIAS, :raw-html:`
` FBIAS_BCL, :raw-html:`
` FBIAS_BCU - Frequency Bias including bootstrap upper and lower confidence limits + - Double * - 44-48 - PODY, :raw-html:`
` PODY_NCL, :raw-html:`
` PODY_NCU, :raw-html:`
` PODY_BCL, :raw-html:`
` PODY_BCU - Probability of detecting yes including normal and bootstrap upper and lower confidence limits + - Double * - 49-53 - PODN, :raw-html:`
` PODN_NCL, :raw-html:`
` PODN_NCU, :raw-html:`
` PODN_BCL, :raw-html:`
` PODN_BCU - Probability of detecting no including normal and bootstrap upper and lower confidence limits + - Double * - 54-58 - POFD, :raw-html:`
` POFD_NCL, :raw-html:`
` POFD_NCU, :raw-html:`
` POFD_BCL, :raw-html:`
` POFD_BCU - Probability of false detection including normal and bootstrap upper and lower confidence limits + - Double * - 59-63 - FAR, :raw-html:`
` FAR_NCL, :raw-html:`
` FAR_NCU, :raw-html:`
` FAR_BCL, :raw-html:`
` FAR_BCU - False alarm ratio including normal and bootstrap upper and lower confidence limits + - Double * - 64-68 - CSI, :raw-html:`
` CSI_NCL, :raw-html:`
` CSI_NCU, :raw-html:`
` CSI_BCL, :raw-html:`
` CSI_BCU - Critical Success Index including normal and bootstrap upper and lower confidence limits + - Double * - 69-71 - GSS, :raw-html:`
` GSS_BCL, :raw-html:`
` GSS_BCU - Gilbert Skill Score including bootstrap upper and lower confidence limits - -.. role:: raw-html(raw) - :format: html - -.. _table_PS_format_info_CTS_cont: - -.. list-table:: Format information for CTS (Contingency Table Statistics) output line type, continued from above - :widths: auto - :header-rows: 2 - - * - CTS OUTPUT FORMAT (continued) - - - - - * - Column Number - - CTS Column Name - - Description + - Double * - 72-76 - HK, :raw-html:`
` HK_NCL, :raw-html:`
` HK_NCU, :raw-html:`
` HK_BCL, :raw-html:`
` HK_BCU - Hanssen-Kuipers Discriminant including normal and bootstrap upper and lower confidence limits + - Double * - 77-79 - HSS, :raw-html:`
` HSS_BCL, :raw-html:`
` HSS_BCU - Heidke Skill Score including bootstrap upper and lower confidence limits + - Double * - 80-84 - ODDS, :raw-html:`
` ODDS_NCL, :raw-html:`
` ODDS_NCU, :raw-html:`
` ODDS_BCL, :raw-html:`
` ODDS_BCU - Odds Ratio including normal and bootstrap upper and lower confidence limits + - Double * - 85-89 - LODDS, :raw-html:`
` LODDS_NCL, :raw-html:`
` LODDS_NCU, :raw-html:`
` LODDS_BCL, :raw-html:`
` LODDS_BCU - Logarithm of the Odds Ratio including normal and bootstrap upper and lower confidence limits + - Double * - 90-94 - ORSS, :raw-html:`
` ORSS _NCL, :raw-html:`
` ORSS _NCU, :raw-html:`
` ORSS _BCL, :raw-html:`
` ORSS _BCU - Odds Ratio Skill Score including normal and bootstrap upper and lower confidence limits + - Double * - 95-99 - EDS, :raw-html:`
` EDS _NCL, :raw-html:`
` EDS _NCU, :raw-html:`
` EDS _BCL, :raw-html:`
` EDS _BCU - Extreme Dependency Score including normal and bootstrap upper and lower confidence limits + - Double * - 100-104 - SEDS, :raw-html:`
` SEDS _NCL, :raw-html:`
` SEDS _NCU, :raw-html:`
` SEDS _BCL, :raw-html:`
` SEDS _BCU - Symmetric Extreme Dependency Score including normal and bootstrap upper and lower confidence limits + - Double * - 105-109 - EDI, :raw-html:`
` EDI _NCL, :raw-html:`
` EDI _NCU, :raw-html:`
` EDI _BCL, :raw-html:`
` EDI _BCU - Extreme Dependency Index including normal and bootstrap upper and lower confidence limits + - Double * - 111-113 - SEDI, :raw-html:`
` SEDI _NCL, :raw-html:`
` SEDI _NCU, :raw-html:`
` SEDI _BCL, :raw-html:`
` SEDI _BCU - Symmetric Extremal Dependency Index including normal and bootstrap upper and lower confidence limits + - Double * - 115-117 - BAGSS, :raw-html:`
` BAGSS_BCL, :raw-html:`
` BAGSS_BCU - Bias-Adjusted Gilbert Skill Score including bootstrap upper and lower confidence limits + - Double * - 118-120 - HSS_EC, :raw-html:`
` HSS_EC_BCL, :raw-html:`
` HSS_EC_BCU - Heidke Skill Score with user-specific expected correct and bootstrap confidence limits + - Double * - 121 - EC_VALUE - Expected correct rate, used for CTS HSS_EC + - Double .. role:: raw-html(raw) @@ -781,147 +817,160 @@ The first set of header columns are common to all of the output files generated .. list-table:: Format information for CNT (Continuous Statistics) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - CNT OUTPUT FORMAT - - - - * - Column Number - CNT Column Name - Description + - Data Type * - 24 - CNT - Continuous statistics line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26-30 - FBAR, :raw-html:`
` FBAR_NCL, :raw-html:`
` FBAR_NCU, :raw-html:`
` FBAR_BCL, :raw-html:`
` FBAR_BCU - Forecast mean including normal and bootstrap upper and lower confidence limits + - Double * - 31-35 - FSTDEV, :raw-html:`
` FSTDEV_NCL, :raw-html:`
` FSTDEV_NCU, :raw-html:`
` FSTDEV_BCL, :raw-html:`
` FSTDEV_BCU - Standard deviation of the forecasts including normal and bootstrap upper and lower confidence limits + - Double * - 36-40 - OBAR, :raw-html:`
` OBAR_NCL, :raw-html:`
` OBAR_NCU, :raw-html:`
` OBAR_BCL, :raw-html:`
` OBAR_BCU - Observation mean including normal and bootstrap upper and lower confidence limits + - Double * - 41-45 - OSTDEV, :raw-html:`
` OSTDEV_NCL, :raw-html:`
` OSTDEV_NCU, :raw-html:`
` OSTDEV_BCL, :raw-html:`
` OSTDEV_BCU - Standard deviation of the observations including normal and bootstrap upper and lower confidence limits + - Double * - 46-50 - PR_CORR, :raw-html:`
` PR_CORR_NCL, :raw-html:`
` PR_CORR_NCU, :raw-html:`
` PR_CORR_BCL, :raw-html:`
` PR_CORR_BCU - Pearson correlation coefficient including normal and bootstrap upper and lower confidence limits + - Double * - 51 - SP_CORR - Spearman's rank correlation coefficient + - Double * - 52 - KT_CORR - Kendall's tau statistic + - Double * - 53 - RANKS - Number of ranks used in computing Kendall's tau statistic + - Integer * - 54 - FRANK_TIES - Number of tied forecast ranks used in computing Kendall's tau statistic + - Integer * - 55 - ORANK_TIES - Number of tied observation ranks used in computing Kendall's tau statistic + - Integer * - 56-60 - ME, :raw-html:`
` ME_NCL, :raw-html:`
` ME_NCU, :raw-html:`
` ME_BCL, :raw-html:`
` ME_BCU - Mean error (F-O) including normal and bootstrap upper and lower confidence limits + - Double * - 61-65 - ESTDEV, :raw-html:`
` ESTDEV_NCL, :raw-html:`
` ESTDEV_NCU, :raw-html:`
` ESTDEV_BCL, :raw-html:`
` ESTDEV_BCU - Standard deviation of the error including normal and bootstrap upper and lower confidence limits - - -.. role:: raw-html(raw) - :format: html - -.. _table_PS_format_info_CNT_cont: - -.. list-table:: Format information for CNT (Continuous Statistics) output line type continued from above table - :widths: auto - :header-rows: 2 - - * - CNT OUTPUT FORMAT (continued) - - - - - * - Column Number - - CNT Column Name - - Description + - Double * - 66-68 - MBIAS, :raw-html:`
` MBIAS_BCL, :raw-html:`
` MBIAS_BCU - Multiplicative bias including bootstrap upper and lower confidence limits + - Double * - 69-71 - MAE, :raw-html:`
` MAE_BCL, :raw-html:`
` MAE_BCU - Mean absolute error including bootstrap upper and lower confidence limits + - Double * - 72-74 - MSE, :raw-html:`
` MSE_BCL, :raw-html:`
` MSE_BCU - Mean squared error including bootstrap upper and lower confidence limits + - Double * - 75-77 - BCMSE, :raw-html:`
` BCMSE_BCL, :raw-html:`
` BCMSE_BCU - Bias-corrected mean squared error including bootstrap upper and lower confidence limits + - Double * - 78-80 - RMSE, :raw-html:`
` RMSE_BCL, :raw-html:`
` RMSE_BCU - Root mean squared error including bootstrap upper and lower confidence limits + - Double * - 81-95 - E10, :raw-html:`
` E10_BCL, :raw-html:`
` E10_BCU, :raw-html:`
` E25, :raw-html:`
` E25_BCL, :raw-html:`
` E25_BCU, :raw-html:`
` E50, :raw-html:`
` E50_BCL, :raw-html:`
` E50_BCU, :raw-html:`
` E75, :raw-html:`
` E75_BCL, :raw-html:`
` E75_BCU, :raw-html:`
` E90, :raw-html:`
` E90_BCL, :raw-html:`
` E90_BCU - 10th, 25th, 50th, 75th, and 90th percentiles of the error including bootstrap upper and lower confidence limits + - Double * - 96-98 - EIQR, :raw-html:`
` IQR _BCL, :raw-html:`
` IQR _BCU - The Interquartile Range of the error including bootstrap upper and lower confidence limits + - Double * - 99-101 - MAD, :raw-html:`
` MAD_BCL, :raw-html:`
` MAD_BCU - The Median Absolute Deviation including bootstrap upper and lower confidence limits + - Double * - 102-106 - ANOM_CORR, :raw-html:`
` ANOM_CORR_NCL, :raw-html:`
` ANOM_CORR_NCU, :raw-html:`
` ANOM_CORR_BCL, :raw-html:`
` ANOM_CORR_BCU - The Anomaly Correlation including mean error with normal and bootstrap upper and lower confidence limits + - Double * - 107-109 - ME2, :raw-html:`
` ME2_BCL, :raw-html:`
` ME2_BCU - The square of the mean error (bias) including bootstrap upper and lower confidence limits + - Double * - 110-112 - MSESS, :raw-html:`
` MSESS_BCL, :raw-html:`
` MSESS_BCU - The mean squared error skill score including bootstrap upper and lower confidence limits + - Double * - 113-115 - RMSFA, :raw-html:`
` RMSFA_BCL, :raw-html:`
` RMSFA_BCU - Root mean squared forecast anomaly (f-c) including bootstrap upper and lower confidence limits + - Double * - 116-118 - RMSOA, :raw-html:`
` RMSOA_BCL, :raw-html:`
` RMSOA_BCU - Root mean squared observation anomaly (o-c) including bootstrap upper and lower confidence limits + - Double * - 119-121 - ANOM_CORR_UNCNTR, :raw-html:`
` ANOM_CORR_UNCNTR_BCL, :raw-html:`
` ANOM_CORR_UNCNTR_BCU - The uncentered Anomaly Correlation excluding mean error including bootstrap upper and lower confidence limits + - Double * - 122-124 - SI, :raw-html:`
` SI_BCL, :raw-html:`
` SI_BCU - Scatter Index including bootstrap upper and lower confidence limits - + - Double + .. _table_PS_format_info_MCTC: .. list-table:: Format information for MCTC (Multi-category Contingency Table Count) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - MCTC OUTPUT FORMAT - - - - * - Column Number - MCTC Column Name - Description + - Data Type * - 24 - MCTC - Multi-category Contingency Table Counts line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - N_CAT - Dimension of the contingency table + - Integer * - 27 - Fi_Oj - - Count of events in forecast category i and observation category j, with the observations incrementing first (repeated) + - Sum of weights for events in forecast category i and observation category j, with the observations incrementing first (repeated) + - Double * - \* - EC_VALUE - Expected correct rate, used for MCTS HSS_EC + - Double .. role:: raw-html(raw) @@ -929,77 +978,89 @@ The first set of header columns are common to all of the output files generated .. _table_PS_format_info_MCTS: -.. list-table:: Format information for MCTS (Multi- category Contingency Table Statistics) output line type. +.. list-table:: Format information for MCTS (Multi-category Contingency Table Statistics) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - MCTS OUTPUT FORMAT - - - - * - Column Number - MCTS Column Name - Description + - Data Type * - 24 - MCTS - Multi-category Contingency Table Statistics line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - N_CAT - The total number of categories in each dimension of the contingency table. So the total number of cells is N_CAT*N_CAT. + - Integer * - 27-31 - ACC, :raw-html:`
` ACC_NCL, :raw-html:`
` ACC_NCU, :raw-html:`
` ACC_BCL, :raw-html:`
` ACC_BCU - Accuracy, normal confidence limits and bootstrap confidence limits + - Double * - 32-34 - HK, :raw-html:`
` HK_BCL, :raw-html:`
` HK_BCU - Hanssen and Kuipers Discriminant and bootstrap confidence limits + - Double * - 35-37 - HSS, :raw-html:`
` HSS_BCL, :raw-html:`
` HSS_BCU - Heidke Skill Score and bootstrap confidence limits + - Double * - 38-40 - GER, :raw-html:`
` GER_BCL, :raw-html:`
` GER_BCU - Gerrity Score and bootstrap confidence limits + - Double * - 41-43 - HSS_EC, :raw-html:`
` HSS_EC_BCL, :raw-html:`
` HSS_EC_BCU - Heidke Skill Score with user-specific expected correct and bootstrap confidence limits + - Double * - 44 - EC_VALUE - Expected correct rate, used for MCTS HSS_EC + - Double .. _table_PS_format_info_PCT: .. list-table:: Format information for PCT (Contingency Table Counts for Probabilistic forecasts) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - PCT OUTPUT FORMAT - - - - * - Column Number - PCT Column Name - Description + - Data Type * - 24 - PCT - Probability contingency table count line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - N_THRESH - Number of probability thresholds + - Integer * - 27 - THRESH_i - The ith probability threshold value (repeated) + - Double * - 28 - OY_i - - Number of observation yes when forecast is between the ith and i+1th probability thresholds (repeated) + - Sum of weights for observation yes when forecast is between the ith and i+1th probability thresholds (repeated) + - Double * - 29 - ON_i - - Number of observation no when forecast is between the ith and i+1th probability thresholds (repeated) + - Sum of weights for observation no when forecast is between the ith and i+1th probability thresholds (repeated) + - Double * - \* - THRESH_n - Last probability threshold value + - Double .. role:: raw-html(raw) @@ -1009,626 +1070,758 @@ The first set of header columns are common to all of the output files generated .. list-table:: Format information for PSTD (Contingency Table Statistics for Probabilistic forecasts) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - PSTD OUTPUT FORMAT - - - - * - Column Number - PSTD Column Name - Description + - Data Type * - 24 - PSTD - Probabilistic statistics for dichotomous outcome line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - N_THRESH - Number of probability thresholds + - Integer * - 27-29 - BASER, :raw-html:`
` BASER_NCL, :raw-html:`
` BASER_NCU - The Base Rate, including normal upper and lower confidence limits + - Double * - 30 - RELIABILITY - Reliability + - Double * - 31 - RESOLUTION - Resolution + - Double * - 32 - UNCERTAINTY - Uncertainty + - Double * - 33 - ROC_AUC - Area under the receiver operating characteristic curve + - Double * - 34-36 - BRIER, :raw-html:`
` BRIER_NCL, :raw-html:`
` BRIER_NCU - Brier Score including normal upper and lower confidence limits + - Double * - 37-39 - BRIERCL, :raw-html:`
` BRIERCL_NCL, :raw-html:`
` BRIERCL_NCU - Climatological Brier Score including upper and lower normal confidence limits + - Double * - 40 - BSS - Brier Skill Score relative to external climatology + - Double * - 41 - BSS_SMPL - Brier Skill Score relative to sample climatology + - Double * - 42 - THRESH_i - The ith probability threshold value (repeated) + - Double .. _table_PS_format_info_PJC: .. list-table:: Format information for PJC (Joint and Conditional factorization for Probabilistic forecasts) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - PJC OUTPUT FORMAT - - - - * - Column Number - PJC Column Name - Description + - Data Type * - 24 - PJC - Probabilistic Joint/Continuous line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - N_THRESH - Number of probability thresholds + - Integer * - 27 - THRESH_i - The ith probability threshold value (repeated) + - Double * - 28 - OY_TP_i - Number of observation yes when forecast is between the ith and i+1th probability thresholds as a proportion of the total OY (repeated) + - Double * - 29 - ON_TP_i - Number of observation no when forecast is between the ith and i+1th probability thresholds as a proportion of the total ON (repeated) + - Double * - 30 - CALIBRATION_i - Calibration when forecast is between the ith and i+1th probability thresholds (repeated) + - Double * - 31 - REFINEMENT_i - Refinement when forecast is between the ith and i+1th probability thresholds (repeated) + - Double * - 32 - LIKELIHOOD_i - - Likelihood when forecast is between the ith and i+1th probability thresholds (repeated + - Likelihood when forecast is between the ith and i+1th probability thresholds (repeated) + - Double * - 33 - BASER_i - Base rate when forecast is between the ith and i+1th probability thresholds (repeated) + - Double * - \* - THRESH_n - Last probability threshold value + - Double .. _table_PS_format_info_PRC: -.. list-table:: Format information for PRC (PRC for Receiver Operating Characteristic for Probabilistic forecasts) output line type. +.. list-table:: Format information for PRC (Receiver Operating Characteristic for Probabilistic forecasts) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - PRC OUTPUT FORMAT - - - - * - Column Number - PRC Column Name - Description + - Data Type * - 24 - PRC - Probability ROC points line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - N_THRESH - Number of probability thresholds + - Integer * - 27 - THRESH_i - The ith probability threshold value (repeated) + - Double * - 28 - PODY_i - Probability of detecting yes when forecast is greater than the ith probability thresholds (repeated) + - Double * - 29 - POFD_i - Probability of false detection when forecast is greater than the ith probability thresholds (repeated) + - Double * - \* - THRESH_n - Last probability threshold value + - Double .. _table_PS_format_info_ECLV: -.. list-table:: Format information for ECLV (ECLV for Economic Cost/Loss Relative Value) output line type. +.. list-table:: Format information for ECLV (Economic Cost/Loss Relative Value) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - ECLV OUTPUT FORMAT - - - - * - Column Number - - PRC Column Name + - ECLV Column Name - Description + - Data Type * - 24 - ECLV - Economic Cost/Loss Relative Value line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - BASER - Base rate + - Double * - 27 - VALUE_BASER - Economic value of the base rate + - Double * - 28 - N_PNT - Number of Cost/Loss ratios + - Integer * - 29 - CL_i - ith Cost/Loss ratio evaluated + - Double * - 30 - VALUE_i - Relative value for the ith Cost/Loss ratio + - Double .. _table_PS_format_info_SL1L2: .. list-table:: Format information for SL1L2 (Scalar Partial Sums) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - SL1L2 OUTPUT FORMAT - - - - * - Column Number - SL1L2 Column Name - Description + - Data Type * - 24 - SL1L2 - Scalar L1L2 line type + - String * - 25 - TOTAL - Total number of matched pairs of forecast (f) and observation (o) + - Integer * - 26 - FBAR - Mean(f) + - Double * - 27 - OBAR - Mean(o) + - Double * - 28 - FOBAR - Mean(f*o) + - Double * - 29 - FFBAR - Mean(f²) + - Double * - 30 - OOBAR - Mean(o²) + - Double * - 31 - MAE - Mean(\|f-o\|) + - Double .. _table_PS_format_info_SAL1L2: .. list-table:: Format information for SAL1L2 (Scalar Anomaly Partial Sums) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - SAL1L2 OUTPUT FORMAT - - - - * - Column Number - SAL1L2 Column Name - Description + - Data Type * - 24 - SAL1L2 - Scalar Anomaly L1L2 line type + - String * - 25 - TOTAL - Total number of matched pairs of forecast (f), observation (o), forecast climatology (cf), and observation climatology (co) + - Integer * - 26 - FABAR - Mean(f-cf) + - Double * - 27 - OABAR - Mean(o-co) + - Double * - 28 - FOABAR - Mean((f-cf)*(o-co)) + - Double * - 29 - FFABAR - Mean((f-cf)²) + - Double * - 30 - OOABAR - Mean((o-co)²) + - Double * - 31 - MAE - Mean(\|(f-cf)-(o-co)\|) + - Double .. _table_PS_format_info_VL1L2: .. list-table:: Format information for VL1L2 (Vector Partial Sums) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - VL1L2 OUTPUT FORMAT - - - - * - Column Number - VL1L2 Column Name - Description + - Data Type * - 24 - VL1L2 - Vector L1L2 line type + - String * - 25 - TOTAL - Total number of matched pairs of forecast winds (uf, vf) and observation winds (uo, vo) + - Integer * - 26 - UFBAR - Mean(uf) + - Double * - 27 - VFBAR - Mean(vf) + - Double * - 28 - UOBAR - Mean(uo) + - Double * - 29 - VOBAR - Mean(vo) + - Double * - 30 - UVFOBAR - Mean(uf*uo+vf*vo) + - Double * - 31 - UVFFBAR - Mean(uf²+vf²) + - Double * - 32 - UVOOBAR - Mean(uo²+vo²) + - Double * - 33 - F_SPEED_BAR - Mean forecast wind speed + - Double * - 34 - O_SPEED_BAR - Mean observed wind speed + - Double * - 35 - TOTAL_DIR - Total number of matched pairs for which both the forecast and observation wind directions are well-defined (i.e. non-zero vectors) + - Double * - 36 - DIR_ME - Mean wind direction difference, from -180 to 180 degrees + - Double * - 37 - DIR_MAE - Mean absolute wind direction difference + - Double * - 38 - DIR_MSE - Mean squared wind direction difference + - Double .. _table_PS_format_info_VAL1L2: .. list-table:: Format information for VAL1L2 (Vector Anomaly Partial Sums) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - VAL1L2 OUTPUT FORMAT - - - - * - Column Number - VAL1L2 Column Name - Description + - Data Type * - 24 - VAL1L2 - Vector Anomaly L1L2 line type + - String * - 25 - TOTAL - Total number of matched pairs of forecast winds (uf, vf), observation winds (uo, vo), forecast climatology winds (ucf, vcf), and observation climatology winds (uco, vco) + - Integer * - 26 - UFABAR - Mean(uf-ucf) + - Double * - 27 - VFABAR - Mean(vf-vcf) + - Double * - 28 - UOABAR - Mean(uo-uco) + - Double * - 29 - VOABAR - Mean(vo-vco) + - Double * - 30 - UVFOABAR - Mean((uf-ucf)*(uo-uco)+(vf-vcf)*(vo-vco)) + - Double * - 31 - UVFFABAR - Mean((uf-ucf)²+(vf-vcf)²) + - Double * - 32 - UVOOABAR - Mean((uo-uco)²+(vo-vco)²) + - Double * - 33 - FA_SPEED_BAR - Mean forecast wind speed anomaly + - Double * - 34 - OA_SPEED_BAR - Mean observed wind speed anomaly + - Double * - 35 - TOTAL_DIR - Total number of matched pairs for which the forecast, observation, forecast climatology, and observation climatology wind directions are well-defined (i.e. non-zero vectors) + - Double * - 36 - DIRA_ME - Mean wind direction anomaly difference, from -180 to 180 degrees + - Double * - 37 - DIRA_MAE - Mean absolute wind direction anomaly difference + - Double * - 38 - DIRA_MSE - Mean squared wind direction anomaly difference + - Double .. _table_PS_format_info_VCNT: .. list-table:: Format information for VCNT (Vector Continuous Statistics) output line type. Note that the bootstrap confidence intervals columns ending with BCL and BCU are not currently calculated for this release of MET, but will be in future releases. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - VCNT OUTPUT FORMAT - - - - * - Column Numbers - VCNT Column Name - Description + - Data Type * - 24 - VCNT - Vector Continuous Statistics line type + - String * - 25 - TOTAL - Total number of data points + - Integer * - 26-28 - FBAR, :raw-html:`
` FBAR_BCL, :raw-html:`
` FBAR_BCU - Mean value of forecast wind speed including bootstrap upper and lower confidence limits + - Double * - 29-31 - OBAR, :raw-html:`
` OBAR_BCL, :raw-html:`
` OBAR_BCU - Mean value of observed wind speed including bootstrap upper and lower confidence limits + - Double * - 32-34 - FS_RMS, :raw-html:`
` FS_RMS_BCL, :raw-html:`
` FS_RMS_BCU - Root mean square forecast wind speed including bootstrap upper and lower confidence limits + - Double * - 35-37 - OS_RMS, :raw-html:`
` OS_RMS_BCL, :raw-html:`
` OS_RMS_BCU - Root mean square observed wind speed including bootstrap upper and lower confidence limits + - Double * - 38-40 - MSVE, :raw-html:`
` MSVE_BCL, :raw-html:`
` MSVE_BCU - Mean squared length of the vector difference between the forecast and observed winds including bootstrap upper and lower confidence limits + - Double * - 41-43 - RMSVE, :raw-html:`
` RMSVE_BCL, :raw-html:`
` RMSVE_BCU - Square root of MSVE including bootstrap upper and lower confidence limits + - Double * - 45-46 - FSTDEV, :raw-html:`
` FSTDEV_BCL, :raw-html:`
` FSTDEV_BCU - Standard deviation of the forecast wind speed including bootstrap upper and lower confidence limits + - Double * - 47-49 - OSTDEV, :raw-html:`
` OSTDEV_BCL, :raw-html:`
` OSTDEV_BCU - Standard deviation of the observed wind field including bootstrap upper and lower confidence limits + - Double * - 50-52 - FDIR, :raw-html:`
` FDIR_BCL, :raw-html:`
` FDIR_BCU - Direction of the average forecast wind vector including bootstrap upper and lower confidence limits + - Double * - 53-55 - ODIR, :raw-html:`
` ODIR_BCL, :raw-html:`
` ODIR_BCU - Direction of the average observed wind vector including bootstrap upper and lower confidence limits + - Double * - 56-58 - FBAR_SPEED, :raw-html:`
` FBAR_SPEED_BCL, :raw-html:`
` FBAR_SPEED_BCU - Length (speed) of the average forecast wind vector including bootstrap upper and lower confidence limits + - Double * - 59-61 - OBAR_SPEED, :raw-html:`
` OBAR_SPEED_BCL, :raw-html:`
` OBAR_SPEED_BCU - Length (speed) of the average observed wind vector including bootstrap upper and lower confidence limits + - Double * - 62-64 - VDIFF_SPEED, :raw-html:`
` VDIFF_SPEED_BCL, :raw-html:`
` VDIFF_SPEED_BCU - Length (speed) of the vector difference between the average forecast and average observed wind vectors including bootstrap upper and lower confidence limits + - Double * - 65-67 - VDIFF_DIR, :raw-html:`
` VDIFF_DIR_BCL, :raw-html:`
` VDIFF_DIR_BCU - Direction of the vector difference between the average forecast and average wind vectors including bootstrap upper and lower confidence limits + - Double * - 68-70 - SPEED_ERR, :raw-html:`
` SPEED_ERR_BCL, :raw-html:`
` SPEED_ERR_BCU - Difference between the length of the average forecast wind vector and the average observed wind vector (in the sense F - O) including bootstrap upper and lower confidence limits + - Double * - 71-73 - SPEED_ABSERR, :raw-html:`
` SPEED_ABSERR_BCL, :raw-html:`
` SPEED_ABSERR_BCU - Absolute value of SPEED_ERR including bootstrap upper and lower confidence limits + - Double * - 74-76 - DIR_ERR, :raw-html:`
` DIR_ERR_BCL, :raw-html:`
` DIR_ERR_BCU - Signed angle between the directions of the average forecast and observed wing vectors. Positive if the forecast wind vector is counterclockwise from the observed wind vector including bootstrap upper and lower confidence limits + - Double * - 77-79 - DIR_ABSERR, :raw-html:`
` DIR_ABSERR_BCL, :raw-html:`
` DIR_ABSERR_BCU - Absolute value of DIR_ABSERR including bootstrap upper and lower confidence limits + - Double * - 80-84 - ANOM_CORR, :raw-html:`
` ANOM_CORR_NCL, :raw-html:`
` ANOM_CORR_NCU, :raw-html:`
` ANOM_CORR_BCL, :raw-html:`
` ANOM_CORR_BCU - Vector Anomaly Correlation including mean error with normal and bootstrap upper and lower confidence limits + - Double * - 85-87 - ANOM_CORR_UNCNTR, :raw-html:`
` ANOM_CORR_UNCNTR_BCL, :raw-html:`
` ANOM_CORR_UNCNTR_BCU - Uncentered vector Anomaly Correlation excluding mean error including bootstrap upper and lower confidence limits + - Double * - 88 - TOTAL_DIR - Total number of matched pairs for which both the forecast and observation wind directions are well-defined (i.e. non-zero vectors) + - Double * - 89-91 - DIR_ME, :raw-html:`
` DIR_ME_BCL, :raw-html:`
` DIR_ME_BCU - Mean direction difference, from -180 to 180 degrees, including bootstrap upper and lower confidence limits + - Double * - 92-94 - DIR_MAE, :raw-html:`
` DIR_MAE_BCL, :raw-html:`
` DIR_MAE_BCU - Mean absolute direction difference including bootstrap upper and lower confidence limits + - Double * - 95-97 - DIR_MSE, :raw-html:`
` DIR_MSE_BCL, :raw-html:`
` DIR_MSE_BCU - Mean squared direction difference including bootstrap upper and lower confidence limits + - Double * - 98-100 - DIR_RMSE, :raw-html:`
` DIR_RMSE_BCL, :raw-html:`
` DIR_RMSE_BCU - Root mean squared direction difference including bootstrap upper and lower confidence limits + - Double .. _table_PS_format_info_MPR: .. list-table:: Format information for MPR (Matched Pair) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - MPR OUTPUT FORMAT - - - - * - Column Number - MPR Column Name - Description + - Data Type * - 24 - MPR - Matched Pair line type + - String * - 25 - TOTAL - Total number of matched pairs + - Integer * - 26 - INDEX - Index for the current matched pair + - Integer * - 27 - OBS_SID - Station Identifier of observation + - String * - 28 - OBS_LAT - Latitude of the observation in degrees north + - Double * - 29 - OBS_LON - Longitude of the observation in degrees east + - Double * - 30 - OBS_LVL - Pressure level of the observation in hPa or accumulation interval in hours + - Double * - 31 - OBS_ELV - Elevation of the observation in meters above sea level + - Double * - 32 - FCST - Forecast value interpolated to the observation location + - Double * - 33 - OBS - Observation value + - Double * - 34 - OBS_QC - Quality control flag for observation + - String * - 35 - OBS_CLIMO_MEAN - Observation climatological mean value (named CLIMO_MEAN prior to met-12.0.0) + - Double * - 36 - OBS_CLIMO_STDEV - Observation climatological standard deviation value (named CLIMO_STDEV prior to met-12.0.0) + - Double * - 37 - OBS_CLIMO_CDF - Observation climatological cumulative distribution function value (named CLIMO_CDF prior to met-12.0.0) + - Double * - 38 - FCST_CLIMO_MEAN - Forecast climatological mean value + - Double * - 39 - FCST_CLIMO_STDEV - Forecast climatological standard deviation value + - Double .. _table_PS_format_info_SEEPS_MPR: .. list-table:: Format information for SEEPS (Stable Equitable Error in Probability Space) of MPR (Matched Pair) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - SEEPS_MPR OUTPUT FORMAT - - - - * - Column Number - SEEPS_MPR Column Name - Description + - Data Type * - 24 - SEEPS_MPR - SEEPS Matched Pair line type + - String * - 25 - OBS_SID - Station Identifier of observation + - String * - 26 - OBS_LAT - Latitude of the observation in degrees north + - Double * - 27 - OBS_LON - Longitude of the observation in degrees east + - Double * - 28 - FCST - Forecast value interpolated to the observation location + - Double * - 29 - OBS - Observation value + - Double * - 30 - OBS_QC - Quality control flag for observation + - String * - 31 - FCST_CAT - Forecast category (dry, light, or heavy) + - Integer * - 32 - OBS_CAT - Observation category (dry, light, or heavy) + - Integer * - 33 - P1 - Climo-derived probability value for this station (dry) + - Double * - 34 - P2 - Climo-derived probability value for this station (dry + light) + - Double * - 35 - T1 - Threshold 1 for P1 (dry) + - Double * - 36 - T2 - Threshold 2 for P2 (dry + light) + - Double * - 37 - SEEPS - SEEPS (Stable Equitable Error in Probability Space) score + - Double .. _table_PS_format_info_SEEPS: .. list-table:: Format information for SEEPS (Stable Equitable Error in Probability Space) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - SEEPS OUTPUT FORMAT - - - - * - Column Number - SEEPS Column Name - Description + - Data Type * - 24 - SEEPS - SEEPS line type + - String * - 25 - TOTAL - Total number of SEEPS matched pairs + - Integer * - 26 - ODFL - Counts multiplied by the weights for the observation dry, forecast light category + - Double * - 27 - ODFH - Counts multiplied by the weights for the observation dry, forecast heavy category + - Double * - 28 - OLFD - Counts multiplied by the weights for the observation light, forecast dry category + - Double * - 29 - OLFH - Counts multiplied by the weights for the observation light, forecast heavy category + - Double * - 30 - OHFD - Counts multiplied by the weights for the observation heavy, forecast dry category + - Double * - 31 - OHFL - Counts multiplied by the weights for the observation heavy, forecast light category + - Double * - 32 - PF1 - Marginal probabilities of the forecast dry (FCST_CAT 0) + - Double * - 33 - PF2 - Marginal probabilities of the forecast light (FCST_CAT 1) + - Double * - 34 - PF3 - Marginal probabilities of the forecast heavy (FCST_CAT 2) + - Double * - 35 - PV1 - Marginal probabilities of the observed dry (OBS_CAT 0) + - Double * - 36 - PV2 - Marginal probabilities of the observed light (OBS_CAT 1) + - Double * - 37 - PV3 - Marginal probabilities of the observed heavy (OBS_CAT 2) + - Double * - 38 - SEEPS - Averaged SEEPS (Stable Equitable Error in Probability Space) score + - Double The STAT output files described for point_stat may be used as inputs to the Stat-Analysis tool. For more information on using the Stat-Analysis tool to create stratifications and aggregations of the STAT files produced by point_stat, please see :numref:`stat-analysis`. diff --git a/docs/Users_Guide/reformat_grid.rst b/docs/Users_Guide/reformat_grid.rst index d1bc065073..21c389829a 100644 --- a/docs/Users_Guide/reformat_grid.rst +++ b/docs/Users_Guide/reformat_grid.rst @@ -181,10 +181,8 @@ Each NetCDF file generated by the Pcp-Combine tool contains the dimensions and v .. list-table:: NetCDF file dimensions for pcp_combine output. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - Pcp_combine NetCDF dimensions - - * - NetCDF dimension - Description * - lat @@ -195,25 +193,26 @@ Each NetCDF file generated by the Pcp-Combine tool contains the dimensions and v .. list-table:: NetCDF variables for pcp_combine output. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - Pcp_combine NetCDF variables - - - - * - NetCDF variable - Dimension - Description + - Data Type * - lat - lat, lon - Latitude value for each point in the grid + - Double * - lon - lat, lon - Longitude value for each point in the grid + - Double * - Name and level of the requested data or value of the -name option. - lat, lon - Data value (i.e. accumulated precipitation) for each point in the grid. The name of the variable describes the name and level and any derivation logic that was applied. + - Double -.. _regrid-data-plane: +.. _regrid-data-plane: Regrid-Data-Plane Tool ====================== diff --git a/docs/Users_Guide/reformat_point.rst b/docs/Users_Guide/reformat_point.rst index 9a27cebf07..5f92d7706d 100644 --- a/docs/Users_Guide/reformat_point.rst +++ b/docs/Users_Guide/reformat_point.rst @@ -311,12 +311,10 @@ Each NetCDF file generated by the PB2NC tool contains the dimensions and variabl .. _table_reformat-point_pb2nc_output_dim: -.. list-table:: NetCDF file dimensions for pb2n output +.. list-table:: NetCDF file dimensions for pb2nc output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - pb2nc NetCDF DIMENSIONS - - * - NetCDF Dimension - Description * - mxstr, mxstr2, mxstr3 @@ -336,77 +334,96 @@ Each NetCDF file generated by the PB2NC tool contains the dimensions and variabl .. list-table:: NetCDF variables in pb2nc output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - pb2nc NetCDF VARIABLES - - - - * - NetCDF Variable - Dimension - Description + - Data Type * - obs_qty - nobs - - Integer value of the n_obs_qty dimension for the observation quality control string. + - Integer value of the n_obs_qty dimension for the observation quality control string + - Integer * - obs_hid - nobs - - Integer value of the nhdr dimension for the header arrays with which this observation is associated. + - Integer value of the nhdr dimension for the header arrays with which this observation is associated + - Integer * - obs_vid - nobs - - Integer value of the obs_var_num dimension for the observation variable name, units, and description. + - Integer value of the obs_var_num dimension for the observation variable name, units, and description + - Integer * - obs_lvl - nobs - - Floating point pressure level in hPa or accumulation interval. + - Floating point pressure level in hPa or accumulation interval + - Float * - obs_hgt - nobs - - Floating point height in meters above sea level. + - Floating point height in meters above sea level + - Float * - obs_val - nobs - Floating point observation value. + - Float * - hdr_typ - nhdr - - Integer value of the nhdr_typ dimension for the message type string. + - Integer value of the nhdr_typ dimension for the message type string + - Integer * - hdr_sid - nhdr - - Integer value of the nhdr_sid dimension for the station ID string. + - Integer value of the nhdr_sid dimension for the station ID string + - Integer * - hdr_vld - nhdr - - Integer value of the nhdr_vld dimension for the valid time string. + - Integer value of the nhdr_vld dimension for the valid time string + - Integer * - hdr_lat, hdr_lon - nhdr - - Floating point latitude in degrees north and longitude in degrees east. + - Floating point latitude in degrees north and longitude in degrees east + - Float * - hdr_elv - nhdr - - Floating point elevation of observing station in meters above sea level. + - Floating point elevation of observing station in meters above sea level + - Float * - hdr_prpt_typ - npbhdr - - Integer PrepBUFR report type value. + - Integer PrepBUFR report type value + - Integer * - hdr_irpt_typ - npbhdr - - Integer input report type value. + - Integer input report type value + - Integer * - hdr_inst_typ - npbhdr - - Integer instrument type value. + - Integer instrument type value + - Integer * - hdr_typ_table - nhdr_typ, - - mxstr2 Lookup table containing unique message type strings. + - mxstr2 Lookup table containing unique message type strings + - String * - hdr_sid_table - - nhdr_sid, - - mxstr2 Lookup table containing unique station ID strings. + - nhdr_sid, mxstr2 + - mxstr2 Lookup table containing unique station ID strings + - String * - hdr_vld_table - nhdr_vld, mxstr - - Lookup table containing unique valid time strings in YYYYMMDD_HHMMSS UTC format. + - Lookup table containing unique valid time strings in YYYYMMDD_HHMMSS UTC format + - Datetime String * - obs_qty_table - nobs_qty, mxstr - - Lookup table containing unique quality control strings. + - Lookup table containing unique quality control strings + - String * - obs_var - obs_var_num, mxstr - - Lookup table containing unique observation variable names. + - Lookup table containing unique observation variable names + - String * - obs_unit - obs_var_num, mxstr2 - - Lookup table containing a units string for the unique observation variable names in obs_var. + - Lookup table containing a units string for the unique observation variable names in obs_var + - String * - obs_desc - obs_var_num, mxstr3 - - Lookup table containing a description string for the unique observation variable names in obs_var. + - Lookup table containing a description string for the unique observation variable names in obs_var + - String ASCII2NC Tool ============= @@ -441,11 +458,8 @@ The default ASCII point observation format consists of one row of data per obser .. list-table:: Input MET ascii2nc point observation format :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - ascii2nc ASCII Point Observation Format * - Column - Name - Description diff --git a/docs/Users_Guide/stat-analysis.rst b/docs/Users_Guide/stat-analysis.rst index 0b87586d09..62acb12494 100644 --- a/docs/Users_Guide/stat-analysis.rst +++ b/docs/Users_Guide/stat-analysis.rst @@ -786,59 +786,72 @@ The SSIDX line type consists of the common STAT header columns described in :num .. list-table:: Format information for the SSIDX (Skill Score Index) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - SSIDX OUTPUT FORMAT - - - - * - Column Number - SSIDX Column Name - Description + - Data Type * - 4 - FCST_LEAD - Maximum input forecast lead time + - Time String * - 5 - FCST_VALID_BEG - Minimum input forecast valid start time + - Datetime String * - 6 - FCST_VALID_END - Maximum input forecast valid end time + - Datetime String * - 7 - OBS_LEAD - Maximum input observation lead time + - Time String * - 8 - OBS_VALID_BEG - Minimum input observation valid start time + - Datetime String * - 9 - OBS_VALID_END - Maximum input observation valid end time + - Datetime String * - 10 - FCST_VAR - Skill score index name from the "ss_index_name" option + - String * - 11 - OBS_VAR - Skill score index name from the "ss_index_name" option + - String * - 24 - SSIDX - Skill score index line type + - String * - 25 - FCST_MODEL - Forecast model name + - String * - 26 - REF_MODEL - Reference model name + - String * - 27 - N_INIT - Number of unique input model initialization times + - Integer * - 28 - N_TERM - Number of skill score index terms + - Integer * - 29 - N_VLD - Number of terms for which a valid skill score was computed + - Integer * - 30 - SS_INDEX - Skill score index value + - Double Job: ramp ^^^^^^^^^ diff --git a/docs/Users_Guide/tc-diag.rst b/docs/Users_Guide/tc-diag.rst index 14c6e5ffbd..c33e6227c4 100644 --- a/docs/Users_Guide/tc-diag.rst +++ b/docs/Users_Guide/tc-diag.rst @@ -273,10 +273,8 @@ When the **nc_diag_flag** configuration entry is set to true, a NetCDF output fi .. list-table:: Dimensions defined in NetCDF Diagnostics output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - tc_diag NETCDF DIMENSIONS - - * - NetCDF Dimension - Description * - time @@ -291,44 +289,52 @@ When the **nc_diag_flag** configuration entry is set to true, a NetCDF output fi .. list-table:: Variables defined in NetCDF Diagnostics output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - tc_diag NETCDF VARIABLES - - - - * - NetCDF Variable - Dimension - Description + - Data Type * - storm_id - NA - Tropical Cyclone Storm ID (BBNNYYYY) consisting of 2-letter basin name, 2-digit storm number, and 4-digit year + - String * - model - NA - Track ATCF ID model name + - String * - init_time - NA - Track initialization time string in YYYYMMDD_HHMMSS format + - Datetime String * - init_time_ut - NA - Track initialization time string in unixtime (seconds since January 1, 1970) format + - String * - valid_time - time - Track point valid time string in YYYYMMDD_HHMMSS format + - Datetime String * - valid_time_ut - time - Track point valid time string in unixtime (seconds since January 1, 1970) format + - String * - lead_time - time - Track point forecast lead time string in HHMMSS format + - Time String * - lead_time_sec - time - Track point forecast lead time integer number of seconds + - Integer * - {DOMAIN}_domain - NA - Attributes define the range/azimuth grid for the {DOMAIN} domain: **n_range**, **n_azimuth**, **delta_range_km** + - Integer * - Diagnostic values - time or time and pressure - Computed diagnostic values for each track point and, optionally, pressure level. The **units** attribute defines the units of the diagnostic values. + - Double **NetCDF Range-Azimuth Output** @@ -346,10 +352,8 @@ The NetCDF range-azimuth file contains the dimensions and variables shown in :nu .. list-table:: Dimensions defined in NetCDF Range-Azimuth output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - tc_diag NETCDF DIMENSIONS - - * - NetCDF Dimension - Description * - track_line @@ -370,73 +374,91 @@ The NetCDF range-azimuth file contains the dimensions and variables shown in :nu .. list-table:: Variables defined in NetCDF Range-Azimuth output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - tc_diag NETCDF VARIABLES - - - - * - NetCDF Variable - Dimension - Description + - Data Type * - storm_id - NA - Tropical Cyclone Storm ID (BBNNYYYY) consisting of 2-letter basin name, 2-digit storm number, and 4-digit year + - String * - model - NA - Track ATCF ID model name + - String * - TrackLines - track_lines - Raw input ATCF track lines + - String * - TrackLat - time - Track point location latitude + - Double * - TrackLon - time - Track point location longitude + - Double * - TrackMSLP - time - Track point minimum sea level pressure + - Double * - TrackVMax - time - Track point maximum wind speed + - Double * - init_time - NA - Track initialization time string in YYYYMMDD_HHMMSS format + - Datetime String * - init_time_ut - NA - Track initialization time string in unixtime (seconds since January 1, 1970) format + - String * - valid_time - time - Track point valid time string in YYYYMMDD_HHMMSS format + - Datetime String * - valid_time_ut - time - Track point valid time string in unixtime (seconds since January 1, 1970) format + - String * - lead_time - time - Track point forecast lead time string in HHMMSS format + - Time String * - lead_time_sec - time - Track point forecast lead time integer number of seconds + - Integer * - range - range - Range ring coordinate variable in kilometers + - Double * - azimuth - azimuth - Azimuth coordinate variable in degrees clockwise from north + - Double * - pressure - pressure - Vertical level pressure coordinate variable in millibars + - Double * - lat - time, range, azimuth - Latitude in degrees north for each range-azimuth grid point + - Double * - lon - time, range, azimuth - Longitude in degrees east for each range-azimuth grid point + - Double * - single level data (e.g. TMP_Z2, PRMSL_L0) - time, range, azimuth - Gridded range-azimuth data on a single level + - Double * - pressure level data (e.g. TMP, HGT) - time, pressure, range, azimuth - Gridded range-azimuth data on pressure levels + - Double diff --git a/docs/Users_Guide/tc-gen.rst b/docs/Users_Guide/tc-gen.rst index acecd3853c..3d2b1f3eb2 100644 --- a/docs/Users_Guide/tc-gen.rst +++ b/docs/Users_Guide/tc-gen.rst @@ -488,200 +488,247 @@ TC-Gen produces output in STAT and, optionally, ASCII and NetCDF formats. The AS .. _table_TG_header_info_tg_outputs: -.. list-table:: Header information for each file tc-gen outputs +.. list-table:: Header information for TC-Gen STAT output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - HEADER - - - - * - Column Number - Header Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - Current ATCF Technique name + - String * - 3 - DESC - User-provided text string describing the "filter" options + - String * - 4 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 5 - FCST_VALID_BEG - Minimum forecast valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 6 - FCST_VALID_END - Maximum forecast valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 7 - OBS_LEAD - Does not apply and is set to NA + - Time String * - 8 - OBS_VALID_BEG - Minimum Best track valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 9 - OBS_VALID_END - Maximum Best track valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 10 - FCST_VAR - Genesis methodology (GENESIS_DEV, GENESIS_OPS, PROB_GENESIS, or GENESIS_SHAPE) + - String * - 11 - FCST_UNITS - Does not apply and is set to NA + - String * - 12 - FCST_LEV - Does not apply and is set to NA + - String * - 13 - OBS_VAR - Genesis methodology (GENESIS_DEV, GENESIS_OPS, PROB_GENESIS, or GENESIS_SHAPE) + - String * - 14 - OBS_UNITS - Does not apply and is set to NA + - String * - 15 - OBS_LEV - Does not apply and is set to NA + - String * - 16 - OBTYPE - Verifying Best track technique name + - String * - 17 - VX_MASK - Verifying masking region + - String * - 18 - INTERP_MTHD - Does not apply and is set to NA + - String * - 19 - INTERP_PNTS - Does not apply and is set to NA + - Integer * - 20 - FCST_THRESH - Does not apply and is set to NA + - Threshold String * - 21 - OBS_THRESH - Does not apply and is set to NA + - Threshold String * - 22 - COV_THRESH - Does not apply and is set to NA + - Threshold String * - 23 - ALPHA - Error percent value used in confidence intervals + - Double * - 24 - LINE_TYPE - Various line type options, refer to :numref:`point_stat-output` and the tables below. + - String .. _table_TG_format_info_GENMPR: .. list-table:: Format information for GENMPR (Genesis Matched Pairs) output line type :widths: auto - :header-rows: 2 + :header-rows: 1 - * - GENMPR OUTPUT FORMAT - - - - * - Column Number - GENMPR Column Name - Description + - Data Type * - 5, 6 - FCST_VALID_BEG, FCST_VALID_END - Forecast genesis time in YYYYMMDD_HHMMSS format + - Datetime String * - 8, 9 - OBS_VALID_BEG, OBS_VALID_END - Best track genesis time in YYYYMMDD_HHMMSS format + - Datetime String * - 24 - GENMPR - Genesis Matched Pairs line type + - String * - 25 - TOTAL - Total number of genesis pairs + - Integer * - 26 - INDEX - Index for the current matched pair + - Integer * - 27 - STORM_ID - BBCCYYYY designation of storm (basin, cyclone number, and year) + - String * - 28 - PROB_LEAD - Lead time in HHH format for the predicted probability of genesis (only for **-edeck** inputs) + - Time String * - 29 - PROB_VAL - Predicted probability of genesis (only for **-edeck** inputs) + - Double * - 30 - AGEN_INIT - Forecast initialization time + - Datetime String * - 31 - AGEN_FHR - Forecast hour of genesis event + - Time String * - 32 - AGEN_LAT - Latitude position of the forecast genesis event + - Double * - 33 - AGEN_LON - Longitude position of the forecast genesis event + - Double * - 34 - AGEN_DLAND - Forecast genesis event distance to land (nm) + - Double * - 35 - BGEN_LAT - Latitude position of the verifying Best track genesis event + - Double * - 36 - BGEN_LON - Longitude position of the verifying Best track genesis event + - Double * - 37 - BGEN_DLAND - Best track genesis event distance to land (nm) + - Double * - 38 - GEN_DIST - Distance between the forecast and Best track genesis events (km) (only for **-track** inputs) + - Double * - 39 - GEN_TDIFF - Forecast minus Best track genesis time in HHMMSS format (only for **-track** inputs) + - Time String * - 40 - INIT_TDIFF - Best track genesis minus forecast initialization time in HHMMSS format (only for **-track** inputs) + - Time String * - 41 - DEV_CAT - Category for the development methodology (FYOY, FYON, FNOY, or DISCARD) (only for **-track** inputs) + - String * - 42 - OPS_CAT - Category for the operational methodology (FYOY, FYON, FNOY, or DISCARD for **-track** inputs and FYOY or FYON for **-edeck** inputs) + - String .. _table_TG_var_NetCDF_matched_pair_out: .. list-table:: A selection of variables that can appear in the NetCDF matched pair output which can be controlled by the nc_pairs_flag configuration option. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - tc_gen NETCDF VARIABLES - - - - * - NetCDF Variable - Dimension - Description + - Data Type * - DESC_MODEL_GENESIS - lat, lon - For each filter entry (DESC) and forecast ATCF ID (MODEL), count the number of forecast genesis events within each grid box. + - Float * - DESC_MODEL_TRACKS - lat, lon - For each filter entry (DESC) and forecast ATCF ID (MODEL), count the number of track points within each grid box. + - Float * - DESC_BEST_GENESIS - lat, lon - For each filter entry (DESC), count the number of Best track genesis events within each grid box. + - Float * - DESC_BEST_GENESIS - lat, lon - For each filter entry (DESC), count the number of Best track points within each grid box. + - Float * - DESC_MODEL_[DEV|OPS]_FY_OY - lat, lon - For each filter entry (DESC) and forecast ATCF ID (MODEL), count the number of forecast genesis events classified as hits by the development (DEV) or operational (OPS) methodology. + - Float * - DESC_MODEL_[DEV|OPS]_FY_ON - lat, lon - For each filter entry (DESC) and forecast ATCF ID (MODEL), count the number of forecast genesis events classified as false alarms by the development (DEV) or operational (OPS) methodology. + - Float * - DESC_MODEL_BEST_[DEV|OPS]_FY_OY - lat, lon - For each filter entry (DESC) and forecast ATCF ID (MODEL), count the number of Best track genesis events classified as hits by the development (DEV) or operational (OPS) methodology. + - Float * - DESC_MODEL_BEST_[DEV|OPS]_FN_OY - lat, lon - For each filter entry (DESC) and forecast ATCF ID (MODEL), count the number of Best track genesis events classified as misses by the development (DEV) or operational (OPS) methodology. + - Float Like all STAT output, the output of TC-Gen may be further processed using the Stat-Analysis tool, described in :numref:`stat-analysis`. diff --git a/docs/Users_Guide/tc-pairs.rst b/docs/Users_Guide/tc-pairs.rst index cc1c7dc2cd..46cc3703bf 100644 --- a/docs/Users_Guide/tc-pairs.rst +++ b/docs/Users_Guide/tc-pairs.rst @@ -416,343 +416,431 @@ TC-Pairs produces output in TCST format. The default output file name can be ove .. _TCST Header: -.. list-table:: Header information for TC-Pairs TCST output. +.. list-table:: Header information for TC-Pairs TCST output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - HEADER * - Column Number - Header Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - AMODEL - User-provided text string designating the forecast ATCF ID + - String * - 3 - BMODEL - User-provided text string designating the reference ATCF ID + - String * - 4 - DESC - User-provided description text string + - String * - 5 - STORM_ID - BBCCYYYY designation of storm + - String * - 6 - BASIN - Basin (BB in STORM_ID) + - String * - 7 - CYCLONE - Cyclone number (CC in STORM_ID) + - String * - 8 - STORM_NAME - Name of Storm + - String * - 9 - INIT - - Initialization time of forecast in YYYYMMDD_HHMMSS format. + - Initialization time of forecast in YYYYMMDD_HHMMSS format + - Datetime String * - 10 - LEAD - - Forecast lead time in HHMMSS format. + - Forecast lead time in HHMMSS format + - Time String * - 11 - VALID - - Forecast valid time in YYYYMMDD_HHMMSS format. + - Forecast valid time in YYYYMMDD_HHMMSS format + - Datetime String * - 12 - INIT_MASK - Initialization time masking grid applied + - String * - 13 - VALID_MASK - Valid time masking grid applied + - String * - 14 - LINE_TYPE - Output line types described below + - String .. _TCMPR Line Type: .. list-table:: Format information for TCMPR (Tropical Cyclone Matched Pairs) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - TCMPR OUTPUT FORMAT * - Column Number - - Header Column Name + - TCMPR Column Name - Description + - Data Type * - 14 - TCMPR - Tropical Cyclone Matched Pair line type + - String * - 15 - TOTAL - Total number of pairs in track + - Integer * - 16 - INDEX - Index of the current track pair + - Integer * - 17 - LEVEL - Level of storm classification + - String * - 18 - WATCH_WARN - HU or TS watch or warning in effect + - String * - 19 - INITIALS - Forecaster initials + - String * - 20 - ALAT - Latitude position of adeck model + - Double * - 21 - ALON - Longitude position of adeck model + - Double * - 22 - BLAT - Latitude position of bdeck model + - Double * - 23 - BLON - Longitude position of bdeck model + - Double * - 24 - TK_ERR - Track error of adeck relative to bdeck (nm) + - Double * - 25 - X_ERR - X component position error (nm) + - Double * - 26 - Y_ERR - Y component position error (nm) + - Double * - 27 - ALTK_ERR - Along track error (nm) + - Double * - 28 - CRTK_ERR - Cross track error (nm) + - Double * - 29 - ADLAND - adeck distance to land (nm) + - Double * - 30 - BDLAND - bdeck distance to land (nm) + - Double * - 31 - AMSLP - adeck mean sea level pressure + - Double * - 32 - BMSLP - bdeck mean sea level pressure + - Double * - 33 - AMAX_WIND - adeck maximum wind speed + - Double * - 34 - BMAX_WIND - bdeck maximum wind speed + - Double * - 35, 36 - A/BAL_WIND_34 - a/bdeck 34-knot radius winds in full circle or the mean of the non-zero 34-knot wind quadrants + - Double * - 37, 38 - A/BNE_WIND_34 - a/bdeck 34-knot radius winds in NE quadrant + - Double * - 39, 40 - A/BSE_WIND_34 - a/bdeck 34-knot radius winds in SE quadrant + - Double * - 41, 42 - A/BSW_WIND_34 - a/bdeck 34-knot radius winds in SW quadrant + - Double * - 43, 44 - A/BNW_WIND_34 - a/bdeck 34-knot radius winds in NW quadrant + - Double * - 45, 46 - A/BAL_WIND_50 - a/bdeck 50-knot radius winds in full circle or the mean of the non-zero 50-knot wind quadrants + - Double * - 47, 48 - A/BNE_WIND_50 - a/bdeck 50-knot radius winds in NE quadrant + - Double * - 49, 50 - A/BSE_WIND_50 - a/bdeck 50-knot radius winds in SE quadrant + - Double * - 51, 52 - A/BSW_WIND_50 - a/bdeck 50-knot radius winds in SW quadrant + - Double * - 53, 54 - A/BNW_WIND_50 - a/bdeck 50-knot radius winds in NW quadrant + - Double * - 55, 56 - A/BAL_WIND_64 - a/bdeck 64-knot radius winds in full circle or the mean of the non-zero 64-knot wind quadrants + - Double * - 57, 58 - A/BNE_WIND_64 - a/bdeck 64-knot radius winds in NE quadrant + - Double * - 59, 60 - A/BSE_WIND_64 - a/bdeck 64-knot radius winds in SE quadrant + - Double * - 61, 62 - A/BSW_WIND_64 - a/bdeck 64-knot radius winds in SW quadrant + - Double * - 63, 64 - A/BNW_WIND_64 - a/bdeck 64-knot radius winds in NW quadrant + - Double * - 65, 66 - A/BRADP - pressure in millibars of the last closed isobar, 900 - 1050 mb + - Double * - 67, 68 - A/BRRP - radius of the last closed isobar in nm, 0 - 9999 nm + - Double * - 69, 70 - A/BMRD - radius of max winds, 0 - 999 nm + - Double * - 71, 72 - A/BGUSTS - gusts, 0 through 995 kts + - Double * - 73, 74 - A/BEYE - eye diameter, 0 through 999 nm + - Double * - 75, 76 - A/BDIR - storm direction in compass coordinates, 0 - 359 degrees + - Double * - 77, 78 - A/BSPEED - storm speed, 0 - 999 kts + - Double * - 79, 80 - A/BDEPTH - system depth, D-deep, M-medium, S-shallow, X-unknown + - Double * - 81 - NUM_MEMBERS - consensus variable: number of models (or ensemble members) that were used to build the consensus track + - Double * - 82 - TRACK_SPREAD - consensus variable: the mean of the distances from the member location to the consensus track location (nm) + - Double * - 83 - TRACK_STDEV - consensus variable: the standard deviation of the distances from the member locations to the consensus track location (nm) + - Double * - 84 - MSLP_STDEV - - consensus variable: the standard deviation of the member's mean sea level pressure values + - consensus variable: the standard deviation of the member's mean sea level pressure values + - Double * - 85 - MAX_WIND_STDEV - - consensus variable: the standard deviation of the member's maximum wind speed values + - consensus variable: the standard deviation of the member's maximum wind speed values + - Double .. _TCDIAG Line Type: .. list-table:: Format information for TCDIAG (Tropical Cyclone Diagnostics) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - TCDIAG OUTPUT FORMAT * - Column Number - - Header Column Name + - TCDIAG Column Name - Description + - Data Type * - 14 - TCDIAG - Tropical Cyclone Diagnostics line type + - String * - 15 - TOTAL - Total number of pairs in track + - Integer * - 16 - INDEX - Index of the current track pair + - Integer * - 17 - DIAG_SOURCE - Diagnostics data source indicated by the `-diag` command line option + - String * - 18 - TRACK_SOURCE - ATCF ID of the track data used to define the diagnostics + - String * - 19 - FIELD_SOURCE - Description of gridded field data source used to define the diagnostics + - String * - 20 - N_DIAG - Number of storm diagnostic name and value columns to follow + - Integer * - 21 - DIAG_i - Name of the of the ith storm diagnostic (repeated) + - String * - 22 - VALUE_i - Value of the ith storm diagnostic (repeated) + - Double .. _PROBRIRW Line Type: .. list-table:: Format information for PROBRIRW (Probability of Rapid Intensification/Weakening) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - - - - - PROBRIRW OUTPUT FORMAT * - Column Number - - Header Column Name + - PROBRIRW Column Name - Description + - Data Type * - 14 - PROBRIRW - Probability of Rapid Intensification/Weakening line type + - String * - 15 - ALAT - Latitude position of edeck model + - Double * - 16 - ALON - Longitude position of edeck model + - Double * - 17 - BLAT - Latitude position of bdeck model + - Double * - 18 - BLON - Longitude position of bdeck model + - Double * - 19 - INITIALS - Forecaster initials + - String * - 20 - TK_ERR - Track error of adeck relative to bdeck (nm) + - Double * - 21 - X_ERR - X component position error (nm) + - Double * - 22 - Y_ERR - Y component position error (nm) + - Double * - 23 - ADLAND - adeck distance to land (nm) + - Double * - 24 - BDLAND - bdeck distance to land (nm) + - Double * - 25 - RI_BEG - Start of RI time window in HH format + - Time String * - 26 - RI_END - End of RI time window in HH format + - Time String * - 27 - RI_WINDOW - Width of RI time window in HH format + - Time String * - 28 - AWIND_END - Forecast maximum wind speed at RI end + - Double * - 29 - BWIND_BEG - Best track maximum wind speed at RI begin + - Double * - 30 - BWIND_END - Best track maximum wind speed at RI end + - Double * - 31 - BDELTA - Exact Best track wind speed change in RI window + - Double * - 32 - BDELTA_MAX - Maximum Best track wind speed change in RI window + - Double * - 33 - BLEVEL_BEG - Best track storm classification at RI begin + - String * - 34 - BLEVEL_END - Best track storm classification at RI end + - String * - 35 - N_THRESH - Number of probability thresholds + - Integer * - 36 - THRESH_i - The ith probability threshold value (repeated) + - Double * - 37 - PROB_i - The ith probability value (repeated) + - Double diff --git a/docs/Users_Guide/tc-stat.rst b/docs/Users_Guide/tc-stat.rst index 3cddda63f2..63581da8fa 100644 --- a/docs/Users_Guide/tc-stat.rst +++ b/docs/Users_Guide/tc-stat.rst @@ -421,11 +421,8 @@ The output columns are shown below in :numref:`table_columnar_output_summary_tc_ .. list-table:: Columnar output of "summary" job output from the TC-Stat tool. :widths: auto - :header-rows: 2 + :header-rows: 1 - - * - - - tc_stat Summary Job Output Options * - Column number - Description * - 1 diff --git a/docs/Users_Guide/wavelet-stat.rst b/docs/Users_Guide/wavelet-stat.rst index 33b038c6aa..b715712df4 100644 --- a/docs/Users_Guide/wavelet-stat.rst +++ b/docs/Users_Guide/wavelet-stat.rst @@ -330,140 +330,173 @@ The format of the STAT and ASCII output of the Wavelet-Stat tool is similar to t .. _table_WS_header_info_ws_outputs: -.. list-table:: Header information for each file wavelet-stat outputs. +.. list-table:: Header information for Wavelet-Stat STAT output :widths: auto - :header-rows: 2 + :header-rows: 1 - * - HEADER - - - - * - Column Number - Header Column Name - Description + - Data Type * - 1 - VERSION - Version number + - String * - 2 - MODEL - User-provided text string designating model name + - String * - 3 - DESC - User-provided text string describing the verification task + - String * - 4 - FCST_LEAD - Forecast lead time in HHMMSS format + - Time String * - 5 - FCST_VALID_BEG - Forecast valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 6 - FCST_VALID_END - Forecast valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 7 - OBS_LEAD - Observation lead time in HHMMSS format + - Time String * - 8 - OBS_VALID_BEG - Observation valid start time in YYYYMMDD_HHMMSS format + - Datetime String * - 9 - OBS_VALID_END - Observation valid end time in YYYYMMDD_HHMMSS format + - Datetime String * - 10 - FCST_VAR - Model variable + - String * - 11 - FCST_UNITS - Units for model variable + - String * - 12 - FCST_LEV - - Selected Vertical level for forecast + - Selected vertical level for forecast + - String * - 13 - OBS_VAR - Observation variable + - String * - 14 - OBS_UNITS - Units for observation variable + - String * - 15 - OBS_LEV - - Selected Vertical level for observations + - Selected vertical level for observations + - String * - 16 - OBTYPE - User-provided text string designating the observation type + - String * - 17 - VX_MASK - Verifying masking region indicating the masking grid or polyline region applied + - String * - 18 - INTERP_MTHD - NA in Wavelet-Stat + - String * - 19 - INTERP_PNTS - NA in Wavelet-Stat + - Integer * - 20 - FCST_THRESH - The threshold applied to the forecast + - Threshold String * - 21 - OBS_THRESH - The threshold applied to the observations + - Threshold String * - 22 - COV_THRESH - NA in Wavelet-Stat + - Threshold String * - 23 - ALPHA - NA in Wavelet-Stat + - Double * - 24 - LINE_TYPE - See table below. + - String .. _table_WS_format_info_ISC: .. list-table:: Format information for the ISC (Intensity-Scale) output line type. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - ISC OUTPUT FORMAT - - - - * - Column Number - ISC Column Name - Description + - Data Type * - 24 - ISC - Intensity-Scale line type + - String * - 25 - TOTAL - The number of grid points (forecast locations) used + - Integer * - 26 - TILE_DIM - The dimensions of the tile + - Integer * - 27 - TILE_XLL - Horizontal coordinate of the lower left corner of the tile + - Integer * - 28 - TILE_YLL - Vertical coordinate of the lower left corner of the tile + - Integer * - 29 - NSCALE - Total number of scales used in decomposition + - Integer * - 30 - ISCALE - The scale at which all information following applies + - Integer * - 31 - MSE - Mean squared error for this scale + - Double * - 32 - ISC - The intensity scale skill score + - Double * - 33 - FENERGY - Forecast energy squared for this scale + - Double * - 34 - OENERGY - Observed energy squared for this scale + - Double * - 35 - BASER - The base rate (not scale dependent) + - Double * - 36 - FBIAS - The frequency bias + - Double The **Wavelet-Stat** tool creates a NetCDF output file containing the raw and decomposed values for the forecast, observation, and difference fields for each combination of variable and threshold value. @@ -473,10 +506,8 @@ The dimensions and variables included in the wavelet_stat NetCDF files are descr .. list-table:: Dimensions defined in NetCDF output. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - wavelet_stat NetCDF DIMENSIONS - - * - NetCDF Dimension - Description * - x @@ -489,32 +520,35 @@ The dimensions and variables included in the wavelet_stat NetCDF files are descr - Dimension for the number of tiles used .. _table_variables_wave_NetCDF_output: - + .. list-table:: Variables defined in NetCDF output. :widths: auto - :header-rows: 2 + :header-rows: 1 - * - wavelet-stat NetCDF VARIABLES - - - - * - NetCDF Variable - Dimension - Description + - Data Type * - FCST_FIELD_LEVEL_RAW - tile, x, y - Raw values for the forecast field specified by "FIELD_LEVEL" + - Float * - OBS_FIELD_LEVEL_RAW - tile, x, y - Raw values for the observation field specified by "FIELD_LEVEL" + - Float * - DIFF_FIELD_LEVEL_RAW - tile, x, y - Raw values for the difference field (**f-o**) specified by "FIELD_LEVEL" + - Float * - FCST_FIELD_LEVEL_THRESH - tile, scale, x, y - Wavelet scale-decomposition of the forecast field specified by "FIELD_LEVEL_THRESH" + - Float * - OBS_FIELD_LEVEL_THRESH - tile, scale, x, y - Wavelet scale-decomposition of the observation field specified by "FIELD_LEVEL_THRESH" + - Float Lastly, the **Wavelet-Stat** tool creates a PostScript plot summarizing the scale-decomposition approach used in the verification. The PostScript plot is generated using internal libraries and does not depend on an external plotting package. The generation of this PostScript output can be disabled using the **ps_plot_flag** configuration file option. diff --git a/docs/index.rst b/docs/index.rst index 2c81368bf2..588f961852 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,6 +7,27 @@ Boulder, CO .. image:: _static/METplus_banner_photo_web.png +In Memoriam +----------- +This coordinated release is dedicated to three remarkable team members +we lost in 2024, whose contributions have left an indelible mark on our work. + +To `Tara Jensen `_, +for her vision and leadership in creating METplus as well as her +dedication, dogged determination, and mentorship that shaped its growth and +trajectory, leaving a legacy of innovation in the field of verification. + +To `Randy Bullock `_, +whose verification libraries formed the basis of MET and +whose mathematical brilliance, passion for maps, grid projections, and +graphics enriched and inspired new capabilities. + +To `Venita Hagerty `_, +for her pivotal expertise, support, and attention to +detail that ensured the success of METdataio and METexpress. + +Their contributions to METplus continue to guide and inspire us each day. + History ------- diff --git a/internal/test_util/libcode/vx_grid/.gitignore b/internal/test_util/libcode/vx_grid/.gitignore index e09bcd4b7a..b2cd6a7bc9 100644 --- a/internal/test_util/libcode/vx_grid/.gitignore +++ b/internal/test_util/libcode/vx_grid/.gitignore @@ -1,4 +1,6 @@ test_grid_area +search_3d_kdtree +search_3d_kdtree_api *.o *.a .deps diff --git a/internal/test_util/libcode/vx_grid/Makefile.am b/internal/test_util/libcode/vx_grid/Makefile.am index a36bcc50e0..5b67c45483 100644 --- a/internal/test_util/libcode/vx_grid/Makefile.am +++ b/internal/test_util/libcode/vx_grid/Makefile.am @@ -10,7 +10,9 @@ include ${top_srcdir}/Make-include # Test programs -noinst_PROGRAMS = test_grid_area +noinst_PROGRAMS = test_grid_area \ + search_3d_kdtree \ + search_3d_kdtree_api test_grid_area_SOURCES = test_grid_area.cc test_grid_area_CPPFLAGS = ${MET_CPPFLAGS} @@ -27,3 +29,38 @@ test_grid_area_LDADD = \ -lvx_log \ $(UGRID_DEP_LIBS) \ -lz -lm -lproj + +search_3d_kdtree_SOURCES = search_3d_kdtree.cc +search_3d_kdtree_CPPFLAGS = ${MET_CPPFLAGS} +search_3d_kdtree_LDFLAGS = -L. ${MET_LDFLAGS} +search_3d_kdtree_LDADD = \ + $(UGRID_MET_LIBS) \ + -lvx_nc_util \ + -lvx_geodesy \ + -lvx_nav \ + -lvx_util_math \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(UGRID_DEP_LIBS) \ + -lz -lm -lproj \ + -lnetcdf_c++4 -lnetcdf + +search_3d_kdtree_api_SOURCES = search_3d_kdtree_api.cc +search_3d_kdtree_api_CPPFLAGS = ${MET_CPPFLAGS} +search_3d_kdtree_api_LDFLAGS = -L. ${MET_LDFLAGS} +search_3d_kdtree_api_LDADD = \ + $(UGRID_MET_LIBS) \ + -lvx_nc_util \ + -lvx_grid \ + -lvx_geodesy \ + -lvx_nav \ + -lvx_util_math \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(UGRID_DEP_LIBS) \ + -lz -lm -lproj \ + -lnetcdf_c++4 -lnetcdf diff --git a/internal/test_util/libcode/vx_grid/Makefile.in b/internal/test_util/libcode/vx_grid/Makefile.in index 9f7c65ed86..2eba7d2cfa 100644 --- a/internal/test_util/libcode/vx_grid/Makefile.in +++ b/internal/test_util/libcode/vx_grid/Makefile.in @@ -88,7 +88,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = test_grid_area$(EXEEXT) +noinst_PROGRAMS = test_grid_area$(EXEEXT) search_3d_kdtree$(EXEEXT) \ + search_3d_kdtree_api$(EXEEXT) subdir = internal/test_util/libcode/vx_grid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -100,9 +101,23 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) +am_search_3d_kdtree_OBJECTS = \ + search_3d_kdtree-search_3d_kdtree.$(OBJEXT) +search_3d_kdtree_OBJECTS = $(am_search_3d_kdtree_OBJECTS) +am__DEPENDENCIES_1 = +search_3d_kdtree_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +search_3d_kdtree_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(search_3d_kdtree_LDFLAGS) $(LDFLAGS) -o $@ +am_search_3d_kdtree_api_OBJECTS = \ + search_3d_kdtree_api-search_3d_kdtree_api.$(OBJEXT) +search_3d_kdtree_api_OBJECTS = $(am_search_3d_kdtree_api_OBJECTS) +search_3d_kdtree_api_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +search_3d_kdtree_api_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(search_3d_kdtree_api_LDFLAGS) $(LDFLAGS) -o $@ am_test_grid_area_OBJECTS = test_grid_area-test_grid_area.$(OBJEXT) test_grid_area_OBJECTS = $(am_test_grid_area_OBJECTS) -am__DEPENDENCIES_1 = test_grid_area_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) test_grid_area_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ @@ -122,7 +137,10 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/test_grid_area-test_grid_area.Po +am__depfiles_remade = \ + ./$(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Po \ + ./$(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Po \ + ./$(DEPDIR)/test_grid_area-test_grid_area.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -141,8 +159,10 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = -SOURCES = $(test_grid_area_SOURCES) -DIST_SOURCES = $(test_grid_area_SOURCES) +SOURCES = $(search_3d_kdtree_SOURCES) $(search_3d_kdtree_api_SOURCES) \ + $(test_grid_area_SOURCES) +DIST_SOURCES = $(search_3d_kdtree_SOURCES) \ + $(search_3d_kdtree_api_SOURCES) $(test_grid_area_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -343,6 +363,41 @@ test_grid_area_LDADD = \ $(UGRID_DEP_LIBS) \ -lz -lm -lproj +search_3d_kdtree_SOURCES = search_3d_kdtree.cc +search_3d_kdtree_CPPFLAGS = ${MET_CPPFLAGS} +search_3d_kdtree_LDFLAGS = -L. ${MET_LDFLAGS} +search_3d_kdtree_LDADD = \ + $(UGRID_MET_LIBS) \ + -lvx_nc_util \ + -lvx_geodesy \ + -lvx_nav \ + -lvx_util_math \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(UGRID_DEP_LIBS) \ + -lz -lm -lproj \ + -lnetcdf_c++4 -lnetcdf + +search_3d_kdtree_api_SOURCES = search_3d_kdtree_api.cc +search_3d_kdtree_api_CPPFLAGS = ${MET_CPPFLAGS} +search_3d_kdtree_api_LDFLAGS = -L. ${MET_LDFLAGS} +search_3d_kdtree_api_LDADD = \ + $(UGRID_MET_LIBS) \ + -lvx_nc_util \ + -lvx_grid \ + -lvx_geodesy \ + -lvx_nav \ + -lvx_util_math \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(UGRID_DEP_LIBS) \ + -lz -lm -lproj \ + -lnetcdf_c++4 -lnetcdf + all: all-am .SUFFIXES: @@ -380,6 +435,14 @@ $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +search_3d_kdtree$(EXEEXT): $(search_3d_kdtree_OBJECTS) $(search_3d_kdtree_DEPENDENCIES) $(EXTRA_search_3d_kdtree_DEPENDENCIES) + @rm -f search_3d_kdtree$(EXEEXT) + $(AM_V_CXXLD)$(search_3d_kdtree_LINK) $(search_3d_kdtree_OBJECTS) $(search_3d_kdtree_LDADD) $(LIBS) + +search_3d_kdtree_api$(EXEEXT): $(search_3d_kdtree_api_OBJECTS) $(search_3d_kdtree_api_DEPENDENCIES) $(EXTRA_search_3d_kdtree_api_DEPENDENCIES) + @rm -f search_3d_kdtree_api$(EXEEXT) + $(AM_V_CXXLD)$(search_3d_kdtree_api_LINK) $(search_3d_kdtree_api_OBJECTS) $(search_3d_kdtree_api_LDADD) $(LIBS) + test_grid_area$(EXEEXT): $(test_grid_area_OBJECTS) $(test_grid_area_DEPENDENCIES) $(EXTRA_test_grid_area_DEPENDENCIES) @rm -f test_grid_area$(EXEEXT) $(AM_V_CXXLD)$(test_grid_area_LINK) $(test_grid_area_OBJECTS) $(test_grid_area_LDADD) $(LIBS) @@ -390,6 +453,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_grid_area-test_grid_area.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @@ -412,6 +477,34 @@ am--depfiles: $(am__depfiles_remade) @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +search_3d_kdtree-search_3d_kdtree.o: search_3d_kdtree.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT search_3d_kdtree-search_3d_kdtree.o -MD -MP -MF $(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Tpo -c -o search_3d_kdtree-search_3d_kdtree.o `test -f 'search_3d_kdtree.cc' || echo '$(srcdir)/'`search_3d_kdtree.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Tpo $(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='search_3d_kdtree.cc' object='search_3d_kdtree-search_3d_kdtree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o search_3d_kdtree-search_3d_kdtree.o `test -f 'search_3d_kdtree.cc' || echo '$(srcdir)/'`search_3d_kdtree.cc + +search_3d_kdtree-search_3d_kdtree.obj: search_3d_kdtree.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT search_3d_kdtree-search_3d_kdtree.obj -MD -MP -MF $(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Tpo -c -o search_3d_kdtree-search_3d_kdtree.obj `if test -f 'search_3d_kdtree.cc'; then $(CYGPATH_W) 'search_3d_kdtree.cc'; else $(CYGPATH_W) '$(srcdir)/search_3d_kdtree.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Tpo $(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='search_3d_kdtree.cc' object='search_3d_kdtree-search_3d_kdtree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o search_3d_kdtree-search_3d_kdtree.obj `if test -f 'search_3d_kdtree.cc'; then $(CYGPATH_W) 'search_3d_kdtree.cc'; else $(CYGPATH_W) '$(srcdir)/search_3d_kdtree.cc'; fi` + +search_3d_kdtree_api-search_3d_kdtree_api.o: search_3d_kdtree_api.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_api_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT search_3d_kdtree_api-search_3d_kdtree_api.o -MD -MP -MF $(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Tpo -c -o search_3d_kdtree_api-search_3d_kdtree_api.o `test -f 'search_3d_kdtree_api.cc' || echo '$(srcdir)/'`search_3d_kdtree_api.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Tpo $(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='search_3d_kdtree_api.cc' object='search_3d_kdtree_api-search_3d_kdtree_api.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_api_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o search_3d_kdtree_api-search_3d_kdtree_api.o `test -f 'search_3d_kdtree_api.cc' || echo '$(srcdir)/'`search_3d_kdtree_api.cc + +search_3d_kdtree_api-search_3d_kdtree_api.obj: search_3d_kdtree_api.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_api_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT search_3d_kdtree_api-search_3d_kdtree_api.obj -MD -MP -MF $(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Tpo -c -o search_3d_kdtree_api-search_3d_kdtree_api.obj `if test -f 'search_3d_kdtree_api.cc'; then $(CYGPATH_W) 'search_3d_kdtree_api.cc'; else $(CYGPATH_W) '$(srcdir)/search_3d_kdtree_api.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Tpo $(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='search_3d_kdtree_api.cc' object='search_3d_kdtree_api-search_3d_kdtree_api.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_3d_kdtree_api_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o search_3d_kdtree_api-search_3d_kdtree_api.obj `if test -f 'search_3d_kdtree_api.cc'; then $(CYGPATH_W) 'search_3d_kdtree_api.cc'; else $(CYGPATH_W) '$(srcdir)/search_3d_kdtree_api.cc'; fi` + test_grid_area-test_grid_area.o: test_grid_area.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_grid_area_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_grid_area-test_grid_area.o -MD -MP -MF $(DEPDIR)/test_grid_area-test_grid_area.Tpo -c -o test_grid_area-test_grid_area.o `test -f 'test_grid_area.cc' || echo '$(srcdir)/'`test_grid_area.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_grid_area-test_grid_area.Tpo $(DEPDIR)/test_grid_area-test_grid_area.Po @@ -550,7 +643,9 @@ clean: clean-am clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/test_grid_area-test_grid_area.Po + -rm -f ./$(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Po + -rm -f ./$(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Po + -rm -f ./$(DEPDIR)/test_grid_area-test_grid_area.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -596,7 +691,9 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/test_grid_area-test_grid_area.Po + -rm -f ./$(DEPDIR)/search_3d_kdtree-search_3d_kdtree.Po + -rm -f ./$(DEPDIR)/search_3d_kdtree_api-search_3d_kdtree_api.Po + -rm -f ./$(DEPDIR)/test_grid_area-test_grid_area.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/internal/test_util/libcode/vx_grid/search_3d_kdtree.cc b/internal/test_util/libcode/vx_grid/search_3d_kdtree.cc new file mode 100644 index 0000000000..f047c58637 --- /dev/null +++ b/internal/test_util/libcode/vx_grid/search_3d_kdtree.cc @@ -0,0 +1,358 @@ +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* +// ** Copyright UCAR (c) 1992 - 2024 +// ** University Corporation for Atmospheric Research (UCAR) +// ** National Center for Atmospheric Research (NCAR) +// ** Research Applications Lab (RAL) +// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* + +// ./search_3d_kdtree /d1/personal/dadriaan/projects/NRL/PyIRI/pyiri_f4_2020.nc -23.114 334.77 100. +// ./search_3d_kdtree /d1/personal/dadriaan/projects/NRL/PyIRI/pyiri_f4_2020.nc 34.0522 -118.40806 0. glat glon zalt +// +// lat=-23.114, lon=334.77, alt=100 (meters) +// ==> X: 5309.352 km, Y: -2501.788 km, Z: -2488.375 km +// lat=34.0522, lon=-118.40806, alt=0. (meters) +// ==> X: -2516.715 km, Y: -4653.00 km, Z: 3551.245 km +// index=0 -9.59874, 287.326, 100] to [812813, 6.22979e+06, 1.09673e+06]) +// ==> X: 1873.072 km, Y: -6004.143 km, Z: -1056.531 km +// index=1152 -27.9711, 107.326, 100] to [-5.30871e+06, -2.98241e+06, -1.89224e+06]) +// ==> X: -1678.837 km, Y: 5381.522 km, Z: -2973.724 km +// index=2303 75.6264, 287.326, 100] to [-803942, -6.16181e+06, 1.43314e+06]) +// ==> X: 473.024 km, Y: -1516.283 km, Z: 6156.59 km + +//////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include + +#include "atlas/grid/Grid.h" // PointXYZ +#include "atlas/util/Geometry.h" +#include "atlas/util/KDTree.h" + +#include "vx_util.h" +#include "vx_grid.h" +#include "nav.h" +#include "nc_utils_core.h" +#include "nc_utils.h" + +using namespace std; +using namespace netCDF; + +using PointXYZ = atlas::PointXYZ; +using PointLonLat = atlas::PointLonLat; +using Geometry = atlas::Geometry; +using IndexKDTree = atlas::util::IndexKDTree; + +//////////////////////////////////////////////////////////////////////// + +static Geometry atlas_geometry; + +IndexKDTree *build_tree(vector &lat, vector &lon, vector &alt_m); +void check_llh_to_ecef(); +void llh_to_ecef(double lat, double lon, double alt_m, double *x_km, double *y_km, double *z_km); +void test_llh_to_ecef(double lat, double lon, double alt_m, double true_x_km, double true_y_km, double true_z_km, string location); + +//////////////////////////////////////////////////////////////////////// + +int main(int argc, char *argv[]) +{ + + string lat_name = "glat"; + string lon_name = "glon"; + string alt_name = "zalt"; + + if(argc < 2) cerr << argv[0] << ": Must specify input NetCDF name to process!\n"; + if(argc < 3) cerr << argv[0] << ": Must specify latitude to search\n"; + if(argc < 4) cerr << argv[0] << ": Must specify longitude to search\n"; + if(argc < 5) { + cerr << argv[0] << ": Must specify altitude to search\n"; + cerr << "\n Usage: " << argv[0] + << " netcdf_name lat_deg lon_deg alt_meters \n"; + cerr << " def_lat_var_name=" << lat_name + << ", def_lon_var_name=" << lon_name + << ", def_alt_var_name=" << alt_name << "\n"; + + if(argc < 2) check_llh_to_ecef(); + + exit(1); + } + + NcFile * _ncFile = open_ncfile(argv[1]); + if (IS_INVALID_NC_P(_ncFile)) { + if (_ncFile) { + delete _ncFile; + _ncFile = (NcFile *)nullptr; + } + exit(1); + } + + double lat = std::stod(argv[2]); + double lon = std::stod(argv[3]); + double alt = std::stod(argv[4]); + + if(argc > 5) lat_name = argv[5]; + if(argc > 6) lon_name = argv[6]; + if(argc > 7) alt_name = argv[7]; + + cout << "Requested lat=" << lat << ", lon=" << lon << ", alt=" << alt + << ", lat_name=" << lat_name << ", lon_name=" << lon_name + << ", alt_name=" << alt_name << "\n\n"; + + NcVar lat_var = get_nc_var(_ncFile, lat_name); + NcVar lon_var = get_nc_var(_ncFile, lon_name); + NcVar alt_var = get_nc_var(_ncFile, alt_name); + + const int nlat = get_data_size(&lat_var); + const int nlon = get_data_size(&lon_var); + const int nalt = get_data_size(&alt_var); + vector lat_values(nlat); + vector lon_values(nlon); + vector alt_values(nalt); + + if (!get_nc_data(&lat_var, lat_values.data())) { + cerr << "\n" + << " Fail to read " << lat_name << "\n\n"; + } + if (!get_nc_data(&lon_var, lon_values.data())) { + cerr << "\n" + << " Fail to read " << lon_name << "\n\n"; + } + if (!get_nc_data(&alt_var, alt_values.data())) { + cerr << "\n" + << " Fail to read " << alt_name << "\n\n"; + } + + double x,y,z; + double x_f,y_f,z_f; + double x_m,y_m,z_m; + double x_l,y_l,z_l; + + llh_to_ecef(lat, lon, alt, &x, &y, &z); + PointXYZ target_point(x, y, z); + + int idx = 0; + llh_to_ecef(lat_values[idx], lon_values[idx], alt_values[idx], &x_f, &y_f, &z_f); + PointXYZ target_point_first(x_f, y_f, z_f); + + idx = lat_values.size()/2; + llh_to_ecef(lat_values[idx], lon_values[idx], alt_values[idx], &x_m, &y_m, &z_m); + PointXYZ target_point_mid(x_m, y_m, z_m); + + idx = lat_values.size() - 1; + llh_to_ecef(lat_values[idx], lon_values[idx], alt_values[idx], &x_l, &y_l, &z_l); + PointXYZ target_point_last(x_l, y_l, z_l); + + //bool in_distance; + int closest_n = 5; + double distance_km; + IndexKDTree *kdtree = build_tree(lat_values, lon_values, alt_values); + + idx = 0; + cout << "The first point from the input file: " + << " index=" << idx << " " << lat_values[idx] << ", " << lon_values[idx] << ", " << alt_values[idx] << "] to [" << x_f << ", " << y_f << ", " << z_f << "])\n"; + IndexKDTree::ValueList neighbor = kdtree->closestPoints(target_point_first, closest_n); + for (size_t i=0; i < neighbor.size(); i++) { + size_t index(neighbor[i].payload()); + int index2 = (int)neighbor[i].payload(); + distance_km = neighbor[i].distance() / 1000.; + //in_distance = is_in_distance(distance_km); + llh_to_ecef(lat_values[index], lon_values[index], alt_values[index], &x, &y, &z); + cout << " - " << i << ": index=" << index << " distance=" << distance_km << " from [" + << lat_values[index] << ", " << lon_values[index] << ", " << alt_values[index] << "] (" + << x << ", " << y << ", " << z << ")\n"; + } + cout << "\n"; + + idx = lat_values.size()/2; + cout << "The mid point from the input file: " + << " index=" << idx << " " << lat_values[idx] << ", " << lon_values[idx] << ", " << alt_values[idx] << "] to [" << x_m << ", " << y_m << ", " << z_m << "])\n"; + neighbor = kdtree->closestPoints(target_point_mid, closest_n); + for (size_t i=0; i < neighbor.size(); i++) { + size_t index(neighbor[i].payload()); + int index2 = (int)neighbor[i].payload(); + distance_km = neighbor[i].distance() / 1000.; + //in_distance = is_in_distance(distance_km); + llh_to_ecef(lat_values[index], lon_values[index], alt_values[index], &x, &y, &z); + cout << " - " << i << ": index=" << index << " distance=" << distance_km << " from [" + << lat_values[index] << ", " << lon_values[index] << ", " << alt_values[index] << "] (" + << x << ", " << y << ", " << z << ")\n"; + } + cout << "\n"; + + idx = lat_values.size() - 1; + cout << "The last point from the input file: " + << " index=" << idx << " " << lat_values[idx] << ", " << lon_values[idx] << ", " << alt_values[idx] << "] to [" << x_m << ", " << y_m << ", " << z_m << "])\n"; + neighbor = kdtree->closestPoints(target_point_last, closest_n); + for (size_t i=0; i < neighbor.size(); i++) { + size_t index(neighbor[i].payload()); + int index2 = (int)neighbor[i].payload(); + distance_km = neighbor[i].distance() / 1000.; + //in_distance = is_in_distance(distance_km); + llh_to_ecef(lat_values[index], lon_values[index], alt_values[index], &x, &y, &z); + cout << " - " << i << ": index=" << index << " distance=" << distance_km << " from [" + << lat_values[index] << ", " << lon_values[index] << ", " << alt_values[index] << "] (" + << x << ", " << y << ", " << z << ")\n"; + } + cout << "\n"; + + cout << "The requested point: " + << lat << ", " << lon << ", " << alt + << "] to [" << x << ", " << y << ", " << z << "])\n"; + neighbor = kdtree->closestPoints(target_point, closest_n); + for (size_t i=0; i < neighbor.size(); i++) { + size_t index(neighbor[i].payload()); + int index2 = (int)neighbor[i].payload(); + distance_km = neighbor[i].distance() / 1000.; + //in_distance = is_in_distance(distance_km); + llh_to_ecef(lat_values[index], lon_values[index], alt_values[index], &x, &y, &z); + cout << " - " << i << ": index=" << index << " distance=" << distance_km << " from [" + << lat_values[index] << ", " << lon_values[index] << ", " << alt_values[index] << "] (" + << x << ", " << y << ", " << z << ")\n"; + } + cout << "\n"; + + if (_ncFile) { + delete _ncFile; + _ncFile = (NcFile *)nullptr; + } + + // + // done + // + + return 0; + +} + +//////////////////////////////////////////////////////////////////////// + +IndexKDTree *build_tree(vector &lat, vector &lon, vector &alt_m) { + + double x; + double y; + double z; + int count = lat.size(); + atlas::idx_t n = 0; + IndexKDTree *kdtree = new IndexKDTree(atlas_geometry); + kdtree->reserve(count); + for (int i=0; iinsert(point, n++); + } + + kdtree->build(); + + return kdtree; +} + +//////////////////////////////////////////////////////////////////////// + +void check_llh_to_ecef() { + double lat; + double lon; + double alt_m; + double true_x_km; + double true_y_km; + double true_z_km; + + test_llh_to_ecef(34.0522, -118.40806, 0.0, -2516.715, -4653.003, 3551.245, "LA"); + test_llh_to_ecef(-9.59874, 287.326, 100, 1873.072, -6004.143, -1056.531, "First Point"); + test_llh_to_ecef(-27.9711, 107.326, 100, -1678.837, 5381.522, -2973.724, "Middle Point"); + test_llh_to_ecef(75.6264, 287.326, 100, 473.024, -1516.283, 6156.59, "Last Point"); +} + +//////////////////////////////////////////////////////////////////////// + +void llh_to_ecef(double lat, double lon, double alt_m, double *x_km, double *y_km, double *z_km) { + const double lat_r = lat*rad_per_deg; + const double lon_r = lon*rad_per_deg; + const double radius = 6378137.0; // Radius of the Earth (in meters) + const double flat_factor = 1.0/298.257223563; // Flattening factor WGS84 Model + double cosLat = cos(lat_r); + double sinLat = sin(lat_r); + double FF = (1.0-flat_factor)*(1.0-flat_factor); + double C = 1./sqrt(cosLat*cosLat + FF * sinLat*sinLat); + double S = C * FF; + + *x_km = (radius * C + alt_m) * cosLat * cos(lon_r) / 1000.; + *y_km = (radius * C + alt_m) * cosLat * sin(lon_r) / 1000.; + *z_km = (radius * S + alt_m) * sinLat / 1000.; +} + +//////////////////////////////////////////////////////////////////////// + +void test_llh_to_ecef(double lat, double lon, double alt_m, double true_x_km, double true_y_km, double true_z_km, string location) { + double x_km; + double y_km; + double z_km; + + llh_to_ecef(lat, lon, alt_m, &x_km, &y_km, &z_km); + cout << location << ": (" << lat << ", " << lon << ", " << alt_m + << ") => (" << x_km << ", " << y_km << ", " << z_km + << ") Diff: (" << (true_x_km - x_km) << ", " << (true_y_km - y_km) << ", " << (true_z_km - z_km) << ")\n"; + +} + +//////////////////////////////////////////////////////////////////////// + + +/* +https://stackoverflow.com/questions/10473852/convert-latitude-and-longitude-to-point-in-3d-space + +def llarToWorld(lat, lon, alt, rad): + # see: http://www.mathworks.de/help/toolbox/aeroblks/llatoecefposition.html + f = 0 # flattening + ls = atan((1 - f)**2 * tan(lat)) # lambda + + x = rad * cos(ls) * cos(lon) + alt * cos(lat) * cos(lon) + y = rad * cos(ls) * sin(lon) + alt * cos(lat) * sin(lon) + z = rad * sin(ls) + alt * sin(lat) + + return c4d.Vector(x, y, z) + +def LLHtoECEF(lat, lon, alt): + # see http://www.mathworks.de/help/toolbox/aeroblks/llatoecefposition.html + + rad = np.float64(6378137.0) # Radius of the Earth (in meters) + f = np.float64(1.0/298.257223563) # Flattening factor WGS84 Model + cosLat = np.cos(lat) + sinLat = np.sin(lat) + FF = (1.0-f)**2 + C = 1/np.sqrt(cosLat**2 + FF * sinLat**2) + S = C * FF + + x = (rad * C + alt)*cosLat * np.cos(lon) + y = (rad * C + alt)*cosLat * np.sin(lon) + z = (rad * S + alt)*sinLat + + return (x, y, z) + + +Comparison output: finding ECEF for Los Angeles, CA (34.0522, -118.40806, 0 elevation) +My code: +X = -2516715.36114 meters or -2516.715 km +Y = -4653003.08089 meters or -4653.003 km +Z = 3551245.35929 meters or 3551.245 km + +Your Code: +X = -2514072.72181 meters or -2514.072 km +Y = -4648117.26458 meters or -4648.117 km +Z = 3571424.90261 meters or 3571.424 km + +Although in your earth rotation environment your function will produce right geographic region for display, it will NOT give the right ECEF equivalent coordinates. As you can see some of the parameters vary by as much as 20 KM which is rather a large error. + +Flattening factor, f depends on the model you assume for your conversion. Typical, model is WGS 84; however, there are other models. + +Personally, I like to use this link to Naval Postgraduate School for sanity checks on my conversions. + +https://www.oc.nps.edu/oc2902w/coord/llhxyz.html +https://www.oc.nps.edu/oc2902w/coord/llhxyz.htm + +https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates + +*/ diff --git a/internal/test_util/libcode/vx_grid/search_3d_kdtree_api.cc b/internal/test_util/libcode/vx_grid/search_3d_kdtree_api.cc new file mode 100644 index 0000000000..9bff64ba21 --- /dev/null +++ b/internal/test_util/libcode/vx_grid/search_3d_kdtree_api.cc @@ -0,0 +1,160 @@ +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* +// ** Copyright UCAR (c) 1992 - 2024 +// ** University Corporation for Atmospheric Research (UCAR) +// ** National Center for Atmospheric Research (NCAR) +// ** Research Applications Lab (RAL) +// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* + +// ./search_3d_kdtree_api /d1/personal/dadriaan/projects/NRL/PyIRI/pyiri_f4_2020.nc -23.114 334.77 100. +// ./search_3d_kdtree_api /d1/personal/dadriaan/projects/NRL/PyIRI/pyiri_f4_2020.nc 34.0522 -118.40806 0. glat glon zalt +// +// lat=-23.114, lon=334.77, alt=100 (meters) +// ==> X: 5309.352 km, Y: -2501.788 km, Z: -2488.375 km +// lat=34.0522, lon=-118.40806, alt=0. (meters) +// ==> X: -2516.715 km, Y: -4653.00 km, Z: 3551.245 km +// index=0 -9.59874, 287.326, 100] to [812813, 6.22979e+06, 1.09673e+06]) +// ==> X: 1873.072 km, Y: -6004.143 km, Z: -1056.531 km +// index=1152 -27.9711, 107.326, 100] to [-5.30871e+06, -2.98241e+06, -1.89224e+06]) +// ==> X: -1678.837 km, Y: 5381.522 km, Z: -2973.724 km +// index=2303 75.6264, 287.326, 100] to [-803942, -6.16181e+06, 1.43314e+06]) +// ==> X: 473.024 km, Y: -1516.283 km, Z: 6156.59 km + +//////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include + +#include "atlas/util/KDTree.h" + +#include "vx_util.h" +#include "vx_grid.h" +#include "nav.h" +#include "nc_utils_core.h" +#include "nc_utils.h" + +using namespace std; +using namespace netCDF; + +using IndexKDTree = atlas::util::IndexKDTree; + +//////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////// + +extern void llh_to_ecef(double lat, double lon, double alt_m, double *x_km, double *y_km, double *z_km); + +//////////////////////////////////////////////////////////////////////// + +int main(int argc, char *argv[]) +{ + + string lat_name = "glat"; + string lon_name = "glon"; + string alt_name = "zalt"; + + if(argc < 2) cerr << argv[0] << ": Must specify input NetCDF name to process!\n"; + if(argc < 3) cerr << argv[0] << ": Must specify latitude to search\n"; + if(argc < 4) cerr << argv[0] << ": Must specify longitude to search\n"; + if(argc < 5) { + cerr << argv[0] << ": Must specify altitude to search\n"; + + cerr << "\n Usage: " << argv[0] + << " netcdf_name lat_deg lon_deg alt_meters \n"; + cerr << " def_lat_var_name=" << lat_name + << ", def_lon_var_name=" << lon_name + << ", def_alt_var_name=" << alt_name << "\n"; + + if(argc < 2) { + UnstructuredData ugrid_data1; + ugrid_data1.test_llh_to_ecef(); + } + exit(1); + + } + + NcFile * _ncFile = open_ncfile(argv[1]); + if (IS_INVALID_NC_P(_ncFile)) { + if (_ncFile) { + delete _ncFile; + _ncFile = (NcFile *)nullptr; + } + exit(1); + } + + double lat = std::stod(argv[2]); + double lon = std::stod(argv[3]); + double alt = std::stod(argv[4]); + + if(argc > 5) lat_name = argv[5]; + if(argc > 6) lon_name = argv[6]; + if(argc > 7) alt_name = argv[7]; + + cout << "Requested lat=" << lat << ", lon=" << lon << ", alt=" << alt + << ", lat_name=" << lat_name << ", lon_name=" << lon_name + << ", alt_name=" << alt_name << "\n\n"; + + NcVar lat_var = get_nc_var(_ncFile, lat_name); + NcVar lon_var = get_nc_var(_ncFile, lon_name); + NcVar alt_var = get_nc_var(_ncFile, alt_name); + + const int nlat = get_data_size(&lat_var); + const int nlon = get_data_size(&lon_var); + const int nalt = get_data_size(&alt_var); + vector lat_values(nlat); + vector lon_values(nlon); + vector alt_values(nalt); + + if (!get_nc_data(&lat_var, lat_values.data())) { + cerr << "\n" + << " Fail to read " << lat_name << "\n\n"; + } + if (!get_nc_data(&lon_var, lon_values.data())) { + cerr << "\n" + << " Fail to read " << lon_name << "\n\n"; + } + if (!get_nc_data(&alt_var, alt_values.data())) { + cerr << "\n" + << " Fail to read " << alt_name << "\n\n"; + } + + UnstructuredData ugrid_data; + ugrid_data.set_points(nlat, lon_values.data(), lat_values.data(), alt_values.data()); + ugrid_data.test_kdtree(); + + double x,y,z; + double distance_km; + int closest_n = 5; + + cout << "The requested point: " + << lat << ", " << lon << ", " << alt + << "] to [" << x << ", " << y << ", " << z << "])\n"; + IndexKDTree::ValueList neighbor = ugrid_data.closest_points(lat, lon, closest_n, alt); + for (size_t i=0; i < neighbor.size(); i++) { + size_t index(neighbor[i].payload()); + int index2 = (int)neighbor[i].payload(); + distance_km = neighbor[i].distance() / 1000.; + llh_to_ecef(lat_values[index], lon_values[index], alt_values[index], &x, &y, &z); + cout << " - " << i << ": index=" << index << " distance=" << distance_km << " from [" + << lat_values[index] << ", " << lon_values[index] << ", " << alt_values[index] << "] (" + << x << ", " << y << ", " << z << ")\n"; + } + cout << "\n"; + + if (_ncFile) { + delete _ncFile; + _ncFile = (NcFile *)nullptr; + } + + // + // done + // + + return 0; + +} diff --git a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc index cc77b7f17a..86bef320e1 100644 --- a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc +++ b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc @@ -525,7 +525,7 @@ LongArray MetNcCFDataFile::collect_time_offsets(VarInfo &vinfo) { int time_count = time_offsets.n_elements(); if (0 < time_count) - mlog << Debug(7) << method_name << " Found " << time_count + mlog << Debug(7) << method_name << "Found " << time_count << (time_count==1 ? " time" : " times") << " between " << unix_to_yyyymmdd_hhmmss(_file->ValidTime[0]) << " and " << unix_to_yyyymmdd_hhmmss(_file->ValidTime[time_dim_size-1]) << "\n"; @@ -638,11 +638,11 @@ long MetNcCFDataFile::convert_time_to_offset(long time_value) { } if (found) - mlog << Debug(7) << method_name << " Found " + mlog << Debug(7) << method_name << "Found " << unix_to_yyyymmdd_hhmmss(time_value) << " at index " << time_offset << " from time value\n"; else if (found_value) - mlog << Debug(7) << method_name << " Found " << time_value + mlog << Debug(7) << method_name << "Found " << time_value << " at index " << time_offset << " from time value\n"; else mlog << Warning << "\n" << method_name << time_value @@ -668,6 +668,13 @@ long MetNcCFDataFile::convert_value_to_offset(double z_value, string z_dim_name) } } + // Log the dimension value to index conversion + if(z_offset != (long) bad_data_int) { + mlog << Debug(7) << method_name << "Found \"" + << z_dim_name << "\" dimension value of \"" << z_value + << "\" at dimension index " << z_offset << ".\n"; + } + if (!found && 0 < z_dim_name.length()) { NcVarInfo *var_info = find_var_info_by_dim_name(_file->Var, z_dim_name, _file->Nvars); if (var_info) { diff --git a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc index 0af90136c5..b86107078a 100644 --- a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc +++ b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.cc @@ -35,6 +35,7 @@ using namespace std; /////////////////////////////////////////////////////////////////////////////// static bool is_grib_code_abbr_match(const ConcatString &, int); +static void check_dim_offset(const char *); /////////////////////////////////////////////////////////////////////////////// // @@ -80,7 +81,7 @@ VarInfo *VarInfoNcCF::clone() const { VarInfoNcCF *ret = new VarInfoNcCF(*this); - return (VarInfo *)ret; + return ret; } /////////////////////////////////////////////////////////////////////////////// @@ -98,14 +99,13 @@ void VarInfoNcCF::init_from_scratch() { /////////////////////////////////////////////////////////////////////////////// void VarInfoNcCF::assign(const VarInfoNcCF &v) { - int i; // First call the parent's assign VarInfo::assign(v); // Copy clear_dimension(); - for(i=0; i " + << "Found non-integer NetCDF dimension index (" + << ptr << " != " << atoi(ptr) << ").\n" + << "Did you intend to use \"@" << ptr + << "\" to specify the value for that dimension instead?\n\n"; + } + + return; +} + +/////////////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h index 439369d95f..8fee4ead2d 100644 --- a/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h +++ b/src/libcode/vx_data2d_nc_cf/var_info_nc_cf.h @@ -88,7 +88,7 @@ class VarInfoNcCF : public VarInfo inline GrdFileType VarInfoNcCF::file_type() const { return FileType_NcCF; } inline const LongArray & VarInfoNcCF::dimension() const { return Dimension; } -inline int VarInfoNcCF::dimension(int i) const { return Dimension[i]; } +inline int VarInfoNcCF::dimension(int i) const { return (int) Dimension[i]; } inline int VarInfoNcCF::n_dimension() const { return Dimension.n_elements();} inline const NumArray & VarInfoNcCF::dim_value() const { return Dim_value; } inline double VarInfoNcCF::dim_value(int i) const { return Dim_value[i]; } diff --git a/src/libcode/vx_grid/grid_base.cc b/src/libcode/vx_grid/grid_base.cc index d144aa3490..4592dc19b3 100644 --- a/src/libcode/vx_grid/grid_base.cc +++ b/src/libcode/vx_grid/grid_base.cc @@ -316,31 +316,32 @@ void UnstructuredData::clear() { } - //////////////////////////////////////////////////////////////////////// void UnstructuredData::clear_data() { n_face = n_node = n_edge = 0; - point_lonlat.clear(); - lat_checksum = lon_checksum = 0.; + points_lonlat.clear(); + points_XYZ.clear(); + points_XYZ_km.clear(); + lat_checksum = lon_checksum = alt_checksum = 0.; if (kdtree) { delete kdtree; kdtree = nullptr; } } - //////////////////////////////////////////////////////////////////////// - void UnstructuredData::dump() const { mlog << Debug(grid_debug_level) << "\nUnstructured Grid Data:\n" << " n_face: " << n_face << "\n" - << " lat_checksum: " << lat_checksum << "\n" - << " lon_checksum: " << lon_checksum << "\n" - << " max_distance_km: " << max_distance_km << "\n" + << " points: " << (points_lonlat.empty() ? "PointXYZ" : "PointLonLat") << "\n" + << " lat_checksum: " << lat_checksum << "\n" + << " lon_checksum: " << lon_checksum << "\n" + << " alt_checksum: " << alt_checksum << "\n" + << " max_distance_km: " << max_distance_km << "\n" ; } @@ -442,18 +443,18 @@ void GridInfo::clear() { -if ( lc ) { delete lc; lc = (const LambertData *) nullptr; }; -if ( st ) { delete st; st = (const StereographicData *) nullptr; }; -if ( ll ) { delete ll; ll = (const LatLonData *) nullptr; }; -if ( rll ) { delete rll; rll = (const RotatedLatLonData *) nullptr; }; -if ( m ) { delete m; m = (const MercatorData *) nullptr; }; -if ( g ) { delete g; g = (const GaussianData *) nullptr; }; -if ( gi ) { delete gi; gi = (const GoesImagerData *) nullptr; }; -if ( la ) { delete la; la = (const LaeaData *) nullptr; }; -if ( tc ) { delete tc; tc = (const TcrmwData *) nullptr; }; -if ( sl ) { delete sl; sl = (const SemiLatLonData *) nullptr; }; +if ( lc ) { delete lc; lc = (const LambertData *) nullptr; } +if ( st ) { delete st; st = (const StereographicData *) nullptr; } +if ( ll ) { delete ll; ll = (const LatLonData *) nullptr; } +if ( rll ) { delete rll; rll = (const RotatedLatLonData *) nullptr; } +if ( m ) { delete m; m = (const MercatorData *) nullptr; } +if ( g ) { delete g; g = (const GaussianData *) nullptr; } +if ( gi ) { delete gi; gi = (const GoesImagerData *) nullptr; } +if ( la ) { delete la; la = (const LaeaData *) nullptr; } +if ( tc ) { delete tc; tc = (const TcrmwData *) nullptr; } +if ( sl ) { delete sl; sl = (const SemiLatLonData *) nullptr; } #ifdef WITH_UGRID -if ( us ) { delete us; us = (const UnstructuredData *) nullptr; }; +if ( us ) { delete us; us = (const UnstructuredData *) nullptr; } #endif return; @@ -555,13 +556,13 @@ void GridInfo::set(const LambertData & data) clear(); -LambertData * D = (LambertData *) nullptr; +LambertData * D = nullptr; D = new LambertData; memcpy(D, &data, sizeof(data)); -lc = D; D = (LambertData *) nullptr; +lc = D; D = nullptr; return; @@ -577,13 +578,13 @@ void GridInfo::set(const StereographicData & data) clear(); -StereographicData * D = (StereographicData *) nullptr; +StereographicData * D = nullptr; D = new StereographicData; memcpy(D, &data, sizeof(data)); -st = D; D = (StereographicData *) nullptr; +st = D; D = nullptr; return; @@ -599,13 +600,13 @@ void GridInfo::set(const LatLonData & data) clear(); -LatLonData * D = (LatLonData *) nullptr; +LatLonData * D = nullptr; D = new LatLonData; memcpy(D, &data, sizeof(data)); -ll = D; D = (LatLonData *) nullptr; +ll = D; D = nullptr; return; @@ -621,13 +622,13 @@ void GridInfo::set(const RotatedLatLonData & data) clear(); -RotatedLatLonData * D = (RotatedLatLonData *) nullptr; +RotatedLatLonData * D = nullptr; D = new RotatedLatLonData; memcpy(D, &data, sizeof(data)); -rll = D; D = (RotatedLatLonData *) nullptr; +rll = D; D = nullptr; return; @@ -643,13 +644,13 @@ void GridInfo::set(const MercatorData & data) clear(); -MercatorData * D = (MercatorData *) nullptr; +MercatorData * D = nullptr; D = new MercatorData; memcpy(D, &data, sizeof(data)); -m = D; D = (MercatorData *) nullptr; +m = D; D = nullptr; return; @@ -665,13 +666,13 @@ void GridInfo::set(const GaussianData & data) clear(); -GaussianData * D = (GaussianData *) nullptr; +GaussianData * D = nullptr; D = new GaussianData; memcpy(D, &data, sizeof(data)); -g = D; D = (GaussianData *) nullptr; +g = D; D = nullptr; return; @@ -687,13 +688,13 @@ void GridInfo::set(const GoesImagerData & data) clear(); -GoesImagerData * D = (GoesImagerData *) nullptr; +GoesImagerData * D = nullptr; D = new GoesImagerData; memcpy(D, &data, sizeof(data)); -gi = D; D = (GoesImagerData *) nullptr; +gi = D; D = nullptr; return; @@ -709,13 +710,13 @@ void GridInfo::set(const LaeaData & data) clear(); -LaeaData * D = (LaeaData *) nullptr; +LaeaData * D = nullptr; D = new LaeaData; memcpy(D, &data, sizeof(data)); -la = D; D = (LaeaData *) nullptr; +la = D; D = nullptr; return; @@ -731,7 +732,7 @@ void GridInfo::set(const SemiLatLonData & data) clear(); -SemiLatLonData * D = (SemiLatLonData *) nullptr; +SemiLatLonData * D = nullptr; D = new SemiLatLonData; @@ -742,7 +743,7 @@ D = new SemiLatLonData; *D = data; -sl = D; D = (SemiLatLonData *) nullptr; +sl = D; D = nullptr; return; @@ -759,14 +760,21 @@ void GridInfo::set(const UnstructuredData & data) clear(); -UnstructuredData *D = new UnstructuredData; +UnstructuredData * D = nullptr; + +D = new UnstructuredData; D->n_edge = data.n_edge; D->n_node = data.n_node; D->max_distance_km = data.max_distance_km; -D->set_points(data.n_face, data.point_lonlat); +if (data.has_PointLatLon()) { + D->set_points(data.n_face, data.points_lonlat); +} +else { + D->set_points(data.n_face, data.points_XYZ); +} us = D; -D = (UnstructuredData *)nullptr; +D = nullptr; } #endif @@ -1244,7 +1252,8 @@ if ( (nx_new < 2) || ( ny_new < 2) ) { } Grid g_new; -double lat_ll, lon_ll; +double lat_ll; +double lon_ll; GridInfo info_new = info(); @@ -1296,7 +1305,8 @@ if ( info_new.lc ) { } else if ( info_new.m ) { MercatorData m_new = *(info_new.m); - double lat_ur, lon_ur; + double lat_ur; + double lon_ur; xy_to_latlon(x_ll + nx_new - 1, y_ll + ny_new - 1, lat_ur, lon_ur); @@ -1340,8 +1350,10 @@ Grid Grid::subset_center(double lat_center, double lon_center, int nx_new, int n // subset_ll does sanity checking on nx_new and ny_new, so we don't have to do it here // -int ix_ll, iy_ll; -double dx_center, dy_center; +int ix_ll; +int iy_ll; +double dx_center; +double dy_center; // @@ -1690,13 +1702,31 @@ bool is_eq(const UnstructuredData * us1, const UnstructuredData * us2) bool status = false; if (us1 && us2) { if (us1 == us2) status = true; - else status = us1->n_face == us2->n_face - && us1->n_node == us2->n_node - && us1->n_edge == us2->n_edge - && us1->point_lonlat[0] == us2->point_lonlat[0] - && (us1->n_face > 0 && us1->point_lonlat[us1->n_face-1] == us2->point_lonlat[us2->n_face-1]) - && is_eq(us1->lat_checksum, us2->lat_checksum) - && is_eq(us1->lon_checksum, us2->lon_checksum); + else { + status = us1->n_face == us2->n_face + && us1->n_node == us2->n_node + && us1->n_edge == us2->n_edge + && us1->has_PointLatLon() == us2->has_PointLatLon() + && is_eq(us1->lat_checksum, us2->lat_checksum) + && is_eq(us1->lon_checksum, us2->lon_checksum); + if (status && (us1->n_face > 0)) { + if (us1->has_PointLatLon()) { + status = status + && us1->points_lonlat[0] == us2->points_lonlat[0] + && us1->points_lonlat[us1->n_face-1] == us2->points_lonlat[us2->n_face-1]; + } + else { + status = status + && is_eq(us1->points_XYZ[0].x(), us2->points_XYZ[0].x()) + && is_eq(us1->points_XYZ[0].y(), us2->points_XYZ[0].y()) + && is_eq(us1->points_XYZ[0].z(), us2->points_XYZ[0].z()) + && is_eq(us1->points_XYZ[us1->n_face-1].x(), us2->points_XYZ[us2->n_face-1].x()) + && is_eq(us1->points_XYZ[us1->n_face-1].y(), us2->points_XYZ[us2->n_face-1].y()) + && is_eq(us1->points_XYZ[us1->n_face-1].z(), us2->points_XYZ[us2->n_face-1].z()) + && is_eq(us1->alt_checksum, us2->alt_checksum); + } + } + } } return status; @@ -1708,7 +1738,7 @@ return status; //////////////////////////////////////////////////////////////////////// -int ll_func(double x_center, int N) +static int ll_func(double x_center, int N) { diff --git a/src/libcode/vx_grid/unstructured_grid.cc b/src/libcode/vx_grid/unstructured_grid.cc index 98cf8bccb9..1e318f5075 100644 --- a/src/libcode/vx_grid/unstructured_grid.cc +++ b/src/libcode/vx_grid/unstructured_grid.cc @@ -28,16 +28,29 @@ using namespace std; +using PointXYZ = atlas::PointXYZ; using PointLonLat = atlas::PointLonLat; using Geometry = atlas::Geometry; using IndexKDTree = atlas::util::IndexKDTree; //////////////////////////////////////////////////////////////////////// +constexpr double EARTH_RADIUS = 6378137.0; // Radius of the Earth (in meters) +constexpr double FLAT_FACTOR = 1.0/298.257223563; // Flattening factor WGS84 Model + + static const int UGRID_DEBUG_LEVEL = 9; static atlas::Geometry atlas_geometry; +//////////////////////////////////////////////////////////////////////// + +void llh_to_ecef(double lat, double lon, double alt_m, + double *x_km, double *y_km, double *z_km); +void check_llh_to_ecef(double lat, double lon, double alt_m, + double true_x_km, double true_y_km, double true_z_km, + const string &location); + //////////////////////////////////////////////////////////////////////// @@ -103,7 +116,12 @@ void UnstructuredGrid::set_from_data(const UnstructuredData &data) { Data.n_node = data.n_node; Data.max_distance_km = data.max_distance_km; - Data.set_points(Nx, data.point_lonlat); + if (data.has_PointLatLon()) { + Data.set_points(Nx, data.points_lonlat); + } + else { + Data.set_points(Nx, data.points_XYZ); + } } @@ -120,9 +138,9 @@ void UnstructuredGrid::set_max_distance_km(double max_distance) { void UnstructuredGrid::latlon_to_xy(double lat, double lon, double &x, double &y) const { - PointLonLat _point_lonlat(lon, lat); + PointLonLat point_lonlat(lon, lat); - IndexKDTree::ValueList neighbor = Data.kdtree->closestPoints(_point_lonlat, 1); + IndexKDTree::ValueList neighbor = Data.closest_points(lat, lon, 1); size_t index(neighbor[0].payload()); double distance_km(neighbor[0].distance()/1000.); bool in_distance = Data.is_in_distance(distance_km); @@ -133,9 +151,9 @@ void UnstructuredGrid::latlon_to_xy(double lat, double lon, double &x, double &y if(mlog.verbosity_level() >= UGRID_DEBUG_LEVEL) mlog << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredGrid::latlon_to_xy() " << "input=(" << lon << ", " << lat << ") ==> (" << x << ", " << y << ") == (" - << Data.point_lonlat[index].x() << ", " << Data.point_lonlat[index].y() + << Data.points_lonlat[index].x() << ", " << Data.points_lonlat[index].y() << ") distance= " << distance_km << "km, " - << _point_lonlat.distance(Data.point_lonlat[index]) + << point_lonlat.distance(Data.points_lonlat[index]) << " degree" << (in_distance ? " " : ", rejected") << "\n"; } @@ -145,8 +163,8 @@ void UnstructuredGrid::latlon_to_xy(double lat, double lon, double &x, double &y void UnstructuredGrid::xy_to_latlon(double x, double y, double &lat, double &lon) const { - lat = Data.point_lonlat[x].y(); - lon = Data.point_lonlat[x].x(); + lat = Data.points_lonlat[nint(x)].y(); + lon = Data.points_lonlat[nint(x)].x(); if(mlog.verbosity_level() >= UGRID_DEBUG_LEVEL) mlog << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredGrid::xy_to_latlon() " @@ -157,6 +175,7 @@ void UnstructuredGrid::xy_to_latlon(double x, double y, double &lat, double &lon //////////////////////////////////////////////////////////////////////// + double UnstructuredGrid::calc_area(int x, int y) const { double area = 0.; @@ -165,6 +184,7 @@ double UnstructuredGrid::calc_area(int x, int y) const { } + //////////////////////////////////////////////////////////////////////// @@ -349,22 +369,75 @@ void UnstructuredData::build_tree() { atlas::idx_t n = 0; kdtree = new IndexKDTree(atlas_geometry); kdtree->reserve(n_face); - for (int i=0; iinsert(pointLL, n++); - lat_checksum += (i+1) * point_lonlat[i].y(); - lon_checksum += (i+1) * point_lonlat[i].x(); + if (has_PointLatLon()) { + for (int i=0; iinsert(pointLL, n); + n++; + lat_checksum += (i+1) * points_lonlat[i].y(); + lon_checksum += (i+1) * points_lonlat[i].x(); + } + } + else { + double x_km; + double y_km; + double z_km; + points_XYZ_km.reserve(n_face); + for (int i=0; iinsert(points_XYZ_km[i], n); + n++; + lat_checksum += (i+1) * y_km; + lon_checksum += (i+1) * x_km; + alt_checksum += (i+1) * z_km; + } } kdtree->build(); + ConcatString cs; + if (get_env("MET_TEST_UGRID_KDTREE", cs)) test_kdtree(); } //////////////////////////////////////////////////////////////////////// +IndexKDTree::ValueList UnstructuredData::closest_points(const double &lat, const double &lon, + const size_t &k, const double &alt_m) const { + const string method_name = "UnstructuredData::closest_points() --> "; + if (has_PointLatLon()) { + PointLonLat point_lonlat(lon, lat); + if (!is_eq(alt_m, bad_data_double)) { + mlog << Debug(4) << method_name << "ignored the altitude (" << alt_m << ")\n"; + } + return kdtree->closestPoints(point_lonlat, k); + } + else { + double x_km; + double y_km; + double z_km; + double _alt_m = alt_m; + if (is_eq(_alt_m, bad_data_double)) { + _alt_m = EARTH_RADIUS; + mlog << Debug(4) << method_name << "Set the altitude to earth radius (" << EARTH_RADIUS << ")\n"; + } + llh_to_ecef(lat, lon, _alt_m, &x_km, &y_km, &z_km); + PointXYZ point_XYZ(x_km, y_km, z_km); + return kdtree->closestPoints(point_XYZ, k); + } +}; + +//////////////////////////////////////////////////////////////////////// + void UnstructuredData::copy_from(const UnstructuredData &us_data) { - set_points(us_data.n_face, us_data.point_lonlat); + if (us_data.has_PointLatLon()) { + set_points(us_data.n_face, us_data.points_lonlat); + } + else { + set_points(us_data.n_face, us_data.points_XYZ); + } n_edge = us_data.n_edge; n_node = us_data.n_node; max_distance_km = us_data.max_distance_km; @@ -373,7 +446,12 @@ void UnstructuredData::copy_from(const UnstructuredData &us_data) { //////////////////////////////////////////////////////////////////////// void UnstructuredData::copy_from(const UnstructuredData *us_data) { - set_points(us_data->n_face, us_data->point_lonlat); + if (us_data->has_PointLatLon()) { + set_points(us_data->n_face, us_data->points_lonlat); + } + else { + set_points(us_data->n_face, us_data->points_XYZ); + } n_edge = us_data->n_edge; n_node = us_data->n_node; max_distance_km = us_data->max_distance_km; @@ -381,6 +459,12 @@ void UnstructuredData::copy_from(const UnstructuredData *us_data) { //////////////////////////////////////////////////////////////////////// +bool UnstructuredData::has_PointLatLon() const { + return (!points_lonlat.empty()); +} + +//////////////////////////////////////////////////////////////////////// + bool UnstructuredData::is_in_distance(double distance_km) const { bool in_distance = is_eq(max_distance_km, bad_data_double) || (max_distance_km <= 0) @@ -392,19 +476,19 @@ bool UnstructuredData::is_in_distance(double distance_km) const { //////////////////////////////////////////////////////////////////////// -void UnstructuredData::set_points(int count, double *_lon, double *_lat) { +void UnstructuredData::set_points(int count, const double *_lon, const double *_lat) { clear_data(); n_face = count; - point_lonlat.reserve(count); + points_lonlat.reserve(count); for (int i=0; i= UGRID_DEBUG_LEVEL) mlog << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredData::set_points(int, double *, double *) first (" - << point_lonlat[0].x() << ", " << point_lonlat[0].y() << ") and last (" - << point_lonlat[count-1].x() << ", " << point_lonlat[count-1].y() << ") from (" + << points_lonlat[0].x() << ", " << points_lonlat[0].y() << ") and last (" + << points_lonlat[count-1].x() << ", " << points_lonlat[count-1].y() << ") from (" << _lon[0] << ", " << _lat[0] << ") and (" << _lon[count-1] << ", " << _lat[count-1] << ")\n"; @@ -414,24 +498,193 @@ void UnstructuredData::set_points(int count, double *_lon, double *_lat) { //////////////////////////////////////////////////////////////////////// -void UnstructuredData::set_points(int count, const std::vector &ptLonLat) { +void UnstructuredData::set_points(int count, const double *_lon, const double *_lat, const double *_alt) { clear_data(); n_face = count; - point_lonlat.reserve(count); + points_XYZ.reserve(count); + for (int i=0; i= UGRID_DEBUG_LEVEL) mlog + << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredData::set_points(int, double *lon, double *lat, double *alt) first (" + << points_XYZ[0].x() << ", " << points_XYZ[0].y() << ", " << points_XYZ[0].z() << ") and last (" + << points_XYZ[count-1].x() << ", " << points_XYZ[count-1].y() << ") from (" + << _lon[0] << ", " << _lat[0] << ", " << _alt[0] << ") and (" + << _lon[count-1] << ", " << _lat[count-1] << ")\n"; + + build_tree(); + +} + +//////////////////////////////////////////////////////////////////////// + +void UnstructuredData::set_points(int count, const std::vector &pointsLL) { + static const string method_name + = "UnstructuredData::set_points(int, std::vector &) -> "; + + clear_data(); + + if (count != pointsLL.size()) { + mlog << Warning << "\n" << method_name + << " The count argument (" << count << ") does not match with vector (" + << pointsLL.size() << ")\n\n"; + } + + n_face = count; + points_lonlat.reserve(count); for (int i=0; i= UGRID_DEBUG_LEVEL) mlog - << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredData::set_points(int, std::vector &) first: (" - << point_lonlat[0].x() << ", " << point_lonlat[0].y() << ") and last (" - << point_lonlat[count-1].x() << ", " << point_lonlat[count-1].y() << ") from (" - << ptLonLat[0].x() << ", " << ptLonLat[0].y() << ") and (" - << ptLonLat[count-1].x() << ", " << ptLonLat[count-1].y() << ")\n"; + << Debug(UGRID_DEBUG_LEVEL) << method_name << " first: (" + << points_lonlat[0].x() << ", " << points_lonlat[0].y() << ") and last (" + << points_lonlat[count-1].x() << ", " << points_lonlat[count-1].y() << ") from (" + << pointsLL[0].x() << ", " << pointsLL[0].y() << ") and (" + << pointsLL[count-1].x() << ", " << pointsLL[count-1].y() << ")\n"; + + build_tree(); + +} + +//////////////////////////////////////////////////////////////////////// + +void UnstructuredData::set_points(int count, const std::vector &pointsXYZ) { + static const string method_name + = "UnstructuredData::set_points(int, std::vector &) -> "; + + clear_data(); + + if (count != pointsXYZ.size()) { + mlog << Warning << "\n" << method_name + << " The count argument (" << count << ") does not match with vector (" + << pointsXYZ.size() << ")\n\n"; + } + + n_face = count; + points_XYZ.reserve(count); + for (int i=0; i= UGRID_DEBUG_LEVEL) { + int last_i = count - 1; + mlog << Debug(UGRID_DEBUG_LEVEL) << method_name + << "first: (" << points_XYZ[0].x() << ", " << points_XYZ[0].y() << ", " + << points_XYZ[0].z() << ") and last (" << points_XYZ[last_i].x() << ", " + << points_XYZ[last_i].y() << ", " << points_XYZ[last_i].z() << ") from (" + << pointsXYZ[0].x() << ", " << pointsXYZ[0].y() << ", " << pointsXYZ[0].z() + << ") and (" << pointsXYZ[last_i].x() << ", " << pointsXYZ[last_i].y() + << ", " << pointsXYZ[last_i].z() << ")\n"; + } build_tree(); } //////////////////////////////////////////////////////////////////////// + +void UnstructuredData::test_kdtree() { + static const string method_name + = "UnstructuredData::test_kdtree() -> "; + + int closest_n = 5; + double lat; + double lon; + double distance_km; + vector indices = {0, n_face/2, (n_face - 1)}; + if (has_PointLatLon()) { + if (n_face != points_lonlat.size()) { + mlog << Warning << "\n" << method_name + << " The count argument (" << n_face << ") does not match with the vector (latlon=" + << points_lonlat.size() << ", XYZ=" << points_XYZ.size() << ")\n\n"; + } + for (int idx : indices) { + lat = points_lonlat[idx].y(); + lon = points_lonlat[idx].x(); + cout << " - search index=" << idx << " (" << lat << ", " << lon << ")\n"; + IndexKDTree::ValueList neighbor = closest_points(lon, lat, closest_n); + for (const auto &x : neighbor) { + int index = x.payload(); + distance_km = x.distance() / 1000.; + cout << " + closest index=" << index << " distance=" << distance_km << " from (" + << points_lonlat[index].y() << ", " << points_lonlat[index].x() << ")\n"; + } + cout << "\n"; + } + } + else { + double x_km; + double y_km; + double z_km; + double alt_m; + if (n_face != points_XYZ.size()) { + mlog << Warning << "\n" << method_name + << " The count argument (" << n_face << ") does not match with the vector (XYZ=" + << points_XYZ.size() << ", latlon=" << points_lonlat.size() << ")\n\n"; + } + for (int idx : indices) { + lat = points_XYZ[idx].y(); + lon = points_XYZ[idx].x(); + alt_m = points_XYZ[idx].z(); + cout << " - search index=" << idx << " (" << lat << ", " << lon << ", " << alt_m << ")\n"; + IndexKDTree::ValueList neighbor = closest_points(lat, lon, closest_n, alt_m); + for (const auto &x : neighbor) { + int index = x.payload(); + distance_km = x.distance() / 1000.; + llh_to_ecef(lat, lon, alt_m, &x_km, &y_km, &z_km); + cout << " + closest index=" << index << " distance=" << distance_km << " from (" + << points_XYZ[index].y() << ", " << points_XYZ[index].x() << ", " << points_XYZ[index].z() + << ") km: [" << x_km << ", " << y_km << ", " << z_km << "]\n"; + } + cout << "\n"; + } + } + +} + +//////////////////////////////////////////////////////////////////////// +// Called by internal/test_util/libcode/vx_grid/search_3d_kdtree_api.cc +// Input: /d1/personal/dadriaan/projects/NRL/PyIRI/pyiri_f4_2020.nc +// - search index= 0 (-9.59874, 287.326, 100) ==> ( 1873.072, -6004.143, -1056.531) km +// - search index=1152 (-27.9711, 107.326, 100) ==> (-1678.837, 5381.522, -2973.724) km +// - search index=2303 ( 75.6264, 287.326, 100) ==> ( 473.024, -1516.283, 6156.59 ) km + +void UnstructuredData::test_llh_to_ecef() const { + check_llh_to_ecef( 34.0522, -118.40806, 0., -2516.715, -4653.003, 3551.245, " LA"); + check_llh_to_ecef(-9.59874, 287.326, 100., 1873.072, -6004.143, -1056.531, " First Point"); + check_llh_to_ecef(-27.9711, 107.326, 100., -1678.837, 5381.522, -2973.724, " Middle Point"); + check_llh_to_ecef( 75.6264, 287.326, 100., 473.024, -1516.283, 6156.59, " Last Point"); +} + +//////////////////////////////////////////////////////////////////////// + +void llh_to_ecef(double lat, double lon, double alt_m, double *x_km, double *y_km, double *z_km) { + const double lat_r = lat*rad_per_deg; + const double lon_r = lon*rad_per_deg; + double cosLat = cos(lat_r); + double sinLat = sin(lat_r); + double FF = (1.0-FLAT_FACTOR)*(1.0-FLAT_FACTOR); + double C = 1./sqrt(cosLat*cosLat + FF * sinLat*sinLat); + double S = C * FF; + + *x_km = (EARTH_RADIUS * C + alt_m) * cosLat * cos(lon_r) / 1000.; + *y_km = (EARTH_RADIUS * C + alt_m) * cosLat * sin(lon_r) / 1000.; + *z_km = (EARTH_RADIUS * S + alt_m) * sinLat / 1000.; +} + +//////////////////////////////////////////////////////////////////////// + +void check_llh_to_ecef(double lat, double lon, double alt_m, double true_x_km, double true_y_km, double true_z_km, const string &location) { + double x_km; + double y_km; + double z_km; + + llh_to_ecef(lat, lon, alt_m, &x_km, &y_km, &z_km); + cout << location << ": (" << lat << ", " << lon << ", " << alt_m + << ") => (" << x_km << ", " << y_km << ", " << z_km + << ") Diff: (" << (true_x_km - x_km) << ", " << (true_y_km - y_km) << ", " << (true_z_km - z_km) << ")\n"; + +} + +//////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_grid/unstructured_grid.h b/src/libcode/vx_grid/unstructured_grid.h index 3f46913472..b21e7d32c8 100644 --- a/src/libcode/vx_grid/unstructured_grid.h +++ b/src/libcode/vx_grid/unstructured_grid.h @@ -45,7 +45,6 @@ class UnstructuredGrid : public GridRep { void clear(); void set_from_data(const UnstructuredData &); - //void set_max_distance_deg(double max_distance); void set_max_distance_km(double max_distance); // diff --git a/src/libcode/vx_grid/unstructured_grid_defs.h b/src/libcode/vx_grid/unstructured_grid_defs.h index 68456d0d35..2ec67504a6 100644 --- a/src/libcode/vx_grid/unstructured_grid_defs.h +++ b/src/libcode/vx_grid/unstructured_grid_defs.h @@ -29,12 +29,9 @@ //////////////////////////////////////////////////////////////////////// - - - struct UnstructuredData { - const char * name; // not allocated + const char *name; // not allocated int n_face; int n_edge; @@ -42,8 +39,11 @@ struct UnstructuredData { double max_distance_km; // This should be set after calling set_points() double lat_checksum; double lon_checksum; + double alt_checksum; - std::vector point_lonlat; + std::vector points_lonlat; + std::vector points_XYZ; // lat_deg, lon_der, alt_meters + std::vector points_XYZ_km; // x_km, y_km, z_km atlas::util::IndexKDTree *kdtree; UnstructuredData(); @@ -51,12 +51,21 @@ struct UnstructuredData { void build_tree(); bool is_in_distance(double distance_km) const; - void set_points(int count, double *_lon, double *_lat); + void set_points(int count, const double *_lon, const double *_lat); void set_points(int count, const std::vector &); + void set_points(int count, const double *_lon, const double *_lat, const double *_alt); + void set_points(int count, const std::vector &); void copy_from(const UnstructuredData *); void copy_from(const UnstructuredData &); void clear(); void clear_data(); + bool has_PointLatLon() const; + void test_kdtree(); + void test_llh_to_ecef() const; + atlas::util::IndexKDTree::ValueList closest_points( + const double &lat, const double &lon, const size_t &k, + const double &alt_m=bad_data_double) const; + void dump() const; }; diff --git a/src/libcode/vx_shapedata/engine.cc b/src/libcode/vx_shapedata/engine.cc index ffaba59145..0809afd999 100644 --- a/src/libcode/vx_shapedata/engine.cc +++ b/src/libcode/vx_shapedata/engine.cc @@ -602,7 +602,6 @@ void ModeFuzzyEngine::do_fcst_convolution() { if(!need_fcst_conv) return; r = conf_info.Fcst->conv_radius; - *fcst_conv = *fcst_raw; mlog << Debug(3) << "Applying circular convolution of radius " @@ -645,7 +644,6 @@ void ModeFuzzyEngine::do_obs_convolution() { if(!need_obs_conv) return; r = conf_info.Obs->conv_radius; - *obs_conv = *obs_raw; mlog << Debug(3) << "Applying circular convolution of radius " diff --git a/src/libcode/vx_shapedata/mode_conf_info.cc b/src/libcode/vx_shapedata/mode_conf_info.cc index 080365c757..73970d8531 100644 --- a/src/libcode/vx_shapedata/mode_conf_info.cc +++ b/src/libcode/vx_shapedata/mode_conf_info.cc @@ -74,11 +74,11 @@ void ModeConfInfo::init_from_scratch() Field_Index_f = 0; Field_Index_o = 0; - fcst_array = 0; - obs_array = 0; + fcst_array = nullptr; + obs_array = nullptr; - fcst_array = 0; - obs_array = 0; + fcst_array = nullptr; + obs_array = nullptr; clear(); @@ -115,8 +115,8 @@ void ModeConfInfo::assign( const ModeConfInfo &m) complexity_ratio_wt = m.complexity_ratio_wt; inten_perc_ratio_wt = m.inten_perc_ratio_wt; - fcst_array = 0; - Fcst = 0; + fcst_array = nullptr; + Fcst = nullptr; if (N_fields_f > 0) { fcst_array = new Mode_Field_Info[N_fields_f]; for (int i=0; i 0) { obs_array = new Mode_Field_Info[N_fields_o]; for (int i=0; ilookup_int(conf_key_shift_right); if (field_index == 0) { @@ -643,11 +634,8 @@ void ModeConfInfo::process_config_fcst(GrdFileType ftype, int field_index) void ModeConfInfo::process_config_obs(GrdFileType otype, int field_index) { - int j, k, n; - Dictionary * obs_dict = (Dictionary *) nullptr; - - obs_dict = conf.lookup_dictionary(conf_key_obs); + Dictionary * obs_dict = conf.lookup_dictionary(conf_key_obs); shift_right = obs_dict->lookup_int(conf_key_shift_right); if (field_index == 0) { @@ -688,7 +676,8 @@ void ModeConfInfo::config_set_all_percentile_thresholds(const std::vector fcst_freq, obs_freq; + vector fcst_freq; + vector obs_freq; // indices (common to forecast and obs) that require both inputs (fcst and obs) // which is either frequency bias, or sample obs with a forecast input, or sample fcst @@ -776,9 +765,8 @@ void ModeConfInfo::config_set_all_percentile_thresholds(const std::vectoris_array() ) { - int j, k; - const DictionaryEntry * e = 0; + const DictionaryEntry * e = nullptr; const Dictionary & D = *field; - if (data_type == ModeDataType::Traditional) { - // traditional mode, extra test - if ( (N_fields_f > 0) && (N != N_fields_f) ) { - mlog << Error - << "\nModeConfInfo::read_fields() -> fcst and obs dictionaries have different number of entries in traditional mode" - << ", not allowed\n\n"; - exit ( 1 ); + // traditional mode, extra test + if ( (data_type == ModeDataType::Traditional) && + (N_fields_f > 0) && + (N != N_fields_f) ) { + mlog << Error + << "\nModeConfInfo::read_fields() -> fcst and obs dictionaries have different number of entries in traditional mode" + << ", not allowed\n\n"; + + exit ( 1 ); - } } if (_fo == 'F') { @@ -958,7 +944,7 @@ if ( field->is_array() ) { } else { N_fields_o = N; } - for (j=0; jdict(); -const int N = ( (field->is_array()) ? (field->n_entries()) : 1 ); - if ( field->is_array() ) { - const DictionaryEntry * e = 0; + const DictionaryEntry * e = nullptr; const Dictionary & D = *field; e = D[field_index]; @@ -1175,7 +1159,8 @@ void ModeConfInfo::set_perc_thresh(const DataPlane &f_dp, // // Sort the input arrays // - NumArray fsort, osort; + NumArray fsort; + NumArray osort; int nxy = f_dp.nx() * f_dp.ny(); fsort.extend(nxy); @@ -1276,7 +1261,7 @@ void ModeConfInfo::parse_nc_info() { -const DictionaryEntry * e = (const DictionaryEntry *) nullptr; +const DictionaryEntry * e = nullptr; e = conf.lookup(conf_key_nc_pairs_flag); @@ -1366,6 +1351,35 @@ void ModeConfInfo::set_conv_radius_by_index(int k) } +//////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_obs_conv_radius_by_index(int k) + +{ + if ( (k < 0) || (k >= Obs->conv_radius_array.n_elements()) ) { + mlog << Error + << "\nModeConfInfo::set_conv_radius_by_index(int) -> " + << "range check error\n\n"; + exit ( 1 ); + } + Obs->conv_radius = Obs->conv_radius_array[k]; +} + + +//////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_fcst_conv_radius_by_index(int k) + +{ + if ( (k < 0) || (k >= Fcst->conv_radius_array.n_elements()) ) { + mlog << Error + << "\nModeConfInfo::set_conv_radius_by_index(int) -> " + << "range check error\n\n"; + exit ( 1 ); + } + Fcst->conv_radius = Fcst->conv_radius_array[k]; +} + //////////////////////////////////////////////////////////////////////// @@ -1381,6 +1395,21 @@ void ModeConfInfo::set_conv_thresh(SingleThresh s) //////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_fcst_conv_thresh(SingleThresh s) +{ + Fcst->conv_thresh = s; +} + +//////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_obs_conv_thresh(SingleThresh s) +{ + Obs->conv_thresh = s; +} + +//////////////////////////////////////////////////////////////////////// + void ModeConfInfo::set_conv_radius(int r) { if (data_type != ModeDataType::MvMode_Obs) { @@ -1393,6 +1422,20 @@ void ModeConfInfo::set_conv_radius(int r) //////////////////////////////////////////////////////////////////////// +void ModeConfInfo::set_fcst_conv_radius(int r) +{ + Fcst->conv_radius = r; +} + +//////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_obs_conv_radius(int r) +{ + Obs->conv_radius = r; +} + +//////////////////////////////////////////////////////////////////////// + void ModeConfInfo::set_conv_thresh_by_index(int k) { @@ -1421,14 +1464,43 @@ void ModeConfInfo::set_conv_thresh_by_index(int k) //////////////////////////////////////////////////////////////////////// -void ModeConfInfo::set_merge_thresh_by_index(int k) +void ModeConfInfo::set_obs_conv_thresh_by_index(int k) + { - if (data_type != ModeDataType::MvMode_Fcst) { - if ( Obs->need_merge_thresh () ) set_obs_merge_thresh_by_index (k); + if ( (k < 0) || (k >= Obs->conv_thresh_array.n_elements()) ) { + mlog << Error + << "\nModeConfInfo::set_conv_thresh_by_index(int) -> " + << "range check error\n\n"; + exit ( 1 ); } - if (data_type != ModeDataType::MvMode_Obs) { - if ( Fcst->need_merge_thresh () ) set_fcst_merge_thresh_by_index (k); + Obs->conv_thresh = Obs->conv_thresh_array[k]; +} + + +//////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_fcst_conv_thresh_by_index(int k) + +{ + if ( (k < 0) || (k >= Fcst->conv_thresh_array.n_elements()) ) { + + mlog << Error + << "\nModeConfInfo::set_conv_thresh_by_index(int) -> " + << "range check error\n\n"; + exit ( 1 ); } + Fcst->conv_thresh = Fcst->conv_thresh_array[k]; +} + + +//////////////////////////////////////////////////////////////////////// + +void ModeConfInfo::set_merge_thresh_by_index(int k) +{ + if ( data_type != ModeDataType::MvMode_Fcst && + Obs->need_merge_thresh() ) set_obs_merge_thresh_by_index (k); + if ( data_type != ModeDataType::MvMode_Obs && + Fcst->need_merge_thresh() ) set_fcst_merge_thresh_by_index (k); } //////////////////////////////////////////////////////////////////////// @@ -1457,12 +1529,10 @@ void ModeConfInfo::set_fcst_merge_thresh_by_index(int k) void ModeConfInfo::set_conv_thresh_by_merge_index(int k) { - if (data_type != ModeDataType::MvMode_Fcst) { - if (Obs->need_merge_thresh()) set_obs_conv_thresh_by_merge_index (k); - } - if (data_type != ModeDataType::MvMode_Obs) { - if (Fcst->need_merge_thresh()) set_fcst_conv_thresh_by_merge_index (k); - } + if ( data_type != ModeDataType::MvMode_Fcst && + Obs->need_merge_thresh() ) set_obs_conv_thresh_by_merge_index (k); + if ( data_type != ModeDataType::MvMode_Obs && + Fcst->need_merge_thresh() ) set_fcst_conv_thresh_by_merge_index (k); } //////////////////////////////////////////////////////////////////////// @@ -1593,7 +1663,7 @@ GrdFileType ModeConfInfo::file_type_for_field(bool isFcst, int field_index) // look at the dictionary for the obs or forecast at index, with // parents - Dictionary * dict = (Dictionary *) nullptr; + Dictionary * dict = nullptr; if (isFcst) { dict = conf.lookup_dictionary(conf_key_fcst); } else { @@ -1688,7 +1758,7 @@ void ModeConfInfo::get_multivar_programs() { -Dictionary * dict = (Dictionary *) nullptr; +Dictionary * dict = nullptr; fcst_multivar_logic.clear(); obs_multivar_logic.clear(); @@ -1732,63 +1802,107 @@ void ModeConfInfo::check_multivar_not_implemented() } bool status = false; - if (quilt) { - mlog << Error - << "\nModeConfInfo::check_multivar_not_implemented():\n" - << " quilting not yet implemented for multivar mode\n\n"; - status = true; - } + + // All inputs must have the same number of convolution radii + // All inputs must have the same number of convolution thresholds + // Without quilting, the radii/thresh array lengths must be the same + + int nRForFcst = 0; + int nRForObs = 0; + int nTForFcst = 0; + int nTForObs = 0; for (int i=0; i 1 || fcst_array[i].merge_thresh_array.n() > 1) { + if (fcst_array[i].merge_flag == MergeType::Both || fcst_array[i].merge_flag == MergeType::Engine) + { + mlog << Error + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " merge_flag ENGINE or BOTH not implemented for multivariate mode\n\n"; + status = true; + } + if (i == 0) { + nTForFcst = fcst_array[i].conv_thresh_array.n(); + nRForFcst = fcst_array[i].conv_radius_array.n_elements(); + } + int nti = fcst_array[i].conv_thresh_array.n(); + int nri = fcst_array[i].conv_radius_array.n_elements(); + if (nti != nTForFcst || nri != nRForFcst) { + mlog << Error + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " Unequal array lengths for conv_thresh or conv_radii not allowed in multivariate mode\n\n"; + status = true; + } + if (fcst_array[i].merge_flag != MergeType::None) { + int nmi = fcst_array[i].merge_thresh_array.n(); + if (nmi != nTForFcst) { mlog << Error << "\nModeConfInfo::check_multivar_not_implemented():\n" - << " more than one conv_thresh or merge_thresh per input is not allowed in multivariate mode\n\n"; + << " Unequal array lengths for merge_thresh not allowed in multivariate mode\n\n"; status = true; - } + } } } for (int i=0; i 1 || obs_array[i].merge_thresh_array.n() > 1) { + if (obs_array[i].merge_flag == MergeType::Both || obs_array[i].merge_flag == MergeType::Engine) { + mlog << Error + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " merge_flag ENGINE or BOTH not implemented for multivariate mode\n\n"; + status = true; + break; + } + if (i == 0) { + nTForObs = obs_array[i].conv_thresh_array.n(); + nRForObs = obs_array[i].conv_radius_array.n_elements(); + } + int nti = obs_array[i].conv_thresh_array.n(); + int nri = obs_array[i].conv_radius_array.n_elements(); + if (nti != nTForObs || nri != nRForObs) { + mlog << Error + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " Unequal array lengths for conv_thresh or conv_radii not allowed in multivariate mode\n\n"; + status = true; + } + if (obs_array[i].merge_flag != MergeType::None) { + int nmi = obs_array[i].merge_thresh_array.n(); + if (nmi != nTForObs) { mlog << Error << "\nModeConfInfo::check_multivar_not_implemented():\n" - << " more than one conv_thresh or merge_thresh per input is not allowed in multivariate mode\n\n"; + << " Unequal array lengths for merge_thresh not allowed in multivariate mode\n\n"; status = true; - } + } } } - if (status) { + if (nTForObs != nTForFcst) { + mlog << Error + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " Obs convolution thresh/radius arrays must have the same number of elements as Fcst thresh/radius arrays\n\n"; + status = true; + } + if (nRForObs != nRForFcst) { mlog << Error - << "\nModeConfInfo::check_multivar_not_implemented:\n" - << " Some features not yet implemented in multivar mode\n\n"; + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " Obs convolution thresh/radius arrays must have the same number of elements as Fcst thresh/radius arrays\n\n"; + status = true; + } + if (!quilt && (nTForObs != nRForObs)) { + mlog << Error + << "\nModeConfInfo::check_multivar_not_implemented():\n" + << " Obs convolution thresh/radius arrays must have the same number of elements as Fcst thresh/radius arrays unless quilt=true\n\n"; + status = true; + } + + if (status) { exit ( 1 ); } } - //////////////////////////////////////////////////////////////////////// PercThreshType ModeConfInfo::perctype(const Mode_Field_Info &f) const { - PercThreshType pm=no_perc_thresh_type;; - PercThreshType pc=no_perc_thresh_type;; + PercThreshType pm=no_perc_thresh_type; + PercThreshType pc=no_perc_thresh_type; if (f.merge_thresh_array.n() > 0) { pm = f.merge_thresh_array[0].get_ptype(); } diff --git a/src/libcode/vx_shapedata/mode_conf_info.h b/src/libcode/vx_shapedata/mode_conf_info.h index 08f61ff3df..e4fe93e58f 100644 --- a/src/libcode/vx_shapedata/mode_conf_info.h +++ b/src/libcode/vx_shapedata/mode_conf_info.h @@ -262,17 +262,30 @@ class ModeConfInfo { void parse_nc_info (); - // might need addtional methods here for pass2 multivariate, if/when we allow more than 1 radius void set_conv_radius_by_index (int); - // might need addtional methods here for pass2 multivariate, if/when we allow more than 1 thresh + void set_obs_conv_radius_by_index (int); + void set_fcst_conv_radius_by_index (int); + void set_conv_thresh_by_index (int); + void set_obs_conv_thresh_by_index (int); + void set_fcst_conv_thresh_by_index (int); void set_conv_thresh(SingleThresh); + void set_fcst_conv_thresh(SingleThresh); + void set_obs_conv_thresh(SingleThresh); void set_conv_radius(int); + void set_fcst_conv_radius(int); + void set_obs_conv_radius(int); int n_conv_threshs () const; int n_conv_radii () const; + int n_conv_threshs_fcst () const; + int n_conv_radii_fcst () const; + + int n_conv_threshs_obs () const; + int n_conv_radii_obs () const; + int n_runs() const; // # threshs times # radii int n_fields_f() const; // should be 1 for traditional mode, >= 1 for muiltivar @@ -316,6 +329,7 @@ inline int ModeConfInfo::n_conv_radii() const { // this could break down if multivar mode relaxes // its limitations on number of radii (obs and fcst could be different) + // so far that is not the case. if (data_type == ModeDataType::MvMode_Obs) { return ( Obs->conv_radius_array.n_elements() ); @@ -324,10 +338,21 @@ inline int ModeConfInfo::n_conv_radii() const } } +inline int ModeConfInfo::n_conv_radii_fcst() const +{ + return ( Fcst->conv_radius_array.n_elements() ); +} + +inline int ModeConfInfo::n_conv_radii_obs() const +{ + return ( Obs->conv_radius_array.n_elements() ); +} + inline int ModeConfInfo::n_conv_threshs() const { // this could break down if multivar mode relaxes // its limitations on number of thresh (obs and fcst could be different) + // so far that is not the case. if (data_type == ModeDataType::MvMode_Obs) { return ( Obs->conv_thresh_array.n_elements() ); @@ -336,6 +361,16 @@ inline int ModeConfInfo::n_conv_threshs() const } } +inline int ModeConfInfo::n_conv_threshs_fcst() const +{ + return ( Fcst->conv_thresh_array.n_elements() ); +} + +inline int ModeConfInfo::n_conv_threshs_obs() const +{ + return ( Obs->conv_thresh_array.n_elements() ); +} + inline int ModeConfInfo::get_compression_level() { return conf.nc_compression(); } inline int ModeConfInfo::field_index_f() const { return Field_Index_f; } diff --git a/src/tools/core/mode/Makefile.am b/src/tools/core/mode/Makefile.am index 34bb6cc8dd..0fc2aabffd 100644 --- a/src/tools/core/mode/Makefile.am +++ b/src/tools/core/mode/Makefile.am @@ -22,6 +22,7 @@ mode_SOURCES = mode_usage.cc \ mode_ps_file.cc \ plot_engine.cc \ page_1.cc \ + simple_objects.cc \ fcst_enlarge_page.cc \ obs_enlarge_page.cc \ cluster_page.cc \ diff --git a/src/tools/core/mode/Makefile.in b/src/tools/core/mode/Makefile.in index 55999c4871..1837730adc 100644 --- a/src/tools/core/mode/Makefile.in +++ b/src/tools/core/mode/Makefile.in @@ -107,7 +107,7 @@ am_mode_OBJECTS = mode-mode_usage.$(OBJEXT) \ mode-mode.$(OBJEXT) mode-combine_boolplanes.$(OBJEXT) \ mode-objects_from_netcdf.$(OBJEXT) mode-mode_ps_file.$(OBJEXT) \ mode-plot_engine.$(OBJEXT) mode-page_1.$(OBJEXT) \ - mode-fcst_enlarge_page.$(OBJEXT) \ + mode-simple_objects.$(OBJEXT) mode-fcst_enlarge_page.$(OBJEXT) \ mode-obs_enlarge_page.$(OBJEXT) mode-cluster_page.$(OBJEXT) \ mode-overlap_page.$(OBJEXT) mode-mode_exec.$(OBJEXT) mode_OBJECTS = $(am_mode_OBJECTS) @@ -145,7 +145,8 @@ am__depfiles_remade = ./$(DEPDIR)/mode-cluster_page.Po \ ./$(DEPDIR)/mode-objects_from_netcdf.Po \ ./$(DEPDIR)/mode-obs_enlarge_page.Po \ ./$(DEPDIR)/mode-overlap_page.Po ./$(DEPDIR)/mode-page_1.Po \ - ./$(DEPDIR)/mode-plot_engine.Po + ./$(DEPDIR)/mode-plot_engine.Po \ + ./$(DEPDIR)/mode-simple_objects.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -361,6 +362,7 @@ mode_SOURCES = mode_usage.cc \ mode_ps_file.cc \ plot_engine.cc \ page_1.cc \ + simple_objects.cc \ fcst_enlarge_page.cc \ obs_enlarge_page.cc \ cluster_page.cc \ @@ -515,6 +517,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mode-overlap_page.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mode-page_1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mode-plot_engine.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mode-simple_objects.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -690,6 +693,20 @@ mode-page_1.obj: page_1.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mode_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mode-page_1.obj `if test -f 'page_1.cc'; then $(CYGPATH_W) 'page_1.cc'; else $(CYGPATH_W) '$(srcdir)/page_1.cc'; fi` +mode-simple_objects.o: simple_objects.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mode_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mode-simple_objects.o -MD -MP -MF $(DEPDIR)/mode-simple_objects.Tpo -c -o mode-simple_objects.o `test -f 'simple_objects.cc' || echo '$(srcdir)/'`simple_objects.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mode-simple_objects.Tpo $(DEPDIR)/mode-simple_objects.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='simple_objects.cc' object='mode-simple_objects.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mode_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mode-simple_objects.o `test -f 'simple_objects.cc' || echo '$(srcdir)/'`simple_objects.cc + +mode-simple_objects.obj: simple_objects.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mode_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mode-simple_objects.obj -MD -MP -MF $(DEPDIR)/mode-simple_objects.Tpo -c -o mode-simple_objects.obj `if test -f 'simple_objects.cc'; then $(CYGPATH_W) 'simple_objects.cc'; else $(CYGPATH_W) '$(srcdir)/simple_objects.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mode-simple_objects.Tpo $(DEPDIR)/mode-simple_objects.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='simple_objects.cc' object='mode-simple_objects.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mode_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mode-simple_objects.obj `if test -f 'simple_objects.cc'; then $(CYGPATH_W) 'simple_objects.cc'; else $(CYGPATH_W) '$(srcdir)/simple_objects.cc'; fi` + mode-fcst_enlarge_page.o: fcst_enlarge_page.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mode_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mode-fcst_enlarge_page.o -MD -MP -MF $(DEPDIR)/mode-fcst_enlarge_page.Tpo -c -o mode-fcst_enlarge_page.o `test -f 'fcst_enlarge_page.cc' || echo '$(srcdir)/'`fcst_enlarge_page.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mode-fcst_enlarge_page.Tpo $(DEPDIR)/mode-fcst_enlarge_page.Po @@ -903,6 +920,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/mode-overlap_page.Po -rm -f ./$(DEPDIR)/mode-page_1.Po -rm -f ./$(DEPDIR)/mode-plot_engine.Po + -rm -f ./$(DEPDIR)/mode-simple_objects.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -964,6 +982,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/mode-overlap_page.Po -rm -f ./$(DEPDIR)/mode-page_1.Po -rm -f ./$(DEPDIR)/mode-plot_engine.Po + -rm -f ./$(DEPDIR)/mode-simple_objects.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/tools/core/mode/combine_boolplanes.cc b/src/tools/core/mode/combine_boolplanes.cc index 111964c94c..608cdff409 100644 --- a/src/tools/core/mode/combine_boolplanes.cc +++ b/src/tools/core/mode/combine_boolplanes.cc @@ -23,6 +23,7 @@ using namespace std; // void combine_boolplanes(const string &name, + int rIndex, int tIndex, const BoolPlane * bpa, const int n_planes, BoolCalc & calc, BoolPlane & bp_out) @@ -57,7 +58,7 @@ void combine_boolplanes(const string &name, } // for x - mlog << Debug(1) << name << " has " << nTrue << " superobject points.\n"; + mlog << Debug(1) << name << " has " << nTrue << " superobject points. rIndex[" << rIndex << "] tIndex[" << tIndex << "]\n"; // // done diff --git a/src/tools/core/mode/combine_boolplanes.h b/src/tools/core/mode/combine_boolplanes.h index 2a7c168628..987b1a8c49 100644 --- a/src/tools/core/mode/combine_boolplanes.h +++ b/src/tools/core/mode/combine_boolplanes.h @@ -35,6 +35,7 @@ extern void combine_boolplanes(const std::string &name, + int rIndex, int tIndex, const BoolPlane * array, const int n_planes, BoolCalc & calc, BoolPlane & bp_out); diff --git a/src/tools/core/mode/mode_exec.cc b/src/tools/core/mode/mode_exec.cc index db43b97ebe..081266cae6 100644 --- a/src/tools/core/mode/mode_exec.cc +++ b/src/tools/core/mode/mode_exec.cc @@ -202,11 +202,13 @@ void ModeExecutive::init_traditional(int n_files) /////////////////////////////////////////////////////////////////////// -void ModeExecutive::init_multivar_simple(int j, int n_files, ModeDataType dtype, +void ModeExecutive::init_multivar_simple(int rIndex, int tIndex, + int j, ModeDataType dtype, const ModeConfInfo &conf) { - R_index = T_index = 0; + R_index = rIndex; + T_index = tIndex; engine.conf_info = conf; // tell the engine which type of data it is @@ -214,8 +216,6 @@ void ModeExecutive::init_multivar_simple(int j, int n_files, ModeDataType dtype, engine.conf_info.set_field_index(j); - // engine.conf_info.nc_info.compress_level = engine.conf_info.get_compression_level(); - return; } @@ -236,8 +236,6 @@ void ModeExecutive::init_multivar_intensities(const ModeConfInfo &conf) // check one again for multivar problems engine.conf_info.check_multivar_not_implemented(); - // engine.conf_info.nc_info.compress_level = engine.conf_info.get_compression_level(); - return; } @@ -250,8 +248,10 @@ void ModeExecutive::setup_traditional_fcst_obs_data() { - // ShapeData fcst_sd, obs_sd; - double fmin, omin, fmax, omax; + double fmin; + double omin; + double fmax; + double omax; Fcst_sd.clear(); Obs_sd.clear(); @@ -441,7 +441,8 @@ void ModeExecutive::setup_multivar_fcst_data(const Grid &verification_grid, const ModeInputData &input) { - double fmin, fmax; + double fmin; + double fmax; Fcst_sd.clear(); Fcst_sd.data = input._dataPlane; @@ -504,8 +505,8 @@ void ModeExecutive::setup_multivar_obs_data(const Grid &verification_grid, const ModeInputData &input) { - // ShapeData fcst_sd, obs_sd; - double omin, omax; + double omin; + double omax; Obs_sd.clear(); @@ -570,7 +571,10 @@ void ModeExecutive::setup_multivar_obs_data(const Grid &verification_grid, void ModeExecutive::setup_multivar_fcst_obs_data_intensities(const MultiVarData &mvdf, const MultiVarData &mvdo) { - double fmin, fmax, omin, omax; + double fmin; + double fmax; + double omin; + double omax; bool simple = true; Fcst_sd = *(mvdf.shapedata_ptr(simple)); @@ -672,9 +676,11 @@ void ModeExecutive::setup_multivar_fcst_obs_data_super(const ShapeData &f_super, const ShapeData &o_super, const Grid &igrid) { - double fmin, omin, fmax, omax; + double fmin; + double omin; + double fmax; + double omax; - bool simple = true; Fcst_sd = f_super; Fcst_sd.debug_examine(); Obs_sd = o_super; @@ -772,8 +778,7 @@ void ModeExecutive::do_conv_thresh_traditional(const int r_index, const int t_in ModeConfInfo & conf = engine.conf_info; // note that we are assuming the same r_index and t_index for both forecasts - // and obs, which might not be true if mvmode were to allow >1 index - // (currently it does not) + // and obs R_index = r_index; T_index = t_index; @@ -814,18 +819,22 @@ void ModeExecutive::do_conv_thresh_traditional(const int r_index, const int t_in /////////////////////////////////////////////////////////////////////// -void ModeExecutive::do_conv_thresh_multivar_super() +void ModeExecutive::do_conv_thresh_multivar_super(int rIndexF, int tIndexF, + int, int) { ModeConfInfo & conf = engine.conf_info; - R_index = 0; - T_index = 0; + R_index = rIndexF; + T_index = tIndexF; SingleThresh s("ne-9999"); - conf.set_conv_thresh(s); - conf.set_conv_radius(0.0); - conf.set_merge_thresh_by_index(T_index); + conf.set_fcst_conv_thresh(s); + conf.set_fcst_conv_radius(0.0); + conf.set_fcst_merge_thresh(s); + conf.set_obs_conv_thresh(s); + conf.set_obs_conv_radius(0.0); + conf.set_obs_merge_thresh(s); // // Set up the engine with these raw fields @@ -855,17 +864,21 @@ void ModeExecutive::do_conv_thresh_multivar_super() /////////////////////////////////////////////////////////////////////// -void ModeExecutive::do_conv_thresh_multivar_intensity_compare() +void ModeExecutive::do_conv_thresh_multivar_intensity_compare(int rIndexF, int tIndexF, int rIndexO, int tIndexO) { ModeConfInfo & conf = engine.conf_info; - R_index = 0; - T_index = 0; + R_index = rIndexF; + T_index = tIndexF; - conf.set_conv_radius_by_index(R_index); - conf.set_conv_thresh_by_index(T_index); - conf.set_merge_thresh_by_index(T_index); + conf.set_obs_conv_radius_by_index(rIndexO); + conf.set_obs_conv_thresh_by_index(tIndexO); + conf.set_obs_merge_thresh_by_index(tIndexO); + + conf.set_fcst_conv_radius_by_index(rIndexF); + conf.set_fcst_conv_thresh_by_index(tIndexF); + conf.set_fcst_merge_thresh_by_index(tIndexF); // // Set up the engine with these raw fields @@ -893,39 +906,35 @@ void ModeExecutive::do_conv_thresh_multivar_intensity_compare() /////////////////////////////////////////////////////////////////////// -void ModeExecutive::do_conv_thresh_multivar_simple(Processing_t p) +void ModeExecutive::do_conv_thresh_multivar_simple(Processing_t p, int rIndex, int) { - ModeConfInfo & conf = engine.conf_info; - - R_index = 0; - T_index = 0; + bool obs = conf.data_type == ModeDataType::MvMode_Obs; + string what; + if (obs) { + what = "observation field"; + } else { + what = "forecast field"; + } + mlog << Debug(2) << "Identifying objects in the " << what << " for " << stype(p) << "\n"; if (p == MULTIVAR_SIMPLE_MERGE) { + conf.set_conv_radius_by_index(R_index); // need this because exec was killed after SIMPLE conf.set_conv_thresh_by_merge_index(T_index); } else if (p == MULTIVAR_SIMPLE) { - conf.set_conv_radius_by_index(0); - conf.set_conv_thresh_by_index(0); + conf.set_conv_radius_by_index(R_index); + conf.set_conv_thresh_by_index(T_index); } else { mlog << Error << "\nModeExecutive::do_conv_thresh_multivar_simple() -> " << "Wrong processing type input " << stype(p) << "\"\n\n"; exit(1); } - conf.set_merge_thresh_by_index(0); + conf.set_merge_thresh_by_index(T_index); // // Set up the engine with these raw fields // - - string what; - if (conf.data_type == ModeDataType::MvMode_Obs) { - what = "observation field"; - } else { - what = "forecast field"; - } - mlog << Debug(2) << "Identifying objects in the " << what << "...\n"; - engine.set(Fcst_sd, Obs_sd); // (ct_stats not needed for simple or merge, only one field) @@ -933,7 +942,7 @@ void ModeExecutive::do_conv_thresh_multivar_simple(Processing_t p) // done // - local_r_index = 0; + local_r_index = rIndex; return; @@ -1066,7 +1075,8 @@ void ModeExecutive::process_masks(ShapeData & fcst_sd, ShapeData & obs_sd) { - ShapeData grid_mask_sd, poly_mask_sd; + ShapeData grid_mask_sd; + ShapeData poly_mask_sd; ConcatString name; mlog << Debug(2) @@ -1123,7 +1133,8 @@ void ModeExecutive::process_fcst_masks(ShapeData & fcst_sd) { - ShapeData grid_mask_sd, poly_mask_sd; + ShapeData grid_mask_sd; + ShapeData poly_mask_sd; ConcatString name; mlog << Debug(3) << "Processing masking regions.\n"; @@ -1167,11 +1178,11 @@ void ModeExecutive::process_obs_masks(ShapeData & obs_sd) { - ShapeData grid_mask_sd, poly_mask_sd; + ShapeData grid_mask_sd; + ShapeData poly_mask_sd; ConcatString name; - mlog << Debug(2) - << "Processing masking regions.\n"; + mlog << Debug(3) << "Processing masking regions.\n"; // Parse the grid mask into a ShapeData object if(engine.conf_info.mask_grid_flag != FieldType::None) { @@ -1282,21 +1293,22 @@ void ModeExecutive::process_output_multivar_intensity_compare(const MultiVarData double fmax = mvdf->_data_max; double omin = mvdo->_data_min; double omax = mvdo->_data_max; - double data_min, data_max; - if (!is_bad_data(fmin) && !is_bad_data(omin)) data_min = min(fmin, omin); - else if(!is_bad_data(fmin) && is_bad_data(omin)) data_min = fmin; - else if( is_bad_data(fmin) && !is_bad_data(omin)) data_min = omin; - - if (!is_bad_data(fmax) && !is_bad_data(omax)) data_max = max(fmax, omax); - else if(!is_bad_data(fmax) && is_bad_data(omax)) data_max = fmax; - else if( is_bad_data(fmax) && !is_bad_data(omax)) data_max = omax; + double dmin; + double dmax; + if (!is_bad_data(fmin) && !is_bad_data(omin)) dmin = min(fmin, omin); + else if(!is_bad_data(fmin) && is_bad_data(omin)) dmin = fmin; + else if( is_bad_data(fmin) && !is_bad_data(omin)) dmin = omin; + + if (!is_bad_data(fmax) && !is_bad_data(omax)) dmax = max(fmax, omax); + else if(!is_bad_data(fmax) && is_bad_data(omax)) dmax = fmax; + else if( is_bad_data(fmax) && !is_bad_data(omax)) dmax = omax; set_raw_to_full(mvdf->_simple->_raw_data,mvdo->_simple->_raw_data, - mvdf->_nx, mvdf->_ny, data_min, data_max); + mvdf->_nx, mvdf->_ny, dmin, dmax); write_obj_netcdf(engine.conf_info.nc_info); - if ( engine.conf_info.ps_plot_flag ) plot_engine(); + if ( engine.conf_info.ps_plot_flag ) plot_engine(); return; @@ -1333,13 +1345,13 @@ void ModeExecutive::compute_ct_stats() { - int i, x, y; - ShapeData fcst_mask, obs_mask; + ShapeData fcst_mask; + ShapeData obs_mask; mlog << Debug(2) << "Computing contingency table statistics...\n"; - for(i=0; iis_bad_data(x, y) || @@ -1512,7 +1524,9 @@ void ModeExecutive::write_obj_stats() { - AsciiTable obj_at, fcst_merge_at, obs_merge_at; + AsciiTable obj_at; + AsciiTable fcst_merge_at; + AsciiTable obs_merge_at; ofstream out; ConcatString stat_file; @@ -1698,45 +1712,44 @@ void ModeExecutive::write_obj_netcdf(const ModeNcOutInfo & info) if ( info.all_false() ) return; - int n, x, y; ConcatString out_file; ConcatString s; const ConcatString fcst_thresh = engine.conf_info.Fcst->conv_thresh.get_str(5); const ConcatString obs_thresh = engine.conf_info.Obs->conv_thresh.get_str(5); - float *fcst_raw_data = (float *) nullptr; - float *fcst_obj_raw_data = (float *) nullptr; - int *fcst_obj_data = (int *) nullptr; - int *fcst_clus_data = (int *) nullptr; + float *fcst_raw_data = nullptr; + float *fcst_obj_raw_data = nullptr; + int *fcst_obj_data = nullptr; + int *fcst_clus_data = nullptr; - float *obs_raw_data = (float *) nullptr; - float *obs_obj_raw_data = (float *) nullptr; - int *obs_obj_data = (int *) nullptr; - int *obs_clus_data = (int *) nullptr; + float *obs_raw_data = nullptr; + float *obs_obj_raw_data = nullptr; + int *obs_obj_data = nullptr; + int *obs_clus_data = nullptr; - NcFile *f_out = (NcFile *) nullptr; + NcFile *f_out = nullptr; - NcDim lat_dim ; - NcDim lon_dim ; + NcDim lat_dim; + NcDim lon_dim; - NcDim fcst_thresh_dim ; - NcDim obs_thresh_dim ; + NcDim fcst_thresh_dim; + NcDim obs_thresh_dim; - NcVar fcst_raw_var ; - NcVar fcst_obj_raw_var ; - NcVar fcst_obj_var ; - NcVar fcst_clus_var ; + NcVar fcst_raw_var; + NcVar fcst_obj_raw_var; + NcVar fcst_obj_var; + NcVar fcst_clus_var; - NcVar obs_raw_var ; - NcVar obs_obj_raw_var ; - NcVar obs_obj_var ; - NcVar obs_clus_var ; + NcVar obs_raw_var; + NcVar obs_obj_raw_var; + NcVar obs_obj_var; + NcVar obs_clus_var; - NcVar fcst_radius_var ; - NcVar obs_radius_var ; + NcVar fcst_radius_var; + NcVar obs_radius_var; - NcVar fcst_thresh_var ; - NcVar obs_thresh_var ; + NcVar fcst_thresh_var; + NcVar obs_thresh_var; // // Create output NetCDF file name @@ -1943,11 +1956,11 @@ void ModeExecutive::write_obj_netcdf(const ModeNcOutInfo & info) } - for(x=0; xdata (x, y); - obs_raw_data[n] = engine.obs_raw->data (x, y); + fcst_raw_data[n] = (float) engine.fcst_raw->data (x, y); + obs_raw_data[n] = (float) engine.obs_raw->data (x, y); } if(engine.fcst_split->is_nonzero(x, y) ) { if ( info.do_object_raw && fcst_obj_raw_data != nullptr && engine.fcst_raw != nullptr ) { - fcst_obj_raw_data[n] = engine.fcst_raw->data(x, y); + fcst_obj_raw_data[n] = (float) engine.fcst_raw->data(x, y); } if ( info.do_object_id && fcst_obj_data != nullptr && engine.fcst_split != nullptr ) { fcst_obj_data[n] = nint(engine.fcst_split->data(x, y)); @@ -1981,7 +1994,7 @@ void ModeExecutive::write_obj_netcdf(const ModeNcOutInfo & info) if(engine.obs_split->is_nonzero(x, y) ) { if ( info.do_object_raw && obs_obj_raw_data != nullptr ) { - obs_obj_raw_data[n] = engine.obs_raw->data(x, y); + obs_obj_raw_data[n] = (float) engine.obs_raw->data(x, y); } if ( info.do_object_id && obs_obj_data != nullptr ) { obs_obj_data[n] = nint(engine.obs_split->data(x, y)); @@ -2038,75 +2051,63 @@ void ModeExecutive::write_obj_netcdf(const ModeNcOutInfo & info) // Write the forecast and observation raw value variables // - if ( info.do_raw ) { - - if( !put_nc_data_with_dims(&fcst_raw_var, &fcst_raw_data[0], grid.ny(), grid.nx()) || - !put_nc_data_with_dims(&obs_raw_var, &obs_raw_data[0], grid.ny(), grid.nx()) ) { - - mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " - << "error with the fcst_raw_var->put or obs_raw_var->put\n\n"; - exit(1); - } + if( info.do_raw && + (!put_nc_data_with_dims(&fcst_raw_var, &fcst_raw_data[0], grid.ny(), grid.nx()) || + !put_nc_data_with_dims(&obs_raw_var, &obs_raw_data[0], grid.ny(), grid.nx())) ) { + mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " + << "error with the fcst_raw_var->put or obs_raw_var->put\n\n"; + exit(1); } - if ( info.do_object_raw ) { - - if( !put_nc_data_with_dims(&fcst_obj_raw_var, &fcst_obj_raw_data[0], grid.ny(), grid.nx()) || - !put_nc_data_with_dims(&obs_obj_raw_var, &obs_obj_raw_data[0], grid.ny(), grid.nx()) ) { - - mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " - << "error with the fcst_obj_raw_var->put or obs_obj_raw_var->put\n\n"; - exit(1); - } + if ( info.do_object_raw && + (!put_nc_data_with_dims(&fcst_obj_raw_var, &fcst_obj_raw_data[0], grid.ny(), grid.nx()) || + !put_nc_data_with_dims(&obs_obj_raw_var, &obs_obj_raw_data[0], grid.ny(), grid.nx())) ) { + mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " + << "error with the fcst_obj_raw_var->put or obs_obj_raw_var->put\n\n"; + exit(1); } // // Write the forecast and observation object ID variables // - if ( info.do_object_id ) { - - if( !put_nc_data_with_dims(&fcst_obj_var, &fcst_obj_data[0], grid.ny(), grid.nx()) || - !put_nc_data_with_dims(&obs_obj_var, &obs_obj_data[0], grid.ny(), grid.nx()) ) { - - mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " - << "error with the fcst_obj_var->put or obs_obj_var->put\n\n"; - exit(1); - } + if ( info.do_object_id && + (!put_nc_data_with_dims(&fcst_obj_var, &fcst_obj_data[0], grid.ny(), grid.nx()) || + !put_nc_data_with_dims(&obs_obj_var, &obs_obj_data[0], grid.ny(), grid.nx())) ) { + mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " + << "error with the fcst_obj_var->put or obs_obj_var->put\n\n"; + exit(1); } // // Write the forecast and observation cluster object ID variables // - if ( info.do_cluster_id ) { - - if( !put_nc_data_with_dims(&fcst_clus_var, &fcst_clus_data[0], grid.ny(), grid.nx()) || - !put_nc_data_with_dims(&obs_clus_var, &obs_clus_data[0], grid.ny(), grid.nx()) ) { - - mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " - << "error with the fcst_clus_var->put or obs_clus_var->put\n\n"; - exit(1); - } + if ( info.do_cluster_id && + (!put_nc_data_with_dims(&fcst_clus_var, &fcst_clus_data[0], grid.ny(), grid.nx()) || + !put_nc_data_with_dims(&obs_clus_var, &obs_clus_data[0], grid.ny(), grid.nx())) ) { + mlog << Error << "\nModeExecutive::write_obj_netcdf() -> " + << "error with the fcst_clus_var->put or obs_clus_var->put\n\n"; + exit(1); } // // Delete allocated memory // - if (fcst_raw_data) { delete [] fcst_raw_data; fcst_raw_data = (float *) nullptr; } - if (fcst_obj_raw_data) { delete [] fcst_obj_raw_data; fcst_obj_raw_data = (float *) nullptr; } - if (fcst_obj_data) { delete [] fcst_obj_data; fcst_obj_data = (int *) nullptr; } - if (fcst_clus_data) { delete [] fcst_clus_data; fcst_clus_data = (int *) nullptr; } + if (fcst_raw_data) { delete [] fcst_raw_data; fcst_raw_data = nullptr; } + if (fcst_obj_raw_data) { delete [] fcst_obj_raw_data; fcst_obj_raw_data = nullptr; } + if (fcst_obj_data) { delete [] fcst_obj_data; fcst_obj_data = nullptr; } + if (fcst_clus_data) { delete [] fcst_clus_data; fcst_clus_data = nullptr; } - if (obs_raw_data) { delete [] obs_raw_data; obs_raw_data = (float *) nullptr; } - if (obs_obj_raw_data) { delete [] obs_obj_raw_data; obs_obj_raw_data = (float *) nullptr; } - if (obs_obj_data) { delete [] obs_obj_data; obs_obj_data = (int *) nullptr; } - if (obs_clus_data) { delete [] obs_clus_data; obs_clus_data = (int *) nullptr; } + if (obs_raw_data) { delete [] obs_raw_data; obs_raw_data = nullptr; } + if (obs_obj_raw_data) { delete [] obs_obj_raw_data; obs_obj_raw_data = nullptr; } + if (obs_obj_data) { delete [] obs_obj_data; obs_obj_data = nullptr; } + if (obs_clus_data) { delete [] obs_clus_data; obs_clus_data = nullptr; } // // Write out the values of the vertices of the polylines. @@ -2180,42 +2181,52 @@ void ModeExecutive::write_poly_netcdf(NcFile *f_out, ObjPolyType poly_type) { - int i, j, x, y, n_pts, n_poly; - double lat, lon; + int n_poly; + double lat; + double lon; - Polyline **poly = (Polyline **) nullptr; + Polyline **poly = nullptr; - int *poly_start = (int *) nullptr; - int *poly_npts = (int *) nullptr; - float *poly_lat = (float *) nullptr; - float *poly_lon = (float *) nullptr; - int *poly_x = (int *) nullptr; - int *poly_y = (int *) nullptr; + int *poly_start = nullptr; + int *poly_npts = nullptr; + float *poly_lat = nullptr; + float *poly_lon = nullptr; + int *poly_x = nullptr; + int *poly_y = nullptr; // Dimensions and variables for each object - NcDim obj_dim ; - NcVar obj_poly_start_var ; - NcVar obj_poly_npts_var ; + NcDim obj_dim; + NcVar obj_poly_start_var; + NcVar obj_poly_npts_var; // Dimensions and variables for each boundary point - NcDim poly_dim ; - NcVar poly_lat_var ; - NcVar poly_lon_var ; - NcVar poly_x_var ; - NcVar poly_y_var ; + NcDim poly_dim; + NcVar poly_lat_var; + NcVar poly_lon_var; + NcVar poly_x_var; + NcVar poly_y_var; // Dimension names - ConcatString obj_dim_name, poly_dim_name; + ConcatString obj_dim_name; + ConcatString poly_dim_name; // Variable names - ConcatString start_var_name, start_long_name; - ConcatString npts_var_name, npts_long_name; - ConcatString lat_var_name, lat_long_name; - ConcatString lon_var_name, lon_long_name; - ConcatString x_var_name, x_long_name; - ConcatString y_var_name, y_long_name; - ConcatString field_name, field_long; - ConcatString poly_name, poly_long; + ConcatString start_var_name; + ConcatString start_long_name; + ConcatString npts_var_name; + ConcatString npts_long_name; + ConcatString lat_var_name; + ConcatString lat_long_name; + ConcatString lon_var_name; + ConcatString lon_long_name; + ConcatString x_var_name; + ConcatString x_long_name; + ConcatString y_var_name; + ConcatString y_long_name; + ConcatString field_name; + ConcatString field_long; + ConcatString poly_name; + ConcatString poly_long; // Determine the number of polylines to be written // and set up strings @@ -2301,7 +2312,7 @@ void ModeExecutive::write_poly_netcdf(NcFile *f_out, ObjPolyType poly_type) poly = new Polyline * [n_poly]; // Point at the polyline to be written - for(i=0; in_points; + int n_pts = 0; + for(int i=0; in_points; // Define dimensions NcDim tmp_obj_dim = get_nc_dim(f_out, (string)obj_dim_name); @@ -2379,7 +2391,7 @@ void ModeExecutive::write_poly_netcdf(NcFile *f_out, ObjPolyType poly_type) // Store the points for each polyline // n_pts = 0; - for(i=0; in_points; - for(j=0; ju[j]); - y = nint(poly[i]->v[j]); + int x = nint(poly[i]->u[j]); + int y = nint(poly[i]->v[j]); poly_x[n_pts] = x; poly_y[n_pts] = y; // Convert to lat/lon and store them grid.xy_to_latlon(x, y, lat, lon); - poly_lat[n_pts] = lat; - poly_lon[n_pts] = -1.0*lon; + poly_lat[n_pts] = (float) lat; + poly_lon[n_pts] = -1.0 * ((float) lon); } } @@ -2460,7 +2472,7 @@ void ModeExecutive::write_ct_stats() AsciiTable cts_at; ofstream out; - int i, c; + int c; double v; ConcatString stat_file; @@ -2491,8 +2503,8 @@ void ModeExecutive::write_ct_stats() // Setup the AsciiTable to be used // cts_at.clear(); - i = n_mode_hdr_columns + n_mode_cts_columns; - cts_at.set_size(3, i); // Set table size + c = n_mode_hdr_columns + n_mode_cts_columns; + cts_at.set_size(3, c); // Set table size justify_mode_cols(cts_at); // Justify columns cts_at.set_precision( // Set the precision engine.conf_info.conf.output_precision()); @@ -2503,14 +2515,14 @@ void ModeExecutive::write_ct_stats() // // Write out the MODE header columns // - for(i=0; i values; vector count; @@ -99,7 +101,7 @@ static void _debug_shape_examine(string &name, const ShapeData &sd, values.push_back(v); count.push_back(1); } else { - int ii = vi - values.begin(); + auto ii = (int) (vi - values.begin()); count[ii] = count[ii] + 1; } } @@ -109,18 +111,25 @@ static void _debug_shape_examine(string &name, const ShapeData &sd, } } +ModeSuperObject::ModeSuperObject() +{ +} + ModeSuperObject::ModeSuperObject(bool isFcst, int n_files, bool do_clusters, + int r_index, int t_index, const vector &mvd, BoolCalc &calc) { _hasUnion = calc.has_union(); + _rIndex = r_index; + _tIndex = t_index; // // set the BoolPlane values using the mvd content // - BoolPlane * simple_plane = new BoolPlane [n_files]; - BoolPlane * merge_plane = new BoolPlane [n_files]; + auto simple_plane = new BoolPlane [n_files]; + auto merge_plane = new BoolPlane [n_files]; for (int j=0; jobjects_from_arrays(do_clusters, true, simple_plane[j]); @@ -137,7 +146,8 @@ ModeSuperObject::ModeSuperObject(bool isFcst, int n_files, bool do_clusters, _simple_result.set_size(nx, ny); merge_result.set_size(nx, ny); - string simple_name, merge_name; + string simple_name; + string merge_name; if (isFcst) { simple_name = "Fcst_Simple"; @@ -146,8 +156,10 @@ ModeSuperObject::ModeSuperObject(bool isFcst, int n_files, bool do_clusters, simple_name = "Obs_Simple"; merge_name = "Obs_Merge"; } - combine_boolplanes(simple_name, simple_plane, n_files, calc, _simple_result); - combine_boolplanes(merge_name, merge_plane, n_files, calc, merge_result); + + mlog << Debug(1) << "\n"; + combine_boolplanes(simple_name, _rIndex, _tIndex, simple_plane, n_files, calc, _simple_result); + combine_boolplanes(merge_name, _rIndex, _tIndex, merge_plane, n_files, calc, merge_result); // create ShapeData objects using something from mvd as a template // (shape data has 1's or bad) @@ -163,7 +175,7 @@ ModeSuperObject::ModeSuperObject(bool isFcst, int n_files, bool do_clusters, } } - ShapeData merge_sd = ShapeData(*(mvd[0]->_simple->_sd)); + auto merge_sd = ShapeData(*(mvd[0]->_simple->_sd)); for (int x=0; x &mvd, BoolCalc &calc); inline ~ModeSuperObject() {} @@ -40,6 +43,8 @@ class ModeSuperObject { bool _isFcst; bool _hasUnion; + int _rIndex; + int _tIndex; BoolPlane _simple_result; ShapeData _simple_sd; ShapeData _merge_sd_split; diff --git a/src/tools/core/mode/multivar_frontend.cc b/src/tools/core/mode/multivar_frontend.cc index baa0537791..77d9882eb0 100644 --- a/src/tools/core/mode/multivar_frontend.cc +++ b/src/tools/core/mode/multivar_frontend.cc @@ -10,7 +10,6 @@ #include "multivar_frontend.h" - #include "mode_usage.h" #ifdef WITH_PYTHON @@ -35,8 +34,7 @@ static const char mode_default_config [] = "MET_BASE/config/MODEMultivarConfig_d static const int dir_creation_mode = 0755; -static ModeExecutive *mode_exec = 0; - +static ModeExecutive *mode_exec = nullptr; //////////////////////////////////////////////////////////////////////// @@ -46,38 +44,42 @@ MultivarFrontEnd::MultivarFrontEnd() do_clusters = false; default_out_dir = "."; compress_level = -1; - mode_exec = 0; + mode_exec = nullptr; } //////////////////////////////////////////////////////////////////////// -int MultivarFrontEnd::run(const StringArray & Argv) - +MultivarFrontEnd::~MultivarFrontEnd() { + if ( mode_exec ) { + delete mode_exec; mode_exec = nullptr; + } + } - // initialize +//////////////////////////////////////////////////////////////////////// - init(Argv); +int MultivarFrontEnd::run(const StringArray & Argv) +{ + // initialize - mlog << Debug(2) << "\n" << sep << "\n"; + _init(Argv); - // read in all the data + mlog << Debug(1) << "\n" << sep << "\n"; // in the conf object, shift *can* be set independently for obs and fcst int shift = config.shift_right; + // read in all the data for (int i=0; i" + << "all convolution threshold arrays must have the same number of elements\n\n"; + exit ( 1 ); + } + if (NCRF != NCRO) { + mlog << Error << "\nMultivarFrontEnd::run() ->" + << "all convolution radius arrays must have the same number of elements\n\n"; + exit ( 1 ); + } - // - // do the individual mode runs which produce everything needed to create - // super objects (stored in 'mvdObs', 'mvdFcst') (both simple and merge steps - // are done here). - // + if ((!config.quilt) && (NCTF != NCRF || NCTO != NCRO)) { + mlog << Error << "\nMultivarFrontEnd::run() ->" + << "all convolution radius and threshold arrays must have the same number of elements without quilting\n\n"; + exit ( 1 ); + } - for (int j=0; j fcstSimple; + vector obsSimple; + + // create simple objects for all convolution settings + if (config.quilt) { + for (int ir=0; irprint(); - } // for j + // Note at this point we know the compare index arrays are the same length for fcst + // and obs - for (int j=0; jprint(); - } // for j + // Filter the data to within the superobjects only and do statistics by invoking mode + // algorithm again on the masked data pairs - mlog << Debug(2) << "\n finished with simple multivar mode runs " << "\n" << sep << "\n"; + for (int k=0; kgrid(); - GrdFileType ft = f->file_type(); - - //? - f->set_shift_right(shift); - - // update config now that we know file type (this sets Fcst to index i) - DataPlane dp; - - if (type == ModeDataType::MvMode_Fcst) { - config.process_config_field(ft, other_t, type, index); - f->data_plane(*(config.Fcst->var_info), dp); - fcstInput.push_back(ModeInputData(name, dp, g)); - } else { - config.process_config_field(other_t, ft, type, index); - f->data_plane(*(config.Obs->var_info), dp); - obsInput.push_back(ModeInputData(name, dp, g)); - } - - delete f; -} - -//////////////////////////////////////////////////////////////////////// - -void MultivarFrontEnd::create_verif_grid() -{ - mlog << Debug(2) << "\n creating the verification grid \n" << sep << "\n"; - - _init_exec(ModeExecutive::TRADITIONAL, "None", "None"); - mode_exec->setup_verification_grid(fcstInput[0], obsInput[0], config); - verification_grid = mode_exec->grid; - delete mode_exec; mode_exec = 0; -} - -//////////////////////////////////////////////////////////////////////// - -MultiVarData *MultivarFrontEnd::create_simple_objects(ModeDataType dtype, int j, - int n_files, - const string &filename, - const ModeInputData &input) -{ - // - // create simple non merged objects - // - _simple_objects(ModeExecutive::MULTIVAR_SIMPLE, dtype, j, n_files, - filename, input); - MultiVarData *mvdi = mode_exec->get_multivar_data(dtype); - delete mode_exec; mode_exec = 0; - - // - // create simple merged objects - // - _simple_objects(ModeExecutive::MULTIVAR_SIMPLE_MERGE, dtype, j, n_files, - filename, input); - mode_exec->add_multivar_merge_data(mvdi, dtype); - delete mode_exec; mode_exec = 0; - return mvdi; -} - -//////////////////////////////////////////////////////////////////////// - -void -MultivarFrontEnd::create_intensity_comparisons(int findex, int oindex, - const ModeSuperObject &fsuper, - const ModeSuperObject &osuper, - MultiVarData &mvdf, MultiVarData &mvdo, - const string &fcst_filename, - const string &obs_filename) -{ - - // mask the input data to be valid only inside the simple super objects - fsuper.mask_data_simple("Fcst", mvdf); - osuper.mask_data_simple("Obs", mvdo); - - mlog << Debug(1) << "Running mvmode intensity comparisions \n\n"; - - _init_exec(ModeExecutive::MULTIVAR_INTENSITY, fcst_filename, obs_filename); - mode_exec->init_multivar_intensities(config); - - ModeConfInfo & conf = mode_exec->engine.conf_info; - conf.set_field_index(findex, oindex); - - // for multivar intensities, explicity set the level and units using stored values - // from pass1 - conf.Fcst->var_info->set_level_name(mvdf._level.c_str()); - conf.Fcst->var_info->set_units(mvdf._units.c_str()); - if (fsuper._hasUnion && conf.Fcst->merge_flag == MergeType::Thresh) { - mlog << Warning << "\nModeFrontEnd::multivar_intensity_comparisons() -> " - << "Logic includes union '||' along with 'merge_flag=THRESH' " - << ". This can lead to bad results\n\n"; - } - conf.Obs->var_info->set_level_name(mvdo._level.c_str()); - conf.Obs->var_info->set_units(mvdo._units.c_str()); - if (osuper._hasUnion && conf.Obs->merge_flag == MergeType::Thresh) { - mlog << Warning << "\nModeFrontEnd::multivar_intensity_comparisons() -> " - << "Logic includes union '||' along with 'merge_flag=THRESH' " - << ". This can lead to bad results\n\n"; - } - - // - // set up data access using inputs - // - mode_exec->setup_multivar_fcst_obs_data_intensities(mvdf, mvdo); - - // - // run the mode algorithm for multivar intensities - // - _intensity_compare_mode_algorithm(mvdf, mvdo, fsuper, osuper); - - delete mode_exec; mode_exec = 0; -} - -//////////////////////////////////////////////////////////////////////// - -void MultivarFrontEnd::process_superobjects(ModeSuperObject &fsuper, - ModeSuperObject &osuper, - const MultiVarData &mvdf, - const MultiVarData &mvdo) -{ - mlog << Debug(1) << "Running superobject mode \n\n"; - - // set the data to 0 inside superobjects and missing everywhere else + int Argc = Argv.n(); - fsuper.mask_data_super("FcstSimple", mvdf); - osuper.mask_data_super("ObsSimple", mvdo); + if ( Argc < 4 ) multivar_usage(); - _init_exec(ModeExecutive::MULTIVAR_SUPER, "None", "None"); - mode_exec->init_multivar_intensities(config); + // set some logging related things here, used in all further processing + _process_command_line(Argv); - ModeConfInfo & conf = mode_exec->engine.conf_info; - if ((fsuper._hasUnion || osuper._hasUnion) && - (conf.Fcst->merge_flag == MergeType::Thresh || - conf.Obs->merge_flag == MergeType::Thresh)) { - mlog << Warning << "\nModeFrontEnd::run_super() -> " - << "Logic includes union '||' along with 'merge_flag=THRESH' " - << ". This can lead to bad results\n\n"; - } - - // - // set up data access using inputs - // - mode_exec->setup_multivar_fcst_obs_data_super(fsuper._simple_sd, osuper._simple_sd, - *mvdf._grid); + // read the config as fully as possible without any data reads + // (Initialize all the input fields) + _read_config(config_file); - // run the mode algorithm - _superobject_mode_algorithm(fsuper, osuper); + // check for length discrepencies and set up input files + _setup_inputs(); - delete mode_exec; mode_exec = 0; + // set output path + _set_output_path(); } //////////////////////////////////////////////////////////////////////// @@ -419,7 +263,6 @@ void MultivarFrontEnd::process_superobjects(ModeSuperObject &fsuper, void MultivarFrontEnd::_process_command_line(const StringArray & argv) { - CommandLine cline; // @@ -450,16 +293,12 @@ void MultivarFrontEnd::_process_command_line(const StringArray & argv) config_file = cline[2]; return; - } //////////////////////////////////////////////////////////////////////// - void MultivarFrontEnd::_read_config(const string & filename) - { - ConcatString path; path = replace_path(mode_default_config); @@ -473,12 +312,8 @@ void MultivarFrontEnd::_read_config(const string & filename) // what is this, command line overrides config? look deeper.. remove from exec // except traditional mode if (compress_level >= 0) config.nc_info.set_compress_level(compress_level); - // from within mode_exec: - // engine.conf_info.nc_info.compress_level = engine.conf_info.get_compression_level(); - return; - } //////////////////////////////////////////////////////////////////////// @@ -491,7 +326,7 @@ void MultivarFrontEnd::_setup_inputs() if ( config.fcst_multivar_logic.empty() ) { - mlog << Error << "\nmultivar_consistency_checks() ->" + mlog << Error << "\nMultivarFrontEnd::_setup_inputs() ->" << "fcst multivar logic not specified in multivar mode!\n\n"; exit ( 1 ); @@ -499,7 +334,7 @@ void MultivarFrontEnd::_setup_inputs() if ( config.obs_multivar_logic.empty() ) { - mlog << Error << "\nmultivar_consistency_checks() ->" + mlog << Error << "\nMultivarFrontEnd::_setup_inputs() ->" << "obs multivar logic not specified in multivar mode!\n\n"; exit ( 1 ); @@ -516,7 +351,7 @@ void MultivarFrontEnd::_setup_inputs() // if ( n_fcst_files < 2 && n_obs_files < 2) { - mlog << Error << "\nmultivar_consistency_checks() ->" + mlog << Error << "\nMultivarFrontEnd::_setup_inputs() ->" << "Want at least 2 input files for fcst or obs in multivar mode, neither had 2 or more\n\n"; exit ( 1 ); } @@ -538,7 +373,7 @@ void MultivarFrontEnd::_setup_inputs() if (config.fcst_multivar_compare_index.n() != config.obs_multivar_compare_index.n()) { - mlog << Error << "\nmultivar_consistency_checks() ->" + mlog << Error << "\nMultivarFrontEnd::_setup_inputs() ->" << " Need equal number of multivar_compare_index entries for obs and fcst\n\n"; exit(1); } @@ -549,13 +384,13 @@ void MultivarFrontEnd::_setup_inputs() int findex = config.fcst_multivar_compare_index[k]; int oindex = config.obs_multivar_compare_index[k]; if (findex <= 0 || findex > n_fcst_files) { - mlog << Error << "\nmultivar_consistency_checks() ->" + mlog << Error << "\nMultivarFrontEnd::_setup_inputs() ->" << " forecast index " << findex << " out of range, " << conf_key_fcst_multivar_compare_index << " array\n"; badIndex = true; } if (oindex <= 0 || oindex > n_obs_files) { - mlog << Error << "\nmultivar_consistency_checks() ->" + mlog << Error << "\nMultivarFrontEnd::_setup_inputs() ->" << " obs index " << oindex << " out of range, " << conf_key_obs_multivar_compare_index << " array\n"; badIndex = true; @@ -593,7 +428,7 @@ void MultivarFrontEnd::_set_output_path() if ( status < 0 ) { - mlog << Error << "\nset_multivar_dir() ->" + mlog << Error << "\nMultivarFrontEnd::_set_output_path() ->" << " unable to create output directory \"" << output_path << "\"\n\n"; @@ -604,25 +439,24 @@ void MultivarFrontEnd::_set_output_path() //////////////////////////////////////////////////////////////////////// -int MultivarFrontEnd::_mkdir(const char *dir) +int MultivarFrontEnd::_mkdir(const char *dir) const { char tmp[256]; - char *p = NULL; size_t len; snprintf(tmp, sizeof(tmp),"%s",dir); len = strlen(tmp); if (tmp[len - 1] == '/') tmp[len - 1] = 0; - for (p = tmp + 1; *p; p++) + for (char *p = tmp + 1; *p; p++) if (*p == '/') { *p = 0; string s = tmp; - if (s != ".") { - if (mkdir(tmp, dir_creation_mode) < 0) { - mlog << Error << "\n_mkdir() -> Error making " << tmp << "\n"; - return -1; - } + if (s != "." && + mkdir(tmp, dir_creation_mode) < 0) { + mlog << Error << "\nMultivarFrontEnd::_mkdir() ->" + << "Error making " << tmp << "\n"; + return -1; } *p = '/'; } @@ -632,71 +466,201 @@ int MultivarFrontEnd::_mkdir(const char *dir) //////////////////////////////////////////////////////////////////////// +void MultivarFrontEnd::_read_input(const string &name, int index, ModeDataType type, + GrdFileType f_t, GrdFileType other_t, int shift) +{ + Met2dDataFileFactory mtddf_factory; + Met2dDataFile *f = mtddf_factory.new_met_2d_data_file(name.c_str(), f_t); + if (!f) { + mlog << Error << "\nMultivarFrontEnd::_read_input() ->" + << "\nTrouble reading fcst file \"" << name << "\"\n\n"; + exit(1); + } + Grid g = f->grid(); + GrdFileType ft = f->file_type(); + + //? + f->set_shift_right(shift); + + // update config now that we know file type (this sets Fcst to index i) + DataPlane dp; + + if (type == ModeDataType::MvMode_Fcst) { + config.process_config_field(ft, other_t, type, index); + f->data_plane(*(config.Fcst->var_info), dp); + fcstInput.push_back(ModeInputData(name, dp, g)); + } else { + config.process_config_field(other_t, ft, type, index); + f->data_plane(*(config.Obs->var_info), dp); + obsInput.push_back(ModeInputData(name, dp, g)); + } + + delete f; +} + +//////////////////////////////////////////////////////////////////////// + +void MultivarFrontEnd::_create_verif_grid() +{ + mlog << Debug(1) << "\n creating the verification grid \n" << sep << "\n"; + + _init_exec(ModeExecutive::TRADITIONAL, "None", "None"); + mode_exec->setup_verification_grid(fcstInput[0], obsInput[0], config); + verification_grid = mode_exec->grid; + delete mode_exec; mode_exec = nullptr; +} + +//////////////////////////////////////////////////////////////////////// + +void MultivarFrontEnd::_create_simple_objects(ModeDataType dtype, const std::string &name, + int rIndex, int tIndex, int n_files, + const StringArray &filenames, + const std::vector &input, + BoolCalc &calc, SimpleObjects &O) const +{ + O.init(dtype, rIndex, tIndex); + for (int j=0; jprint(); + O._mvd.push_back(mvdi); + } + O.setSuper(dtype == ModeDataType::MvMode_Fcst, n_files, do_clusters, calc); +} + +//////////////////////////////////////////////////////////////////////// + +MultiVarData *MultivarFrontEnd::_create_simple_multivar_data(ModeDataType dtype, + int rIndex, int tIndex, + int j, int n_files, + const string &filename, + const ModeInputData &input) const +{ + // + // create simple non merged objects + // + _simple_objects(ModeExecutive::MULTIVAR_SIMPLE, dtype, rIndex, tIndex, j, n_files, + filename, input); + MultiVarData *mvdi = mode_exec->get_multivar_data(dtype); + delete mode_exec; mode_exec = nullptr; + + // + // create simple merged objects + // + _simple_objects(ModeExecutive::MULTIVAR_SIMPLE_MERGE, dtype, rIndex, tIndex, j, n_files, + filename, input); + mode_exec->add_multivar_merge_data(mvdi, dtype); + delete mode_exec; mode_exec = nullptr; + return mvdi; +} + +//////////////////////////////////////////////////////////////////////// + void MultivarFrontEnd::_simple_objects(ModeExecutive::Processing_t p, - ModeDataType dtype, - int j, int n_files, const string &filename, - const ModeInputData &input) + ModeDataType dtype, int rIndex, + int tIndex, int j, int n_files, + const string &filename, + const ModeInputData &input) const { if (dtype == ModeDataType::MvMode_Fcst) { _init_exec(p, filename, "None"); - mode_exec->init_multivar_simple(j, n_files, dtype, config); + mode_exec->init_multivar_simple(rIndex, tIndex, j, dtype, config); mode_exec->setup_multivar_fcst_data(verification_grid, input); } else { _init_exec(p, "None", filename); - mode_exec->init_multivar_simple(j, n_files, dtype, config); + mode_exec->init_multivar_simple(rIndex, tIndex, j, dtype, config); mode_exec->setup_multivar_obs_data(verification_grid, input); } - _simple_mode_algorithm(p); + _simple_mode_algorithm(p, rIndex, tIndex); } //////////////////////////////////////////////////////////////////////// -void MultivarFrontEnd::_init_exec(ModeExecutive::Processing_t p, - const string &ffile, - const string &ofile) +void MultivarFrontEnd::_simple_mode_algorithm(ModeExecutive::Processing_t p, + int rIndex, int tIndex) const { - mlog << Debug(1) << "Running multivar front end for " << ModeExecutive::stype(p) << "\n"; - - if ( mode_exec ) { delete mode_exec; mode_exec = 0; } - - mode_exec = new ModeExecutive(); - // compress_level = -1; - mode_exec->fcst_file = ffile; - mode_exec->obs_file = ofile; - - mode_exec->match_config_file = config_file; // this is never used - mode_exec->out_dir = output_path; + mode_exec->clear_internal_r_index(); + mode_exec->do_conv_thresh_multivar_simple(p, rIndex, tIndex); + mode_exec->clear_internal_r_index(); +#ifdef WITH_PYTHON + GP.finalize(); + #endif } //////////////////////////////////////////////////////////////////////// void -MultivarFrontEnd::_superobject_mode_algorithm(const ModeSuperObject &fsuper, - const ModeSuperObject &osuper) +MultivarFrontEnd::_create_intensity_comparisons(SimpleObjects &fcsts, int findex, + SimpleObjects &obs, int oindex, + const string &fcst_filename, + const string &obs_filename) { - _mode_algorithm_init(); - mode_exec->clear_internal_r_index(); - mode_exec->do_conv_thresh_multivar_super(); - mode_exec->do_match_merge_multivar(fsuper._merge_sd_split, osuper._merge_sd_split, - ModeExecutive::MULTIVAR_SUPER); - mode_exec->process_output_multivar_super(); - mode_exec->clear_internal_r_index(); -#ifdef WITH_PYTHON - GP.finalize(); - #endif + MultiVarData *mvdf = fcsts._mvd[findex]; + MultiVarData *mvdo = obs._mvd[oindex]; + + // mask the input data to be valid only inside the simple super objects + fcsts._super.mask_data_simple("Fcst", *mvdf); + obs._super.mask_data_simple("Obs", *mvdo); + + // this debug statement assumes fcsts and obs have same conv radius and thresh indices + // which is currently required + mlog << Debug(1) << "\n" << sep + << "\nRunning mvmode intensity comparisions conv_radius[" << fcsts._rIndex+1 + << "] conv_thresh[" << fcsts._tIndex+1 << "]\n" << sep << "\n"; + + _init_exec(ModeExecutive::MULTIVAR_INTENSITY, fcst_filename, obs_filename); + mode_exec->init_multivar_intensities(config); + + ModeConfInfo & conf = mode_exec->engine.conf_info; + conf.set_field_index(findex, oindex); + + // for multivar intensities, explicity set the level and units using stored values + // from pass1 + conf.Fcst->var_info->set_level_name(mvdf->_level.c_str()); + conf.Fcst->var_info->set_units(mvdf->_units.c_str()); + if (fcsts._super._hasUnion && conf.Fcst->merge_flag == MergeType::Thresh) { + mlog << Warning << "\nModeFrontEnd::_create_intensity_comparisons() -> " + << "Logic includes union '||' along with 'merge_flag=THRESH' " + << ". This can lead to bad results\n\n"; + } + conf.Obs->var_info->set_level_name(mvdo->_level.c_str()); + conf.Obs->var_info->set_units(mvdo->_units.c_str()); + if (obs._super._hasUnion && conf.Obs->merge_flag == MergeType::Thresh) { + mlog << Warning << "\nModeFrontEnd::_create_intensity_comparisons() -> " + << "Logic includes union '||' along with 'merge_flag=THRESH' " + << ". This can lead to bad results\n\n"; + } + + // + // set up data access using inputs + // + mode_exec->setup_multivar_fcst_obs_data_intensities(*mvdf, *mvdo); + + // + // run the mode algorithm for multivar intensities + // + _intensity_compare_mode_algorithm(fcsts._rIndex, fcsts._tIndex, obs._rIndex, obs._tIndex, *mvdf, *mvdo, + fcsts._super, obs._super); + + delete mode_exec; mode_exec = nullptr; } //////////////////////////////////////////////////////////////////////// void -MultivarFrontEnd::_intensity_compare_mode_algorithm(const MultiVarData &mvdf, +MultivarFrontEnd::_intensity_compare_mode_algorithm(int rIndexF, int tIndexF, + int rIndexO, int tIndexO, + const MultiVarData &mvdf, const MultiVarData &mvdo, const ModeSuperObject &fsuper, const ModeSuperObject &osuper) { - _mode_algorithm_init(); - mode_exec->do_conv_thresh_multivar_intensity_compare(); + mode_exec->do_conv_thresh_multivar_intensity_compare(rIndexF, tIndexF, rIndexO, tIndexO); mode_exec->do_match_merge_multivar(fsuper._merge_sd_split, osuper._merge_sd_split, ModeExecutive::MULTIVAR_INTENSITY); // here replace raw data and min/max for plotting @@ -707,16 +671,62 @@ MultivarFrontEnd::_intensity_compare_mode_algorithm(const MultiVarData &mvdf, #endif } +//////////////////////////////////////////////////////////////////////// + +void MultivarFrontEnd::_process_superobjects(SimpleObjects &fcsts, SimpleObjects &obs) +{ + mlog << Debug(1) << "\n" << sep + << "\nRunning mvmode superobject analysis conv_radius[" << fcsts._rIndex+1 + << "] conv_thresh[" << fcsts._tIndex+1 << "]\n" << sep << "\n"; + + const MultiVarData *mvdf = fcsts._mvd[0]; + const MultiVarData *mvdo = obs._mvd[0]; + + // set the data to 0 inside superobjects and missing everywhere else + + fcsts._super.mask_data_super("FcstSimple", *mvdf); + obs._super.mask_data_super("ObsSimple", *mvdo); + + _init_exec(ModeExecutive::MULTIVAR_SUPER, "None", "None"); + mode_exec->init_multivar_intensities(config); + + const ModeConfInfo & conf = mode_exec->engine.conf_info; + if ((fcsts._super._hasUnion || obs._super._hasUnion) && + (conf.Fcst->merge_flag == MergeType::Thresh || + conf.Obs->merge_flag == MergeType::Thresh)) { + mlog << Warning << "\nModeFrontEnd::_process_superobjects() -> " + << "Logic includes union '||' along with 'merge_flag=THRESH' " + << ". This can lead to bad results\n\n"; + } + + // + // set up data access using inputs + // + mode_exec->setup_multivar_fcst_obs_data_super(fcsts._super._simple_sd, obs._super._simple_sd, + *(mvdf->_grid)); + + // run the mode algorithm + _superobject_mode_algorithm(fcsts._rIndex, fcsts._tIndex, obs._rIndex, obs._tIndex, + fcsts._super, obs._super); + + delete mode_exec; mode_exec = nullptr; +} //////////////////////////////////////////////////////////////////////// -void MultivarFrontEnd::_simple_mode_algorithm(ModeExecutive::Processing_t p) +void +MultivarFrontEnd::_superobject_mode_algorithm(int rIndexF, int tIndexF, + int rIndexO, int tIndexO, + const ModeSuperObject &fsuper, + const ModeSuperObject &osuper) + { - _mode_algorithm_init(); mode_exec->clear_internal_r_index(); - mode_exec->do_conv_thresh_multivar_simple(p); + mode_exec->do_conv_thresh_multivar_super(rIndexF, tIndexF, rIndexO, tIndexO); + mode_exec->do_match_merge_multivar(fsuper._merge_sd_split, osuper._merge_sd_split, + ModeExecutive::MULTIVAR_SUPER); + mode_exec->process_output_multivar_super(); mode_exec->clear_internal_r_index(); - #ifdef WITH_PYTHON GP.finalize(); #endif @@ -724,36 +734,20 @@ void MultivarFrontEnd::_simple_mode_algorithm(ModeExecutive::Processing_t p) //////////////////////////////////////////////////////////////////////// -void MultivarFrontEnd::_mode_algorithm_init() const +void MultivarFrontEnd::_init_exec(ModeExecutive::Processing_t p, + const string &ffile, + const string &ofile) const { - const ModeConfInfo & conf = mode_exec->engine.conf_info; - if ( conf.quilt ) { - mlog << Error << "\nMultiVarFontend::mode_algorithm() -> " - << "quilting not yet implemented for multivar mode \n\n"; - exit ( 1 ); - } - - int NCT = conf.n_conv_threshs(); - int NCR = conf.n_conv_radii(); + mlog << Debug(4) << "Running multivar front end for " << ModeExecutive::stype(p) << "\n"; - if ( NCT != NCR ) { - - mlog << Error << "\nMultivarFrontEnd::_mode_algorithm_init() ->" - << "all convolution radius and threshold arrays must have the same number of elements\n\n"; - - exit ( 1 ); + if ( mode_exec ) { delete mode_exec; mode_exec = nullptr; } - } - - if (NCT > 1) { - - mlog << Error << "\nMultivarFrontEnd::_mode_algorithm_init() ->" - << ": multiple convolution radii and thresholds not implemented in multivar mode\n\n"; + mode_exec = new ModeExecutive(); + mode_exec->fcst_file = ffile; + mode_exec->obs_file = ofile; - exit ( 1 ); - } + mode_exec->match_config_file = config_file; // this is never used + mode_exec->out_dir = output_path; } - - diff --git a/src/tools/core/mode/multivar_frontend.h b/src/tools/core/mode/multivar_frontend.h index f4c78c243d..80cd475660 100644 --- a/src/tools/core/mode/multivar_frontend.h +++ b/src/tools/core/mode/multivar_frontend.h @@ -20,6 +20,7 @@ #include "two_d_array.h" #include "bool_calc.h" #include "multivar_data.h" +#include "simple_objects.hh" #include "mode_superobject.h" #include "mode_input_data.h" #include "mode_exec.h" @@ -31,27 +32,49 @@ class MultivarFrontEnd { int n_fcst_files, n_obs_files; StringArray fcst_filenames; StringArray obs_filenames; - BoolCalc f_calc, o_calc ; - std::vector fcstInput, obsInput; - std::vector mvdFcst, mvdObs; + BoolCalc f_calc; + BoolCalc o_calc; + std::vector fcstInput; + std::vector obsInput; + std::vector mvdFcst; + std::vector mvdObs; std::string fcst_fof; std::string obs_fof; + void _init(const StringArray & Argv); void _process_command_line(const StringArray &); void _read_config(const std::string & filename); void _setup_inputs(); void _set_output_path(); - int _mkdir(const char *dir); - void _simple_objects(ModeExecutive::Processing_t p, ModeDataType dtype, - int j, int n_files, const std::string &filename, - const ModeInputData &input); - void _init_exec(ModeExecutive::Processing_t p, const std::string &ffile, const std::string &ofile); - void _superobject_mode_algorithm(const ModeSuperObject &fsuper, const ModeSuperObject &osuper); - void _intensity_compare_mode_algorithm(const MultiVarData &mvdf, const MultiVarData &mvdo, + int _mkdir(const char *dir) const; + void _read_input(const std::string &name, int index, ModeDataType type, + GrdFileType f_t, GrdFileType other_t, int shift); + void _create_verif_grid(void); + + void _create_simple_objects(ModeDataType dtype, const std::string &name, + int rIndex, int tIndex, int n_files, + const StringArray &filenames, const std::vector &input, + BoolCalc &calc, SimpleObjects &O) const; + MultiVarData *_create_simple_multivar_data(ModeDataType dtype, int rIndex, int tIndex, + int j, int n_files, const std::string &filename, + const ModeInputData &input) const; + void _simple_objects(ModeExecutive::Processing_t p, ModeDataType dtype, int rIndex, + int tIndex, int j, int n_files, const std::string &filename, + const ModeInputData &input) const; + void _simple_mode_algorithm(ModeExecutive::Processing_t p, int rIndex, int tIndex) const; + + void _create_intensity_comparisons(SimpleObjects &fcsts, int findex, SimpleObjects &obs, int oindex, + const string &fcst_filename, const string &obs_filename); + void _intensity_compare_mode_algorithm(int rIndexF, int tIndexF, int rIndexO, int tIndexO, + const MultiVarData &mvdf, const MultiVarData &mvdo, const ModeSuperObject &fsuper, const ModeSuperObject &osuper); - void _simple_mode_algorithm(ModeExecutive::Processing_t p); - void _mode_algorithm_init() const; + void _process_superobjects(SimpleObjects &fcsts, SimpleObjects &obs); + void _superobject_mode_algorithm(int rIndexF, int tIndexF, int rIndexO, int tIndexO, + const ModeSuperObject &fsuper, const ModeSuperObject &osuper); + + void _init_exec(ModeExecutive::Processing_t p, const std::string &ffile, const std::string &ofile) const; + public: bool do_clusters; @@ -66,37 +89,13 @@ class MultivarFrontEnd { ~MultivarFrontEnd(); - int run(const StringArray & Argv); - void init(const StringArray & Argv); static void set_outdir (const StringArray &); static void set_logfile (const StringArray &); static void set_verbosity (const StringArray &); static void set_compress (const StringArray &); - void read_input(const std::string &name, int index, ModeDataType type, - GrdFileType f_t, GrdFileType other_t, int shift); - - - void create_verif_grid(void); - - MultiVarData *create_simple_objects(ModeDataType dtype, int j, int n_files, - const std::string &filename, - const ModeInputData &input); - - void create_intensity_comparisons(int findex, int oindex, - const ModeSuperObject &fsuper, - const ModeSuperObject &osuper, - MultiVarData &mvdf, MultiVarData &mvdo, - const std::string &fcst_filename, - const std::string &obs_filename); - - void process_superobjects(ModeSuperObject &fsuper, - ModeSuperObject &osuper, - const MultiVarData &mvdf, - const MultiVarData &mvdo); - }; diff --git a/src/tools/core/mode/simple_objects.cc b/src/tools/core/mode/simple_objects.cc new file mode 100644 index 0000000000..a7ebd1ef76 --- /dev/null +++ b/src/tools/core/mode/simple_objects.cc @@ -0,0 +1,58 @@ +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* +// ** Copyright UCAR (c) 1992 - 2024 +// ** University Corporation for Atmospheric Research (UCAR) +// ** National Center for Atmospheric Research (NCAR) +// ** Research Applications Lab (RAL) +// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* + + +//////////////////////////////////////////////////////////////////////// + +#include "simple_objects.hh" + +using namespace std; + +//////////////////////////////////////////////////////////////////////// + +SimpleObjects::SimpleObjects() : + _dataType(ModeDataType::MvMode_Both), + _rIndex(-1), + _tIndex(-1) +{ +} + +//////////////////////////////////////////////////////////////////////// + +SimpleObjects::~SimpleObjects() +{ +} + +//////////////////////////////////////////////////////////////////////// + +void SimpleObjects::init(ModeDataType dataType, int rIndex, int tIndex) +{ + _dataType = dataType; + _rIndex = rIndex; + _tIndex = tIndex; +} + +//////////////////////////////////////////////////////////////////////// + +void SimpleObjects::setSuper(bool isFcst, int n_fcst_files, bool do_clusters, + BoolCalc &f_calc) +{ + _super = ModeSuperObject(isFcst, n_fcst_files, do_clusters, + _rIndex, _tIndex, _mvd, f_calc); +} + +//////////////////////////////////////////////////////////////////////// + +void SimpleObjects::clear(void) +{ + for (auto &x : _mvd) { + delete x; + x = nullptr; + } + _mvd.clear(); +} diff --git a/src/tools/core/mode/simple_objects.hh b/src/tools/core/mode/simple_objects.hh new file mode 100644 index 0000000000..7215a05336 --- /dev/null +++ b/src/tools/core/mode/simple_objects.hh @@ -0,0 +1,46 @@ +// ** Copyright UCAR (c) 1992 - 2024 +// ** University Corporation for Atmospheric Research (UCAR) +// ** National Center for Atmospheric Research (NCAR) +// ** Research Applications Lab (RAL) +// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA +// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* + + +//////////////////////////////////////////////////////////////////////// + + +#ifndef __SIMPLE_OBJECTS_H__ +#define __SIMPLE_OBJECTS_H__ + + +//////////////////////////////////////////////////////////////////////// + + +#include +#include +#include "multivar_data.h" +#include "mode_superobject.h" +#include "bool_calc.h" + +class SimpleObjects { + + public: + + SimpleObjects(); + ~SimpleObjects(); + + void init(ModeDataType dataType, int rIndex, int tIndex); + void setSuper(bool isFcst, int n_fcst_files, bool do_clusters, BoolCalc &f_calc); + void clear(void); + + ModeDataType _dataType; /**< observations or forecasts */ + int _rIndex; /**< Convolution radius index */ + int _tIndex; /**< Convolution threshold index */ + std::vector _mvd; /**< The data from each input */ + ModeSuperObject _super; /**< The superobject created from the data */ +}; + +#endif /* __MODE_FRONT_END_H__ */ + + +/////////////////////////////////////////////////////////////////////////