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> </process>
</model> </model>
<model>
<name>hrrr</name>
<center>7</center>
<subcenter>0</subcenter>
<grid>17991059001</grid>
<process>
<id>83</id>
</process>
</model>
<model> <model>
<name>RTMA</name> <name>RTMA</name>
<center>7</center> <center>7</center>

View file

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

View file

@ -23,6 +23,7 @@ import java.util.Map;
* ----------- ---------- ---------- -------------------------- * ----------- ---------- ---------- --------------------------
* 05/14/2013 #989 qzhou Initial Creation * 05/14/2013 #989 qzhou Initial Creation
* 06/23/2014 R4152 qzhou Touched up 3 functions * 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> * </pre>
* *
* @author qzhou * @author qzhou
@ -534,11 +535,10 @@ public class CalcUtil {
// remove missing data // remove missing data
List<Float> newArray = new ArrayList<Float>(); 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) if (arraySort[k] != MISSING_VAL)
newArray.add(arraySort[k]); newArray.add(arraySort[k]);
else }
break; // to sorted arraySort
int size = newArray.size(); int size = newArray.size();
if (size % 2 == 0) if (size % 2 == 0)

View file

@ -1,4 +1,5 @@
package gov.noaa.nws.ncep.edex.common.sounding; package gov.noaa.nws.ncep.edex.common.sounding;
/** /**
* *
* gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile * 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 * 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 *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 * 02/15/2012 Chin Chen added fcsTime to support pfc sounding query
* 07/23/2014 Chin Chen Support PW
* </pre> * </pre>
* *
* @author Chin Chen * @author Chin Chen
* @version 1.0 * @version 1.0
*/ */
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -35,220 +36,226 @@ import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public class NcSoundingProfile implements ISerializableObject{ public class NcSoundingProfile implements ISerializableObject {
/** /**
* *
*/ */
private static final long serialVersionUID = 6858474095965608817L; private static final long serialVersionUID = 6858474095965608817L;
@DynamicSerializeElement @DynamicSerializeElement
public static final float MISSING = -9999.f; public static final float MISSING = -9999.f;
public static enum PfcSndType {
public static enum PfcSndType {
NAMSND, GFSSND, RUC2SND, RUCPTYPSND, BROWSE, NONE NAMSND, GFSSND, RUC2SND, RUCPTYPSND, BROWSE, NONE
}; };
public static enum MdlSndType { public static enum MdlSndType {
ANY, NONE ANY, NONE
}; };
public static enum ObsSndType {
NCUAIR, UAIR, DROP, TAMDAR, BUFRUA //same as uair but using bufrua decoder and data is saved in HDF5 public static enum ObsSndType {
,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 // Important Note:
//BUFRUA has different definition. stnid is string of number which is stnnum in UAIR, // Chin: definition is based on UAIR record. stnid is string of character,
//and stnname is string of character which is stnid in UAIR.. // stnnum is string of number
//type conversion is done at BUFRUA code. // 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 { public static enum SndQueryKeyType {
LATLON, STNID, STNNUM, NONE LATLON, STNID, STNNUM, NONE
}; };
@DynamicSerializeElement @DynamicSerializeElement
private List<NcSoundingLayer> soundingLyLst; private List<NcSoundingLayer> soundingLyLst;
@DynamicSerializeElement @DynamicSerializeElement
private List<NcSoundingLayer2> soundingLyLst2; private List<NcSoundingLayer2> soundingLyLst2;
@DynamicSerializeElement @DynamicSerializeElement
private float stationElevation; private float stationElevation;
//@DynamicSerializeElement
//private String stationId; // @DynamicSerializeElement
// private String stationId;
@DynamicSerializeElement @DynamicSerializeElement
private double stationLatitude; private double stationLatitude;
@DynamicSerializeElement @DynamicSerializeElement
private double stationLongitude; private double stationLongitude;
@DynamicSerializeElement @DynamicSerializeElement
private float sfcPress; private float sfcPress;
@DynamicSerializeElement @DynamicSerializeElement
private String stationId; private String stationId;
@DynamicSerializeElement @DynamicSerializeElement
private int stationNum; private int stationNum;
@DynamicSerializeElement @DynamicSerializeElement
private long fcsTime; private long fcsTime;
@DynamicSerializeElement @DynamicSerializeElement
private NcSoundingCube.QueryStatus rtnStatus = NcSoundingCube.QueryStatus.OK; private NcSoundingCube.QueryStatus rtnStatus = NcSoundingCube.QueryStatus.OK;
public NcSoundingCube.QueryStatus getRtnStatus() { // Support PW
return rtnStatus; @DynamicSerializeElement
} private float pw = -1;
public void setRtnStatus(NcSoundingCube.QueryStatus rtnStatus) { public NcSoundingCube.QueryStatus getRtnStatus() {
this.rtnStatus = rtnStatus; return rtnStatus;
} }
public String getStationId() { public void setRtnStatus(NcSoundingCube.QueryStatus rtnStatus) {
return stationId; this.rtnStatus = rtnStatus;
} }
public void setStationId(String stnId) { public String getStationId() {
this.stationId = stnId; return stationId;
} }
public int getStationNum() { public void setStationId(String stnId) {
return stationNum; this.stationId = stnId;
} }
public void setStationNum(int stnNum) { public int getStationNum() {
this.stationNum = stnNum; return stationNum;
} }
public void setStationNum(int stnNum) {
public long getFcsTime() { this.stationNum = stnNum;
return fcsTime; }
}
public void setFcsTime(long fcsTime) { public long getFcsTime() {
this.fcsTime = fcsTime; return fcsTime;
} }
public List<NcSoundingLayer> getSoundingLyLst() { public void setFcsTime(long fcsTime) {
return soundingLyLst; this.fcsTime = fcsTime;
} }
public void setSoundingLyLst(List<NcSoundingLayer> soundingLyLst) { public List<NcSoundingLayer> getSoundingLyLst() {
this.soundingLyLst = soundingLyLst; return soundingLyLst;
} }
public void setSoundingLyLst(List<NcSoundingLayer> soundingLyLst) {
this.soundingLyLst = soundingLyLst;
}
/** /**
* @return the soundingLyLst2 * @return the soundingLyLst2
*/ */
public List<NcSoundingLayer2> getSoundingLyLst2() { public List<NcSoundingLayer2> getSoundingLyLst2() {
return soundingLyLst2; return soundingLyLst2;
} }
/** /**
* @param soundingLyLst2 the soundingLyLst2 to set * @param soundingLyLst2
*/ * the soundingLyLst2 to set
public void setSoundingLyLst2(List<NcSoundingLayer2> soundingLyLst2) { */
this.soundingLyLst2 = soundingLyLst2; public void setSoundingLyLst2(List<NcSoundingLayer2> soundingLyLst2) {
} this.soundingLyLst2 = soundingLyLst2;
}
public float getStationElevation() {
return stationElevation;
}
public void setStationElevation(float stationElevation) { public float getStationElevation() {
this.stationElevation = stationElevation; return stationElevation;
} }
public void setStationElevation(float stationElevation) {
this.stationElevation = stationElevation;
}
public double getStationLatitude() { public double getStationLatitude() {
return stationLatitude; return stationLatitude;
} }
public void setStationLatitude(double stationLatitude) { public void setStationLatitude(double stationLatitude) {
this.stationLatitude = stationLatitude; this.stationLatitude = stationLatitude;
} }
public double getStationLongitude() { public double getStationLongitude() {
return stationLongitude; return stationLongitude;
} }
public void setStationLongitude(double stationLongitude) { public void setStationLongitude(double stationLongitude) {
this.stationLongitude = stationLongitude; this.stationLongitude = stationLongitude;
} }
public float getSfcPress() { public float getSfcPress() {
return sfcPress; return sfcPress;
} }
public void setSfcPress(float sfcPress) { public void setSfcPress(float sfcPress) {
this.sfcPress = sfcPress; this.sfcPress = sfcPress;
} }
public static long getSerialVersionUID() { public static long getSerialVersionUID() {
return serialVersionUID; return serialVersionUID;
} }
// TO-DO: Add station number (stationNumber) // TO-DO: Add station number (stationNumber)
public NcSoundingProfile(List<NcSoundingLayer2> soundingLyLst2, public NcSoundingProfile(List<NcSoundingLayer2> soundingLyLst2,
List<NcSoundingLayer> soundingLyLst, List<NcSoundingLayer> soundingLyLst, float stationElevation,
float stationElevation, String stationId, float stationLatitude, String stationId, float stationLatitude, float stationLongitude,
float stationLongitude, float sfcPress, int stnNum) { float sfcPress, int stnNum) {
super(); super();
this.soundingLyLst2 = soundingLyLst2; this.soundingLyLst2 = soundingLyLst2;
this.soundingLyLst = soundingLyLst; this.soundingLyLst = soundingLyLst;
this.stationElevation = stationElevation; this.stationElevation = stationElevation;
this.stationId = stationId; this.stationId = stationId;
this.stationLatitude = stationLatitude; this.stationLatitude = stationLatitude;
this.stationLongitude = stationLongitude; this.stationLongitude = stationLongitude;
this.sfcPress = sfcPress; this.sfcPress = sfcPress;
this.stationNum = stnNum; this.stationNum = stnNum;
} }
public NcSoundingProfile() { public NcSoundingProfile() {
super(); super();
this.soundingLyLst = new ArrayList<NcSoundingLayer>(); this.soundingLyLst = new ArrayList<NcSoundingLayer>();
this.soundingLyLst2 = new ArrayList<NcSoundingLayer2>(); this.soundingLyLst2 = new ArrayList<NcSoundingLayer2>();
this.stationElevation = MISSING; this.stationElevation = MISSING;
this.stationId = ""; this.stationId = "";
this.stationLatitude = MISSING; this.stationLatitude = MISSING;
this.stationLongitude = MISSING; this.stationLongitude = MISSING;
this.sfcPress = MISSING; this.sfcPress = MISSING;
this.stationNum= 0; this.stationNum = 0;
} }
/* public float getPw() {
@Override return pw;
protected AbstractStorageRecord cloneInternal() { }
// TODO Auto-generated method stub
System.out.println("NcSoundingProfile cloneInternal()");
return null;
}
@Override public void setPw(float pw) {
public Object getDataObject() { this.pw = pw;
// TODO Auto-generated method stub }
System.out.println("NcSoundingProfile getDataObject()");
return null;
}
@Override /*
public int getSizeInBytes() { * @Override protected AbstractStorageRecord cloneInternal() { // TODO
// TODO Auto-generated method stub * Auto-generated method stub
System.out.println("NcSoundingProfile getSizeInBytes()"); * System.out.println("NcSoundingProfile cloneInternal()"); return null; }
return 0; *
} * @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
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 * Date Ticket# Engineer Description
* __________ _______ __________ __________________________ * __________ _______ __________ __________________________
* 10/12/2011 126 G. Hull Initial Creation * 10/12/2011 126 G. Hull Initial Creation
* 07/30/2014 B. Hebbard Add refTime parameter
--> -->
<pointDataDbDescription> <pointDataDbDescription>
<parameter name="latitude" queryName="location.latitude" type="FLOAT" unit="°" /> <parameter name="latitude" queryName="location.latitude" type="FLOAT" unit="°" />
@ -13,4 +14,5 @@
<parameter name="stationName" queryName="location.stationId" type="STRING" /> <parameter name="stationName" queryName="location.stationId" type="STRING" />
<parameter name="reportType" queryName="reportType" type="STRING" /> <parameter name="reportType" queryName="reportType" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" /> <parameter name="dataURI" queryName="dataURI" type="STRING" />
<parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/>
</pointDataDbDescription> </pointDataDbDescription>

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 * 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 * 03/28/2012 Chin Chen modify Grid data sounding query algorithms for better performance
* 06/25/2014 Chin Chen support dropsonde * 06/25/2014 Chin Chen support dropsonde
* 07/23/2014 Chin Chen Support PW
* </pre> * </pre>
* Python Script example to query multiple locations at one request: * Python Script example to query multiple locations at one request:
* The following 3 query examples, returns same results. * 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.PfcSndType;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.SndQueryKeyType; 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.NcSoundingStnInfoCollection;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingTools;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -145,6 +147,8 @@ public class NcSoundingDrv {
private int merge; private int merge;
private int pwRequired = 0; // Support PW, 1=required, 0=Not required
private boolean useNcSoundingLayer2 = false; private boolean useNcSoundingLayer2 = false;
private int[] dbIdList; private int[] dbIdList;
@ -395,6 +399,10 @@ public class NcSoundingDrv {
this.merge = merge; this.merge = merge;
} }
public void setPwRequired(int pwRequired) {
this.pwRequired = pwRequired;
}
public long getRefTime() { public long getRefTime() {
return refTime; return refTime;
} }
@ -1189,7 +1197,21 @@ public class NcSoundingDrv {
ttdd, ppaa, ppbb, ppcc, ppdd, trop_a, ttdd, ppaa, ppbb, ppcc, ppdd, trop_a,
trop_c, wmax_a, wmax_c, trop_c, wmax_a, wmax_c,
pf.getStationElevation()); 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")) { if (level.toUpperCase().equalsIgnoreCase("MAN")) {
pf.setSoundingLyLst2(sls); pf.setSoundingLyLst2(sls);
// System.out.println("sls set to the sounding profile"); // System.out.println("sls set to the sounding profile");
@ -1213,6 +1235,33 @@ public class NcSoundingDrv {
// + level); // + 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) { if (pf != null && pf.getSoundingLyLst2().size() > 0) {
@ -1356,28 +1405,36 @@ public class NcSoundingDrv {
// + (t02 - t01)); // + (t02 - t01));
} }
cube.setSoundingProfileList(soundingProfileList); cube.setSoundingProfileList(soundingProfileList);
/*
* for(int i =0; i < cube.getSoundingProfileList().size();i++){ // for (int i = 0; i < cube.getSoundingProfileList().size(); i++) {
* System.out.println("lat/lon="+ // System.out.println("lat/lon="
* cube.getSoundingProfileList().get(i).getStationLatitude // + cube.getSoundingProfileList().get(i).getStationLatitude()
* ()+"/"+cube.getSoundingProfileList().get(i).getStationLongitude()+ // + "/"
* " temp=" // + cube.getSoundingProfileList().get(i)
* +cube.getSoundingProfileList().get(i).getSoundingLyLst2().get( // .getStationLongitude()
* 0).getTemperature // + " temp="
* ()+" dewp="+cube.getSoundingProfileList().get(i).getSoundingLyLst2 // + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
* ().get(0).getDewpoint()+" press="+ // .get(0).getTemperature()
* cube.getSoundingProfileList().get(i // + " dewp="
* ).getSoundingLyLst2().get(0).getPressure() + // + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
* " height="+cube.getSoundingProfileList // .get(0).getDewpoint()
* ().get(i).getSoundingLyLst2().get(0).getGeoHeight()+ // + " press="
* " windSp="+cube.getSoundingProfileList // + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
* ().get(i).getSoundingLyLst2().get // .get(0).getPressure()
* (0).getWindSpeed()+" windDir="+cube.getSoundingProfileList // + " height="
* ().get(i).getSoundingLyLst2().get(0).getWindDirection()+ // + cube.getSoundingProfileList().get(i).getSoundingLyLst2()
* " omega="+cube // .get(0).getGeoHeight()
* .getSoundingProfileList().get(i).getSoundingLyLst2().get // + " windSp="
* (0).getOmega()); } // + 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; returnedObject = cube;
// long t02 = System.currentTimeMillis(); // long t02 = System.currentTimeMillis();
// System.out.println("getSoundingData2Generic query took "+(t02-t01)+" ms in total"); // 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, sls = ms.mergeUairSounding(level, ttaa, ttbb, ttcc,
ttdd, ppaa, ppbb, ppcc, ppdd, trop_a, trop_c, ttdd, ppaa, ppbb, ppcc, ppdd, trop_a, trop_c,
wmax_a, wmax_c, pf.getStationElevation()); 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() // System.out.println("NCUAIR Number of Layers after merge:"+sls.size()
// + " level="+level + // + " level="+level +
// " ms.isNumber(level)="+ms.isNumber(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 com.raytheon.uf.common.message.response import ResponseMessageGeneric
from gov.noaa.nws.ncep.edex.uengine.tasks.profile import NcSoundingDrv from gov.noaa.nws.ncep.edex.uengine.tasks.profile import NcSoundingDrv
@ -71,6 +79,11 @@ class NcSoundingDataRequest():
def setLevel(self, level): def setLevel(self, level):
self.NcSoundingDrv.setLevel(level) self.NcSoundingDrv.setLevel(level)
# Support PW
def setPwRequired(self, pwRequired):
self.NcSoundingDrv.setPwRequired(pwRequired)
def setDbIdList(self, dbIdList): def setDbIdList(self, dbIdList):
#print dbIdList #print dbIdList
from jep import jarray, JINT_ID from jep import jarray, JINT_ID