VLab Issue #4001 - NCEP EDEX and EDEX Common delivery for 14.2.1-n

GRIB config, TCM fix, and PWAT calculation for soundings

Change-Id: Ic46db6f57da1446de27693ef3d00c664af6a7431

Former-commit-id: dc8043bf03 [formerly 327f39109e] [formerly af9384d8d7 [formerly 598d22b0c943c5de9fc9ab3a56cde717c374fdfe]]
Former-commit-id: af9384d8d7
Former-commit-id: de62c1fa88
This commit is contained in:
Stephen Gilbert 2014-08-11 15:47:57 -04:00
parent bac8dfe2f6
commit 432f0ec253
10 changed files with 1116 additions and 773 deletions

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<lambertConformalGridCoverage>
<name>17991059001</name>
<description>3 km LCC limited domain CONUS grid (used by HRRR)</description>
<la1>21.138</la1>
<lo1>-122.72</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>1799</nx>
<ny>1059</ny>
<dx>3.0</dx>
<dy>3.0</dy>
<spacingUnit>km</spacingUnit>
<minorAxis>6371229.0</minorAxis>
<majorAxis>6371229.0</majorAxis>
<lov>-97.5</lov>
<latin1>38.5</latin1>
<latin2>38.5</latin2>
</lambertConformalGridCoverage>

View file

@ -1094,6 +1094,16 @@
</process>
</model>
<model>
<name>hrrr</name>
<center>7</center>
<subcenter>0</subcenter>
<grid>17991059001</grid>
<process>
<id>83</id>
</process>
</model>
<model>
<name>RTMA</name>
<center>7</center>

View file

@ -211,6 +211,7 @@
<alias base="MCDC">CLDM</alias>
<alias base="MIXR">MIXR</alias>
<alias base="MMSP">MMSL</alias>
<alias base="MN2T66hr">TKMN06</alias>
<alias base="MnT">TMNK</alias>
<alias base="MnT1hr">TMNK01</alias>
<alias base="MnT3hr">TMNK03</alias>
@ -220,6 +221,7 @@
<alias base="MnT18hr">TMNK18</alias>
<alias base="MnT24hr">TMNK24</alias>
<alias base="MnT48hr">TMNK48</alias>
<alias base="MX2T66hr">TKMX06</alias>
<alias base="MxT">TMXK</alias>
<alias base="MxT1hr">TMXK01</alias>
<alias base="MxT3hr">TMXK03</alias>
@ -303,6 +305,7 @@
<alias base="TCC18hr">TCLD18</alias>
<alias base="TCC24hr">TCLD24</alias>
<alias base="TCC48hr">TCLD48</alias>
<alias base="TCWAT">TCWTR</alias>
<alias base="ThP">TSTM</alias>
<alias base="TOZNE">TOZO</alias>
<alias base="TP">APCP</alias>

View file

@ -23,6 +23,7 @@ import java.util.Map;
* ----------- ---------- ---------- --------------------------
* 05/14/2013 #989 qzhou Initial Creation
* 06/23/2014 R4152 qzhou Touched up 3 functions
* 07/22/2014 R4152 qzhou Fixed getMedian. This func. is uesd very rare if ever
* </pre>
*
* @author qzhou
@ -534,11 +535,10 @@ public class CalcUtil {
// remove missing data
List<Float> newArray = new ArrayList<Float>();
for (int k = 0; k < arraySort.length - 1; k++)
for (int k = 0; k < arraySort.length; k++) {
if (arraySort[k] != MISSING_VAL)
newArray.add(arraySort[k]);
else
break; // to sorted arraySort
}
int size = newArray.size();
if (size % 2 == 0)

View file

@ -1,4 +1,5 @@
package gov.noaa.nws.ncep.edex.common.sounding;
/**
*
* gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile
@ -18,13 +19,13 @@ package gov.noaa.nws.ncep.edex.common.sounding;
* 09/14/2011 457 S. Gurung Renamed ObsSndType.H5UAIR to ObsSndType.NCUAIR
*10/06/2011 465 Archana Added a list of NcSoundingLayer2 objects to the sounding profile
* 02/15/2012 Chin Chen added fcsTime to support pfc sounding query
* 07/23/2014 Chin Chen Support PW
* </pre>
*
* @author Chin Chen
* @version 1.0
*/
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@ -35,10 +36,11 @@ import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class NcSoundingProfile implements ISerializableObject{
public class NcSoundingProfile implements ISerializableObject {
/**
*
*/
@ -46,24 +48,32 @@ public class NcSoundingProfile implements ISerializableObject{
@DynamicSerializeElement
public static final float MISSING = -9999.f;
public static enum PfcSndType {
NAMSND, GFSSND, RUC2SND, RUCPTYPSND, BROWSE, NONE
};
public static enum MdlSndType {
ANY, NONE
};
public static enum ObsSndType {
NCUAIR, UAIR, DROP, TAMDAR, BUFRUA //same as uair but using bufrua decoder and data is saved in HDF5
,BROWSE, NONE
NCUAIR, UAIR, DROP, TAMDAR, BUFRUA // same as uair but using bufrua
// decoder and data is saved in HDF5
, BROWSE, NONE
};
//Important Note:
//Chin: definition is based on UAIR record. stnid is string of character, stnnum is string of number
//BUFRUA has different definition. stnid is string of number which is stnnum in UAIR,
//and stnname is string of character which is stnid in UAIR..
//type conversion is done at BUFRUA code.
// Important Note:
// Chin: definition is based on UAIR record. stnid is string of character,
// stnnum is string of number
// BUFRUA has different definition. stnid is string of number which is
// stnnum in UAIR,
// and stnname is string of character which is stnid in UAIR..
// type conversion is done at BUFRUA code.
public static enum SndQueryKeyType {
LATLON, STNID, STNNUM, NONE
};
@DynamicSerializeElement
private List<NcSoundingLayer> soundingLyLst;
@ -72,12 +82,15 @@ public class NcSoundingProfile implements ISerializableObject{
@DynamicSerializeElement
private float stationElevation;
//@DynamicSerializeElement
//private String stationId;
// @DynamicSerializeElement
// private String stationId;
@DynamicSerializeElement
private double stationLatitude;
@DynamicSerializeElement
private double stationLongitude;
@DynamicSerializeElement
private float sfcPress;
@ -93,6 +106,9 @@ public class NcSoundingProfile implements ISerializableObject{
@DynamicSerializeElement
private NcSoundingCube.QueryStatus rtnStatus = NcSoundingCube.QueryStatus.OK;
// Support PW
@DynamicSerializeElement
private float pw = -1;
public NcSoundingCube.QueryStatus getRtnStatus() {
return rtnStatus;
@ -118,7 +134,6 @@ public class NcSoundingProfile implements ISerializableObject{
this.stationNum = stnNum;
}
public long getFcsTime() {
return fcsTime;
}
@ -143,7 +158,8 @@ public class NcSoundingProfile implements ISerializableObject{
}
/**
* @param soundingLyLst2 the soundingLyLst2 to set
* @param soundingLyLst2
* the soundingLyLst2 to set
*/
public void setSoundingLyLst2(List<NcSoundingLayer2> soundingLyLst2) {
this.soundingLyLst2 = soundingLyLst2;
@ -157,7 +173,6 @@ public class NcSoundingProfile implements ISerializableObject{
this.stationElevation = stationElevation;
}
public double getStationLatitude() {
return stationLatitude;
}
@ -188,9 +203,9 @@ public class NcSoundingProfile implements ISerializableObject{
// TO-DO: Add station number (stationNumber)
public NcSoundingProfile(List<NcSoundingLayer2> soundingLyLst2,
List<NcSoundingLayer> soundingLyLst,
float stationElevation, String stationId, float stationLatitude,
float stationLongitude, float sfcPress, int stnNum) {
List<NcSoundingLayer> soundingLyLst, float stationElevation,
String stationId, float stationLatitude, float stationLongitude,
float sfcPress, int stnNum) {
super();
this.soundingLyLst2 = soundingLyLst2;
this.soundingLyLst = soundingLyLst;
@ -211,44 +226,36 @@ public class NcSoundingProfile implements ISerializableObject{
this.stationLatitude = MISSING;
this.stationLongitude = MISSING;
this.sfcPress = MISSING;
this.stationNum= 0;
this.stationNum = 0;
}
public float getPw() {
return pw;
}
public void setPw(float pw) {
this.pw = pw;
}
/*
@Override
protected AbstractStorageRecord cloneInternal() {
// TODO Auto-generated method stub
System.out.println("NcSoundingProfile cloneInternal()");
return null;
}
@Override
public Object getDataObject() {
// TODO Auto-generated method stub
System.out.println("NcSoundingProfile getDataObject()");
return null;
}
@Override
public int getSizeInBytes() {
// TODO Auto-generated method stub
System.out.println("NcSoundingProfile getSizeInBytes()");
return 0;
}
@Override
public void reduce(int[] indices) {
// TODO Auto-generated method stub
System.out.println("NcSoundingProfile ()");
}
@Override
public boolean validateDataSet() {
// TODO Auto-generated method stub
System.out.println("NcSoundingProfile validateDataSet()");
return false;
}
* @Override protected AbstractStorageRecord cloneInternal() { // TODO
* Auto-generated method stub
* System.out.println("NcSoundingProfile cloneInternal()"); return null; }
*
* @Override public Object getDataObject() { // TODO Auto-generated method
* stub System.out.println("NcSoundingProfile getDataObject()"); return
* null; }
*
* @Override public int getSizeInBytes() { // TODO Auto-generated method
* stub System.out.println("NcSoundingProfile getSizeInBytes()"); return 0;
* }
*
* @Override public void reduce(int[] indices) { // TODO Auto-generated
* method stub System.out.println("NcSoundingProfile ()"); }
*
* @Override public boolean validateDataSet() { // TODO Auto-generated
* method stub System.out.println("NcSoundingProfile validateDataSet()");
* return false; }
*/
}

View file

@ -0,0 +1,177 @@
package gov.noaa.nws.ncep.edex.common.sounding;
import java.util.List;
/**
*
* gov.noaa.nws.ncep.edex.common.sounding.NcSoundingTools
*
* This code has been developed by the SIB for use in the AWIPS2 system.
*
* <pre>
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------- ------- -------- -----------
* 07/24/2014 Chin Chen Initial coding
* Support PW computation
*
*
* </pre>
*
* @author Chin Chen
* @version 1.0
*/
public class NcSoundingTools {
/*************************************************************
* PRECIP_WATER Calculates the Precipitation Water in mm from Bottom level
* of layer (mb) to Top level of layer (mb)
*************************************************************/
public static float precip_water(List<NcSoundingLayer> sndlayers) {
float pw = 0;
float d1, p1, d2, p2, tot, w1, w2, wbar;
// ----- Start with interpolated bottom layer -----
// find surface layer or first layer with valid dewpoint
int sfcIndex = 0;
for (int i = 0; i < sndlayers.size(); i++) {
if (sndlayers.get(i).getDewpoint() != -9999f) {
sfcIndex = i;
break;
}
}
d1 = sndlayers.get(sfcIndex).getDewpoint(); // dewp
// in
// C
p1 = sndlayers.get(sfcIndex).getPressure(); // pressure
// n
// mb
tot = 0;
for (int i = sfcIndex + 1; i < sndlayers.size(); i++) {
/* ----- Calculate every level that reports a dwpt ----- */
d2 = sndlayers.get(i).getDewpoint(); // dewp
// in C
if (d2 == -9999f)
continue;
p2 = sndlayers.get(i).getPressure(); // pressure
// n mb
w1 = mixingRatio(d1, p1);
w2 = mixingRatio(d2, p2);
wbar = (w1 + w2) / 2;
tot = tot + wbar * (p1 - p2);
// System.out.println("p1=" + p1 + " d1=" + d1 + " p2=" + p2 +
// " d2="
// + d2);
d1 = d2;
p1 = p2;
// test the case when top level is 400 mb
// if (p2 == 400)
// break;
}
/* ----- Convert to mm (from g*mb/kg) ----- */
pw = tot * 0.00040173f * 25.4f;
return pw;
}
public static float precip_water2(List<NcSoundingLayer2> sndlayers) {
float pw = 0;
float d1, p1, d2, p2, tot, w1, w2, wbar;
// ----- Start with interpolated bottom layer -----
// find surface layer or first layer with valid dewpoint
int sfcIndex = 0;
for (int i = 0; i < sndlayers.size(); i++) {
if (sndlayers.get(i).getDewpoint().getValue().floatValue() != -9999f) {
sfcIndex = i;
break;
}
}
d1 = sndlayers.get(sfcIndex).getDewpoint().getValue().floatValue(); // dewp
// in
// C
p1 = sndlayers.get(sfcIndex).getPressure().getValue().floatValue(); // pressure
// n
// mb
tot = 0;
for (int i = sfcIndex + 1; i < sndlayers.size(); i++) {
/* ----- Calculate every level that reports a dwpt ----- */
d2 = sndlayers.get(i).getDewpoint().getValue().floatValue(); // dewp
// in C
if (d2 == -9999f)
continue;
p2 = sndlayers.get(i).getPressure().getValue().floatValue(); // pressure
// n mb
w1 = mixingRatio(d1, p1);
w2 = mixingRatio(d2, p2);
wbar = (w1 + w2) / 2;
tot = tot + wbar * (p1 - p2);
d1 = d2;
p1 = p2;
// test the case when top level is 400 mb
// if (p2 == 400)
// break;
}
/* ----- Convert to mm (from g*mb/kg) ----- */
pw = tot * 0.00040173f * 25.4f;
return pw;
}
/*
* Compute mixing ratio from DWPC and PRES. Chin: copy from
* gov.noaa.nws.ncep.edex.uengine.tasks.profile.MergeSounding
*/
private static float mixingRatio(float td, float pres) {
float vapr = vaporPressure(td);
float corr = (1.001f + ((pres - 100.f) / 900.f) * .0034f);
float e = corr * vapr;
if (e > (.5f * pres)) {
return -9999f;
} else {
return .62197f * (e / (pres - e)) * 1000.f;
}
}
/*
* Compute vapor pressure from DWPC. Chin: copy from
* gov.noaa.nws.ncep.edex.uengine.tasks.profile.MergeSounding
*/
private static float vaporPressure(float td) {
return (6.112f * (float) Math.exp((17.67 * td) / (td + 243.5)));
}
// The followings are converted from BigSharp, the computation results are
// about the same as above methods.
// private static float mixratio(float pres, float temp)
//
// {
// float x, wfw, fwesw;
//
// x = 0.02f * (temp - 12.5f + 7500.0f / pres);
// wfw = 1.0f + 0.0000045f * pres + 0.0014f * x * x;
// fwesw = wfw * vappres(temp);
// return 621.97f * (fwesw / (pres - fwesw));
// }
//
// private static float vappres(float temp)
//
// {
// double pol;
// pol = temp * (1.1112018e-17 + temp * (-3.0994571e-20));
// pol = temp * (2.1874425e-13 + temp * (-1.789232e-15 + pol));
// pol = temp * (4.3884180e-09 + temp * (-2.988388e-11 + pol));
// pol = temp * (7.8736169e-05 + temp * (-6.111796e-07 + pol));
// pol = .99999683e-00 + temp * (-9.082695e-03 + pol);
// pol = (pol * pol);
// pol = (pol * pol);
// return (6.1078f / (float) (pol * pol));
// }
}

View file

@ -4,6 +4,7 @@
* Date Ticket# Engineer Description
* __________ _______ __________ __________________________
* 10/12/2011 126 G. Hull Initial Creation
* 07/30/2014 B. Hebbard Add refTime parameter
-->
<pointDataDbDescription>
<parameter name="latitude" queryName="location.latitude" type="FLOAT" unit="°" />
@ -13,4 +14,5 @@
<parameter name="stationName" queryName="location.stationId" type="STRING" />
<parameter name="reportType" queryName="reportType" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
<parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/>
</pointDataDbDescription>

View file

@ -12,6 +12,7 @@
* 06/2009 128 T. Lee Creation
* 07/2009 128 T. Lee Migrated to TO11
* 06/2010 128 T. Lee Migrated to TO11DR11
* 07/2014 T. Lee Enhanced DM for Atlantic Basin
* </pre>
*
* @author T.Lee
@ -20,28 +21,37 @@
package gov.noaa.nws.ncep.edex.plugin.tcm.util;
import gov.noaa.nws.ncep.common.dataplugin.tcm.TcmRecord;
import gov.noaa.nws.ncep.common.dataplugin.tcm.TcmPositionWinds;
import gov.noaa.nws.ncep.common.dataplugin.tcm.TcmRecord;
import gov.noaa.nws.ncep.edex.util.UtilN;
import java.util.Calendar;
import java.util.Scanner;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.edex.wmo.message.WMOHeader;
import com.raytheon.uf.common.time.DataTime;
import gov.noaa.nws.ncep.edex.util.UtilN;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.edex.wmo.message.WMOHeader;
public class TcmParser {
private static Scanner sc = null;
private final Log logger = LogFactory.getLog(getClass());
int basin;
static MatchResult result;
boolean forecast;
Calendar save_time = null;
String TPC = "MIAMI FL\\s+(AL|EP)(\\d{2})(\\d{4})";
String CPHC = "HONOLULU HI\\s+(EP|CP)(\\d{2})(\\d{4})";
/**
@ -53,10 +63,11 @@ public class TcmParser {
/**
* Decode TCM report
*
* @param bull the bulletin message
* @param bull
* the bulletin message
* @param record
*/
public void processTcm (String bull, TcmRecord record) {
public void processTcm(String bull, TcmRecord record) {
int basin;
forecast = false;
String bull_partA, bull_partB;
@ -72,27 +83,30 @@ public class TcmParser {
/*
* TPC header.
*/
Pattern pt_tpc = Pattern.compile (TPC);
Pattern pt_tpc = Pattern.compile(TPC);
Matcher mt_tpc = pt_tpc.matcher(bull);
/*
* Central Pacific header.
*/
Pattern pt_cphc = Pattern.compile (CPHC);
Pattern pt_cphc = Pattern.compile(CPHC);
Matcher mt_cphc = pt_cphc.matcher(bull);
try {
if (bull.contains(JTWC) || mt_jtwc.find()) {
bull_partA = bull.substring(0,bull.indexOf("FORECASTS:"));
bull_partB = bull.substring(bull.indexOf("FORECASTS:"),bull.length());
bull_partA = bull.substring(0, bull.indexOf("FORECASTS:"));
bull_partB = bull.substring(bull.indexOf("FORECASTS:"),
bull.length());
sc = new Scanner(bull_partA);
basin = 2;
} else {
try {
bull_partA = bull.substring(0,bull.indexOf("FORECAST VALID"));
bull_partB = bull.substring(bull.indexOf("FORECAST VALID"),bull.length());
bull_partA = bull.substring(0,
bull.indexOf("FORECAST VALID"));
bull_partB = bull.substring(bull.indexOf("FORECAST VALID"),
bull.length());
sc = new Scanner(bull_partA);
} catch (Exception e){
} catch (Exception e) {
bull_partA = bull;
bull_partB = null;
sc = new Scanner(bull);
@ -102,14 +116,14 @@ public class TcmParser {
} else if (mt_cphc.find()) {
basin = 1;
} else {
throw new Exception (" Could not find forecast center!!");
throw new Exception(" Could not find forecast center!!");
}
}
/*
* Find and decode storm ID, name and advisory number.
*/
processStormAttr(basin,record);
processStormAttr(basin, record);
/*
* Find and set correction.
@ -120,10 +134,10 @@ public class TcmParser {
* New TcmPositionWind record to hold current values
*/
TcmPositionWinds current = new TcmPositionWinds();
Calendar cal=null;
Calendar cal = null;
if (basin == 2) {
cal = (Calendar)record.getIssueTime().clone();
processLocationTime(basin,current,record,cal);
cal = (Calendar) record.getIssueTime().clone();
processLocationTime(basin, current, record, cal);
}
/*
@ -136,12 +150,12 @@ public class TcmParser {
/*
* Find and decode storm motion.
*/
processStormMotion(basin,forecast,current);
processStormMotion(basin, forecast, current);
/*
* Find and decode position accuracy.
*/
if (basin==2) {
if (basin == 2) {
processPositionAccuracy(record);
}
@ -156,22 +170,22 @@ public class TcmParser {
/*
* Find and decode current wind speed and gusts.
*/
processMaxWind(basin,forecast,current);
processMaxWind(basin, forecast, current);
/*
* Find and decode current 64 knot wind radii.
*/
processRadii64(basin,forecast,current);
processRadii64(basin, forecast, current);
/*
* Find and decode current 50 knot wind radii.
*/
processRadii50(basin,forecast,current);
processRadii50(basin, forecast, current);
/*
* Find and decode current 34 knot wind radii.
*/
processRadii34(basin,forecast,current);
processRadii34(basin, forecast, current);
/*
* Find and decode 12-ft seas.
@ -184,8 +198,8 @@ public class TcmParser {
* Find and decode storm location
*/
if (basin == 1) {
cal = (Calendar)record.getIssueTime().clone();
processLocationTime(basin,current,record,cal);
cal = (Calendar) record.getIssueTime().clone();
processLocationTime(basin, current, record, cal);
}
record.addPosWinds(current);
@ -194,17 +208,16 @@ public class TcmParser {
*/
if (basin == 1) {
TcmPositionWinds past = new TcmPositionWinds();
cal = (Calendar)record.getIssueTime().clone();
processLocationTime(past,record,cal);
cal = (Calendar) record.getIssueTime().clone();
processLocationTime(past, record, cal);
record.addPosWinds(past);
}
/*
* Decode forecast message.
*/
processTcmForecasts(basin,bull_partB,record);
}
catch (Exception e) {
processTcmForecasts(basin, bull_partB, record);
} catch (Exception e) {
logger.info("Error in parsing TCM !!");
}
}
@ -217,9 +230,9 @@ public class TcmParser {
* @param mndTime
*/
public void processWMO(byte[] wmohd, TcmRecord record, Calendar mndTime) {
WMOHeader hd = new WMOHeader (wmohd);
Calendar issueTime = UtilN.findDataTime(hd.getYYGGgg(),mndTime);
DataTime dt = new DataTime (issueTime);
WMOHeader hd = new WMOHeader(wmohd);
Calendar issueTime = UtilN.findDataTime(hd.getYYGGgg(), mndTime);
DataTime dt = new DataTime(issueTime);
if (wmohd != null) {
record.setIssueTime(issueTime);
record.setDataTime(dt);
@ -229,7 +242,8 @@ public class TcmParser {
/**
* Process storm motion
*
* @param ocean basin
* @param ocean
* basin
* @param TcmPositionWinds
*/
public void processStormAttr(int basin, TcmRecord record) {
@ -254,34 +268,30 @@ public class TcmParser {
* Atlantic/Central Pacific scenarios
*/
try {
if (sc.findWithinHorizon(HU,0) != null) {
record.setStormType ("HURRICANE");
}
else if (sc.findWithinHorizon(TS,0) != null) {
record.setStormType ("TROPICAL STORM");
}
else if (sc.findWithinHorizon(TC,0) != null) {
record.setStormType ("TROPICAL CYCLONE");
}
else if (sc.findWithinHorizon(TD,0) != null) {
record.setStormType ("TROPICAL DEPRESSION");
}
else if (sc.findWithinHorizon(TD_SP,0) != null) {
record.setStormType ("TROPICAL DEPRESSION SPECIAL");
if (sc.findWithinHorizon(HU, 0) != null) {
record.setStormType("HURRICANE");
} else if (sc.findWithinHorizon(TS, 0) != null) {
record.setStormType("TROPICAL STORM");
} else if (sc.findWithinHorizon(TC, 0) != null) {
record.setStormType("TROPICAL CYCLONE");
} else if (sc.findWithinHorizon(TD, 0) != null) {
record.setStormType("TROPICAL DEPRESSION");
} else if (sc.findWithinHorizon(TD_SP, 0) != null) {
record.setStormType("TROPICAL DEPRESSION SPECIAL");
/*
* NW Pacific scenarios
*/
} else if (sc.findWithinHorizon(SUPER_TY,0) != null) {
record.setStormType ("SUPER TYPHOON");
} else if (sc.findWithinHorizon(TY,0) != null) {
record.setStormType ("TYPHOON");
} else if (sc.findWithinHorizon(TC_WP,0) != null) {
record.setStormType ("TROPICAL CYCLONE");
} else if (sc.findWithinHorizon(TS_WP,0) != null) {
record.setStormType ("TROPICAL STORM");
} else if (sc.findWithinHorizon(TD_WP,0) != null) {
record.setStormType ("TROPICAL DEPRESSION");
} else if (sc.findWithinHorizon(SUPER_TY, 0) != null) {
record.setStormType("SUPER TYPHOON");
} else if (sc.findWithinHorizon(TY, 0) != null) {
record.setStormType("TYPHOON");
} else if (sc.findWithinHorizon(TC_WP, 0) != null) {
record.setStormType("TROPICAL CYCLONE");
} else if (sc.findWithinHorizon(TS_WP, 0) != null) {
record.setStormType("TROPICAL STORM");
} else if (sc.findWithinHorizon(TD_WP, 0) != null) {
record.setStormType("TROPICAL DEPRESSION");
} else {
throw new Exception("Could not find storm attributes!");
}
@ -291,24 +301,24 @@ public class TcmParser {
result = sc.match();
if (basin == 1) {
record.setStormName (result.group(1));
record.setAdvisoryNumber (result.group(2));
record.setStormName(result.group(1));
record.setAdvisoryNumber(result.group(2));
/*
* Find and decode storm name and basin.
*/
if (sc.findWithinHorizon(TPC,0) != null ||
sc.findWithinHorizon(CPHC,0) != null) {
if (sc.findWithinHorizon(TPC, 0) != null
|| sc.findWithinHorizon(CPHC, 0) != null) {
result = sc.match();
record.setBasin (result.group(1));
record.setStormNumber (result.group(2));
record.setBasin(result.group(1));
record.setStormNumber(result.group(2));
}
} else if (basin == 2) {
record.setStormNumber (result.group(1));
record.setStormName (result.group(2));
record.setAdvisoryNumber (result.group(3));
record.setBasin ("WP");
record.setStormNumber(result.group(1));
record.setStormName(result.group(2));
record.setAdvisoryNumber(result.group(3));
record.setBasin("WP");
}
}
@ -320,7 +330,7 @@ public class TcmParser {
* @param bulletin
*/
public void processCorr(int basin, TcmRecord record, String bulletin) {
if ( bulletin == null ) {
if (bulletin == null) {
return;
}
if (basin == 1) {
@ -329,7 +339,7 @@ public class TcmParser {
} else {
record.setCorr(false);
}
} else if ( basin == 2 ) {
} else if (basin == 2) {
if (bulletin.contains("CORRECTED//")) {
record.setCorr(true);
} else {
@ -341,11 +351,14 @@ public class TcmParser {
/**
* Process storm motion
*
* @param ocean basin
* @param forecast flag
* @param ocean
* basin
* @param forecast
* flag
* @param TcmPositionWinds
*/
public void processStormMotion(int basin, boolean forecast, TcmPositionWinds current) {
public void processStormMotion(int basin, boolean forecast,
TcmPositionWinds current) {
String DDSS = null;
if (basin == 1) {
DDSS = "PRESENT MOVEMENT TOWARD THE (\\w+) OR (\\d+) DEGREES AT\\s+(\\d+)\\s+KT";
@ -411,10 +424,12 @@ public class TcmParser {
/**
* Process current sustained winds and gusts
*
* @param ocean basin
* @param ocean
* basin
* @param TcmPositionWinds
*/
public void processMaxWind(int basin, boolean forecast, TcmPositionWinds current) {
public void processMaxWind(int basin, boolean forecast,
TcmPositionWinds current) {
String wmax = null;
if (basin == 1) {
if (forecast) {
@ -425,7 +440,7 @@ public class TcmParser {
} else if (basin == 2) {
wmax = "MAX SUSTAINED WINDS - (\\d+) KT, GUSTS\\s+(\\d+) KT";
}
if (sc.findWithinHorizon(wmax,0) != null) {
if (sc.findWithinHorizon(wmax, 0) != null) {
result = sc.match();
current.setWindMax(Integer.parseInt(result.group(1)));
current.setGust(Integer.valueOf(result.group(2)));
@ -435,8 +450,10 @@ public class TcmParser {
/**
* Process wind radii for 64 kts.
*
* @param ocean basin
* @param forecast flag
* @param ocean
* basin
* @param forecast
* flag
* @param TcmPositionWinds
*/
public void processRadii64(int basin, boolean fcst, TcmPositionWinds current) {
@ -448,13 +465,13 @@ public class TcmParser {
KT64 = "64 KT.......\\s*(\\d+)NE\\s+(\\d+)SE\\s+(\\d+)SW\\s+(\\d+)NW";
}
} else if (basin == 2) {
KT64 = "RADIUS OF 064 KT WINDS - " +
"(\\d+) NM NORTHEAST QUADRANT\\s+" +
"(\\d+) NM SOUTHEAST QUADRANT\\s+" +
"(\\d+) NM SOUTHWEST QUADRANT\\s+" +
"(\\d+) NM NORTHWEST QUADRANT";
KT64 = "RADIUS OF 064 KT WINDS - "
+ "(\\d+) NM NORTHEAST QUADRANT\\s+"
+ "(\\d+) NM SOUTHEAST QUADRANT\\s+"
+ "(\\d+) NM SOUTHWEST QUADRANT\\s+"
+ "(\\d+) NM NORTHWEST QUADRANT";
}
if (sc.findWithinHorizon(KT64,0) != null) {
if (sc.findWithinHorizon(KT64, 0) != null) {
result = sc.match();
current.setNe64k(result.group(1));
current.setSe64k(result.group(2));
@ -466,8 +483,10 @@ public class TcmParser {
/**
* Process wind radii for 50 kts.
*
* @param ocean basin
* @param forecast flag
* @param ocean
* basin
* @param forecast
* flag
* @param TcmPositionWinds
*/
public void processRadii50(int basin, boolean fcst, TcmPositionWinds current) {
@ -479,13 +498,13 @@ public class TcmParser {
KT50 = "50 KT.......\\s*(\\d+)NE\\s+(\\d+)SE\\s+(\\d+)SW\\s+(\\d+)NW";
}
} else if (basin == 2) {
KT50 = "RADIUS OF 050 KT WINDS - " +
"(\\d+) NM NORTHEAST QUADRANT\\s+" +
"(\\d+) NM SOUTHEAST QUADRANT\\s+" +
"(\\d+) NM SOUTHWEST QUADRANT\\s+" +
"(\\d+) NM NORTHWEST QUADRANT";
KT50 = "RADIUS OF 050 KT WINDS - "
+ "(\\d+) NM NORTHEAST QUADRANT\\s+"
+ "(\\d+) NM SOUTHEAST QUADRANT\\s+"
+ "(\\d+) NM SOUTHWEST QUADRANT\\s+"
+ "(\\d+) NM NORTHWEST QUADRANT";
}
if (sc.findWithinHorizon(KT50,0) != null) {
if (sc.findWithinHorizon(KT50, 0) != null) {
result = sc.match();
current.setNe50k(result.group(1));
current.setSe50k(result.group(2));
@ -497,8 +516,10 @@ public class TcmParser {
/**
* Process wind radii for 34 kts.
*
* @param ocean basin
* @param forecast flag
* @param ocean
* basin
* @param forecast
* flag
* @param TcmPositionWinds
*/
public void processRadii34(int basin, boolean fcst, TcmPositionWinds current) {
@ -510,13 +531,13 @@ public class TcmParser {
KT34 = "34 KT.......\\s*(\\d+)NE\\s+(\\d+)SE\\s+(\\d+)SW\\s+(\\d+)NW";
}
} else if (basin == 2) {
KT34 = "RADIUS OF 034 KT WINDS - " +
"(\\d+) NM NORTHEAST QUADRANT\\s+" +
"(\\d+) NM SOUTHEAST QUADRANT\\s+" +
"(\\d+) NM SOUTHWEST QUADRANT\\s+" +
"(\\d+) NM NORTHWEST QUADRANT";
KT34 = "RADIUS OF 034 KT WINDS - "
+ "(\\d+) NM NORTHEAST QUADRANT\\s+"
+ "(\\d+) NM SOUTHEAST QUADRANT\\s+"
+ "(\\d+) NM SOUTHWEST QUADRANT\\s+"
+ "(\\d+) NM NORTHWEST QUADRANT";
}
if (sc.findWithinHorizon(KT34,0) != null) {
if (sc.findWithinHorizon(KT34, 0) != null) {
result = sc.match();
current.setNe34k(result.group(1));
current.setSe34k(result.group(2));
@ -550,7 +571,8 @@ public class TcmParser {
/**
* Process current storm location and valid time
*
* @param ocean basin
* @param ocean
* basin
* @param TcmRecord
* @param TcmPositionWinds
*/
@ -558,41 +580,47 @@ public class TcmParser {
TcmRecord record, Calendar cal) {
String SLOC = null;
if (basin == 1) {
SLOC = "CENTER LOCATED NEAR (\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})" +
"(E|W) AT (\\d{1,2})/(\\d{2})(\\d{2})Z";
if (sc.findWithinHorizon(SLOC,0) != null) {
SLOC = "CENTER LOCATED NEAR (\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})"
+ "(E|W) AT (\\d{1,2})/(\\d{2})(\\d{2})Z";
if (sc.findWithinHorizon(SLOC, 0) != null) {
result = sc.match();
float lat = Float.parseFloat(result.group(1));
if (result.group(2).equals("S")) lat *= -1.0;
if (result.group(2).equals("S"))
lat *= -1.0;
current.setClat(lat);
float lon = Float.parseFloat(result.group(3));
if (result.group(4).equals("W")) lon *= -1.0;
if (result.group(4).equals("W"))
lon *= -1.0;
current.setClon(lon);
/*
* Set valid time
*/
cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(result.group(5)));
cal.set(Calendar.DAY_OF_MONTH,
Integer.parseInt(result.group(5)));
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(result.group(6)));
cal.set(Calendar.MINUTE, Integer.parseInt(result.group(7)));
}
} else if (basin == 2) {
SLOC = "(\\d{2})(\\d{2})(\\d{2})Z --- NEAR (\\d{0,2}.\\d{1})(N|S)\\s+" +
"(\\d{0,3}.\\d{1})(E|W)";
if (sc.findWithinHorizon(SLOC,0) != null) {
SLOC = "(\\d{2})(\\d{2})(\\d{2})Z --- NEAR (\\d{0,2}.\\d{1})(N|S)\\s+"
+ "(\\d{0,3}.\\d{1})(E|W)";
if (sc.findWithinHorizon(SLOC, 0) != null) {
result = sc.match();
float lat = Float.parseFloat(result.group(4));
if (result.group(5).equals("S")) lat *= -1.0;
if (result.group(5).equals("S"))
lat *= -1.0;
current.setClat(lat);
float lon = Float.parseFloat(result.group(6));
if (result.group(7).equals("W")) lon *= -1.0;
if (result.group(7).equals("W"))
lon *= -1.0;
current.setClon(lon);
/*
* set valid time
*/
cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(result.group(1)));
cal.set(Calendar.DAY_OF_MONTH,
Integer.parseInt(result.group(1)));
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(result.group(2)));
cal.set(Calendar.MINUTE, Integer.parseInt(result.group(3)));
}
@ -605,10 +633,10 @@ public class TcmParser {
if (basin == 1) {
current.setFcstHour("OBS");
record.setObsTime(cal);
} else if (basin == 2 ) {
} else if (basin == 2) {
current.setFcstHour("F00");
record.setObsTime(cal);
save_time = (Calendar)cal.clone();
save_time = (Calendar) cal.clone();
}
current.setValidTime(cal);
}
@ -620,25 +648,27 @@ public class TcmParser {
* @param TcmRecord
* @param Calendar
*/
public void processLocationTime(TcmPositionWinds past,TcmRecord record,
public void processLocationTime(TcmPositionWinds past, TcmRecord record,
Calendar cal) {
String PLOC = "AT (\\d{1,2})/(\\d{2})(\\d{2})Z CENTER WAS LOCATED NEAR " +
"(\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})(E|W)";
if (sc.findWithinHorizon(PLOC,0) != null) {
String PLOC = "AT (\\d{1,2})/(\\d{2})(\\d{2})Z CENTER WAS LOCATED NEAR "
+ "(\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})(E|W)";
if (sc.findWithinHorizon(PLOC, 0) != null) {
result = sc.match();
float lat = Float.parseFloat(result.group(4));
if (result.group(5).equals("S")) lat *= -1.0;
if (result.group(5).equals("S"))
lat *= -1.0;
past.setClat(lat);
float lon = Float.parseFloat(result.group(6));
if (result.group(7).equals("W")) lon *= -1.0;
if (result.group(7).equals("W"))
lon *= -1.0;
past.setClon(lon);
}
cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(result.group(1)));
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(result.group(2)));
cal.set(Calendar.MINUTE, Integer.parseInt(result.group(3)));
processRollOver (cal, record);
processRollOver(cal, record);
past.setFcstHour("F00");
save_time = (Calendar)cal.clone();
save_time = (Calendar) cal.clone();
past.setValidTime(cal);
}
@ -646,15 +676,14 @@ public class TcmParser {
* Process roll over month and year.
*/
public Calendar processRollOver(Calendar cal, TcmRecord record) {
if ( cal == null ) {
if (cal == null) {
return null;
}
if (cal.get(Calendar.DATE) < record.getIssueTime().get(Calendar.DATE)) {
if (cal.get(Calendar.MONTH) != 11) {
cal.roll(Calendar.MONTH, +1);
}
else {
} else {
cal.set(Calendar.MONTH, 0);
cal.roll(Calendar.YEAR, +1);
}
@ -665,10 +694,11 @@ public class TcmParser {
/**
* Decode TCM forecast section
*
* @param bull The bulletin message
* @param bull
* The bulletin message
* @param record
*/
public void processTcmForecasts (int basin, String bull, TcmRecord record) {
public void processTcmForecasts(int basin, String bull, TcmRecord record) {
TcmPositionWinds fcst;
Calendar cal;
MatchResult result;
@ -678,19 +708,20 @@ public class TcmParser {
return;
}
if (basin == 1) {
DM = "\\r\\r\\n \\r\\r\\n";
DM = "(\\r\\r\\n \\r\\r\\n)|(\\r\\r\\n\\r\\r\\n)";
} else if (basin == 2) {
DM = "( ---\\r\\n)|( ---\\n)";
}
Scanner cc = new Scanner(bull).useDelimiter(DM);
if (record == null) return;
if (record == null)
return;
/*
* Loop through forecast section...
*/
while (cc.hasNext()) {
String next = cc.next();
sc = new Scanner (next);
sc = new Scanner(next);
fcst = new TcmPositionWinds();
/*
@ -698,16 +729,16 @@ public class TcmParser {
*/
String FV = null;
if (basin == 1) {
FV = "(FORECAST|OUTLOOK) VALID (\\d{2})/(\\d{2})(\\d{2})Z " +
"(\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})(E|W)";
FV = "(FORECAST|OUTLOOK) VALID (\\d{2})/(\\d{2})(\\d{2})Z "
+ "(\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})(E|W)";
} else if (basin == 2) {
FV = "(\\w+) HRS, VALID AT:\\s+(\\d{2})(\\d{2})(\\d{2})Z --- " +
"(\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})(E|W)";
FV = "(\\w+) HRS, VALID AT:\\s+(\\d{2})(\\d{2})(\\d{2})Z --- "
+ "(\\d{0,2}.\\d{1})(N|S)\\s+(\\d{0,3}.\\d{1})(E|W)";
}
if (sc.findWithinHorizon(FV,0) != null) {
if (sc.findWithinHorizon(FV, 0) != null) {
result = sc.match();
fcst.setFcstHour("F"+result.group(1));
fcst.setFcstHour("F" + result.group(1));
/*
* Set valid time
@ -722,11 +753,11 @@ public class TcmParser {
cal.set(Calendar.DATE, Integer.parseInt(sdate));
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(shour));
cal.set(Calendar.MINUTE, Integer.parseInt(smin));
if (cal.get(Calendar.DATE) < record.getIssueTime().get(Calendar.DATE)) {
if (cal.get(Calendar.DATE) < record.getIssueTime().get(
Calendar.DATE)) {
if (cal.get(Calendar.MONTH) != 11) {
cal.roll(Calendar.MONTH, +1);
}
else {
} else {
cal.set(Calendar.MONTH, 0);
cal.roll(Calendar.YEAR, +1);
}
@ -737,9 +768,9 @@ public class TcmParser {
* Compute forecast hour for TPC
*/
if (basin == 1) {
long diff = ( cal.getTime().getTime() -
save_time.getTime().getTime()) / (1000*60*60);
fcst.setFcstHour("F"+Long.toString(diff));
long diff = (cal.getTime().getTime() - save_time.getTime()
.getTime()) / (1000 * 60 * 60);
fcst.setFcstHour("F" + Long.toString(diff));
}
/*
@ -755,37 +786,39 @@ public class TcmParser {
west = result.group(8);
float lat = Float.parseFloat(slat);
if (south.equals("S")) lat *= -1.0;
if (south.equals("S"))
lat *= -1.0;
fcst.setClat(lat);
float lon = Float.parseFloat(slon);
if (west.equals("W")) lon *= -1.0;
if (west.equals("W"))
lon *= -1.0;
fcst.setClon(lon);
/*
* Find and decode forecast wind speed and gusts
*/
processMaxWind(basin,forecast,fcst);
processMaxWind(basin, forecast, fcst);
/*
* Find and decode forecast 64 knot wind radii.
*/
processRadii64(basin,forecast,fcst);
processRadii64(basin, forecast, fcst);
/*
* Find and decode forecast 50 knot wind radii
*/
processRadii50(basin,forecast,fcst);
processRadii50(basin, forecast, fcst);
/*
* Find and decode forecast 34 knot wind radii
*/
processRadii34(basin,forecast,fcst);
processRadii34(basin, forecast, fcst);
/*
* Find and decode storm motion.
*/
if (basin == 2) {
processStormMotion(basin,forecast,fcst);
processStormMotion(basin, forecast, fcst);
}
/*

View file

@ -29,6 +29,7 @@ package gov.noaa.nws.ncep.edex.uengine.tasks.profile;
* 02/28/2012 Chin Chen modify several sounding query algorithms for better performance
* 03/28/2012 Chin Chen modify Grid data sounding query algorithms for better performance
* 06/25/2014 Chin Chen support dropsonde
* 07/23/2014 Chin Chen Support PW
* </pre>
* Python Script example to query multiple locations at one request:
* The following 3 query examples, returns same results.
@ -110,6 +111,7 @@ import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.ObsSndType;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.PfcSndType;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.SndQueryKeyType;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingStnInfoCollection;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingTools;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -145,6 +147,8 @@ public class NcSoundingDrv {
private int merge;
private int pwRequired = 0; // Support PW, 1=required, 0=Not required
private boolean useNcSoundingLayer2 = false;
private int[] dbIdList;
@ -395,6 +399,10 @@ public class NcSoundingDrv {
this.merge = merge;
}
public void setPwRequired(int pwRequired) {
this.pwRequired = pwRequired;
}
public long getRefTime() {
return refTime;
}
@ -1189,7 +1197,21 @@ public class NcSoundingDrv {
ttdd, ppaa, ppbb, ppcc, ppdd, trop_a,
trop_c, wmax_a, wmax_c,
pf.getStationElevation());
// Support PW
// System.out.println("1st merge call: lat/lon="
// + pf.getStationLatitude());
// for (int i = 0; i < sls.size(); i++) {
// NcSoundingLayer2 ncLay = sls.get(i);
// System.out.println(" temp="
// + ncLay.getTemperature() + " dewp="
// + ncLay.getDewpoint() + " press="
// + ncLay.getPressure() + " height="
// + ncLay.getGeoHeight() + " windSp="
// + ncLay.getWindSpeed() + " windDir="
// + ncLay.getWindDirection() + " omega="
// + ncLay.getOmega());
// }
// end Support PW
if (level.toUpperCase().equalsIgnoreCase("MAN")) {
pf.setSoundingLyLst2(sls);
// System.out.println("sls set to the sounding profile");
@ -1213,6 +1235,33 @@ public class NcSoundingDrv {
// + level);
}
}
// Support PW
if (pwRequired == 1) {
List<NcSoundingLayer2> sls2 = new ArrayList<NcSoundingLayer2>();
sls2 = ms.mergeUairSounding("-1", ttaa, ttbb,
ttcc, ttdd, ppaa, ppbb, ppcc, ppdd,
trop_a, trop_c, wmax_a, wmax_c,
pf.getStationElevation());
pf.setPw(NcSoundingTools.precip_water2(sls2));
// System.out.println("2nd merge call: lat/lon="
// + pf.getStationLatitude());
// for (int i = 0; i < sls2.size(); i++) {
// NcSoundingLayer2 ncLay = sls2.get(i);
// System.out.println(" temp="
// + ncLay.getTemperature() + " dewp="
// + ncLay.getDewpoint() + " press="
// + ncLay.getPressure() + " height="
// + ncLay.getGeoHeight() + " windSp="
// + ncLay.getWindSpeed()
// + " windDir="
// + ncLay.getWindDirection()
// + " omega=" + ncLay.getOmega());
// }
} else {
pf.setPw(-1);
}
// End Support PW
}
}
if (pf != null && pf.getSoundingLyLst2().size() > 0) {
@ -1356,28 +1405,36 @@ public class NcSoundingDrv {
// + (t02 - t01));
}
cube.setSoundingProfileList(soundingProfileList);
/*
* for(int i =0; i < cube.getSoundingProfileList().size();i++){
* System.out.println("lat/lon="+
* cube.getSoundingProfileList().get(i).getStationLatitude
* ()+"/"+cube.getSoundingProfileList().get(i).getStationLongitude()+
* " temp="
* +cube.getSoundingProfileList().get(i).getSoundingLyLst2().get(
* 0).getTemperature
* ()+" dewp="+cube.getSoundingProfileList().get(i).getSoundingLyLst2
* ().get(0).getDewpoint()+" press="+
* cube.getSoundingProfileList().get(i
* ).getSoundingLyLst2().get(0).getPressure() +
* " height="+cube.getSoundingProfileList
* ().get(i).getSoundingLyLst2().get(0).getGeoHeight()+
* " windSp="+cube.getSoundingProfileList
* ().get(i).getSoundingLyLst2().get
* (0).getWindSpeed()+" windDir="+cube.getSoundingProfileList
* ().get(i).getSoundingLyLst2().get(0).getWindDirection()+
* " omega="+cube
* .getSoundingProfileList().get(i).getSoundingLyLst2().get
* (0).getOmega()); }
*/
// for (int i = 0; i < cube.getSoundingProfileList().size(); i++) {
// System.out.println("lat/lon="
// + cube.getSoundingProfileList().get(i).getStationLatitude()
// + "/"
// + cube.getSoundingProfileList().get(i)
// .getStationLongitude()
// + " temp="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getTemperature()
// + " dewp="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getDewpoint()
// + " press="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getPressure()
// + " height="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getGeoHeight()
// + " windSp="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getWindSpeed()
// + " windDir="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getWindDirection()
// + " omega="
// + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
// .get(0).getOmega());
// }
returnedObject = cube;
// long t02 = System.currentTimeMillis();
// System.out.println("getSoundingData2Generic query took "+(t02-t01)+" ms in total");
@ -1984,6 +2041,10 @@ public class NcSoundingDrv {
sls = ms.mergeUairSounding(level, ttaa, ttbb, ttcc,
ttdd, ppaa, ppbb, ppcc, ppdd, trop_a, trop_c,
wmax_a, wmax_c, pf.getStationElevation());
// PW Support test
float pw = NcSoundingTools.precip_water(sls);
pf.setPw(pw);
// end PW Support test
// System.out.println("NCUAIR Number of Layers after merge:"+sls.size()
// + " level="+level +
// " ms.isNumber(level)="+ms.isNumber(level));

View file

@ -1,3 +1,11 @@
"""
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------- ------- -------- -----------
* 09/13/2010 301 Chin Chen Initial coding
* 07/23/2014 Chin Chen Support PW
"""
from com.raytheon.uf.common.message.response import ResponseMessageGeneric
from gov.noaa.nws.ncep.edex.uengine.tasks.profile import NcSoundingDrv
@ -71,6 +79,11 @@ class NcSoundingDataRequest():
def setLevel(self, level):
self.NcSoundingDrv.setLevel(level)
# Support PW
def setPwRequired(self, pwRequired):
self.NcSoundingDrv.setPwRequired(pwRequired)
def setDbIdList(self, dbIdList):
#print dbIdList
from jep import jarray, JINT_ID