addback hpe,mpe,registry,ohd,scan plugins
This commit is contained in:
parent
dec3f3d13f
commit
65c3353c26
2185 changed files with 381561 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.cwat/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.cwat/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.cwat</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,16 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Cwat Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.cwat
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: javax.persistence;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.monitor;bundle-version="1.11.5",
|
||||
com.raytheon.uf.common.dataplugin.radar,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.datastorage
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.cwat
|
|
@ -0,0 +1,5 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
utility/,\
|
||||
.
|
|
@ -0,0 +1,555 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.cwat;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.PrimaryKeyJoinColumn;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.geotools.coverage.grid.GeneralGridEnvelope;
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.geotools.geometry.GeneralEnvelope;
|
||||
import org.hibernate.annotations.Index;
|
||||
import org.opengis.referencing.crs.ProjectedCRS;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.ShortDataRecord;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialEnabled;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialObject;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.monitor.scan.ThreatLocation;
|
||||
import com.raytheon.uf.common.monitor.scan.ThreatReport;
|
||||
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
|
||||
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* Record implementation for CWAT plugin
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 03, 2009 2037 D. Hladky Initial release
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 06, 2013 2228 njensen Use deserialize(byte[])
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed XML annotations
|
||||
* Jul 23, 2015 2360 rferrel Add name to unique constraint.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "cwatseq")
|
||||
@Table(name = "cwat", uniqueConstraints = { @UniqueConstraint(name = "uk_cwat_datauri_fields", columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "cwat", indexes = { @Index(name = "cwat_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
public class CWATRecord extends PersistablePluginDataObject implements
|
||||
IPersistable, ISpatialEnabled {
|
||||
|
||||
private static final long serialVersionUID = 76774564365671L;
|
||||
|
||||
public static String THREATS = "Storm Threat";
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
private String icao;
|
||||
|
||||
@Column(length = 30)
|
||||
@DataURI(position = 2)
|
||||
@DynamicSerializeElement
|
||||
private String fieldName;
|
||||
|
||||
@ManyToOne
|
||||
@PrimaryKeyJoinColumn
|
||||
@DynamicSerializeElement
|
||||
private RadarStation spatialInfo;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer nx = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer ny = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer dx = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer dy = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer maxScti = 0;
|
||||
|
||||
@Transient
|
||||
private short[] data_array = null;
|
||||
|
||||
@Transient
|
||||
private HashMap<ThreatLocation, ThreatReport> threats = new HashMap<ThreatLocation, ThreatReport>();
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public CWATRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a record from a dataURI
|
||||
*
|
||||
* @param uri
|
||||
* The dataURI
|
||||
* @param tableDef
|
||||
* The table definition associated with this class
|
||||
*/
|
||||
public CWATRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the fieldNames for cwat
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 20, 2009 dhladky Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum DATA_TYPE {
|
||||
|
||||
CWAT("CWA Threat Index");
|
||||
|
||||
private final String fieldName;
|
||||
|
||||
private DATA_TYPE(String name) {
|
||||
fieldName = name;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the fieldUNits for cwat
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 20, 2009 dhladky Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum UNIT_TYPE {
|
||||
|
||||
CWAT("%");
|
||||
|
||||
private final String fieldUnit;
|
||||
|
||||
private UNIT_TYPE(String unit) {
|
||||
fieldUnit = unit;
|
||||
}
|
||||
|
||||
public String getFieldUnit() {
|
||||
return fieldUnit;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the icao
|
||||
*
|
||||
* @param icao
|
||||
*/
|
||||
public void setIcao(String icao) {
|
||||
this.icao = icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the icao
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getIcao() {
|
||||
return icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fieldName
|
||||
*
|
||||
* @param fieldName
|
||||
*/
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the fieldName
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* set NX
|
||||
*
|
||||
* @param nx
|
||||
*/
|
||||
public void setNx(Integer nx) {
|
||||
this.nx = nx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get NX
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getNx() {
|
||||
return nx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the NY
|
||||
*
|
||||
* @param ny
|
||||
*/
|
||||
public void setNy(Integer ny) {
|
||||
this.ny = ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the NY
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getNy() {
|
||||
return ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* set DX in meters
|
||||
*
|
||||
* @param dx
|
||||
*/
|
||||
public void setDx(Integer dx) {
|
||||
this.dx = dx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DX in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getDx() {
|
||||
return dx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the DY, in meters
|
||||
*
|
||||
* @param dy
|
||||
*/
|
||||
public void setDy(Integer dy) {
|
||||
this.dy = dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the DY, in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getDy() {
|
||||
return dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* The max value for the SCTI
|
||||
*
|
||||
* @param maxSCTI
|
||||
*/
|
||||
public void setMaxScti(Integer maxScti) {
|
||||
this.maxScti = maxScti;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the maximum SCTI value
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getMaxScti() {
|
||||
return maxScti;
|
||||
}
|
||||
|
||||
public RadarStation getSpatialInfo() {
|
||||
return spatialInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set that spatial info object.
|
||||
*
|
||||
* @param spatialInfo
|
||||
*/
|
||||
public void setSpatialInfo(RadarStation spatialInfo) {
|
||||
this.spatialInfo = spatialInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public void setDataArray(short[] data_array) {
|
||||
this.data_array = data_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public short[] getDataArray() {
|
||||
return data_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the projected CRS
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ProjectedCRS getCRS() {
|
||||
return MapUtil.constructStereographic(MapUtil.AWIPS_EARTH_RADIUS,
|
||||
MapUtil.AWIPS_EARTH_RADIUS, getSpatialInfo().getLat(),
|
||||
getSpatialInfo().getLon());
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a 2D GridGeometry to use for display
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public GridGeometry2D getGridGeometry() {
|
||||
ProjectedCRS crs = this.getCRS();
|
||||
|
||||
GridGeometry2D gridGeometry2D = null;
|
||||
|
||||
GeneralEnvelope generalEnvelope = new GeneralEnvelope(2);
|
||||
generalEnvelope.setCoordinateReferenceSystem(crs);
|
||||
|
||||
double maxExtent = (this.getDx() * (this.getNx() / 2));
|
||||
|
||||
generalEnvelope.setRange(0, -maxExtent, maxExtent);
|
||||
generalEnvelope.setRange(1, -maxExtent, maxExtent);
|
||||
|
||||
gridGeometry2D = new GridGeometry2D(new GeneralGridEnvelope(new int[] {
|
||||
0, 0 }, new int[] { this.getNx(), this.getNy() }, false),
|
||||
generalEnvelope);
|
||||
|
||||
return gridGeometry2D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data array from the store.
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
public void retrieveFromDataStore(IDataStore dataStore) {
|
||||
|
||||
try {
|
||||
IDataRecord[] dataRec = dataStore.retrieve(getDataURI());
|
||||
for (IDataRecord element : dataRec) {
|
||||
if (element instanceof ShortDataRecord) {
|
||||
setDataArray(((ShortDataRecord) element).getShortData());
|
||||
}
|
||||
}
|
||||
retrieveMapFromDataStore(dataStore);
|
||||
|
||||
} catch (Exception se) {
|
||||
se.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Hash out of the
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void retrieveMapFromDataStore(IDataStore dataStore) {
|
||||
try {
|
||||
if (getThreats().size() < 1) {
|
||||
ByteDataRecord byteData = (ByteDataRecord) dataStore.retrieve(
|
||||
getDataURI(), THREATS, Request.ALL);
|
||||
Object o = DynamicSerializationManager.getManager(
|
||||
SerializationType.Thrift).deserialize(
|
||||
byteData.getByteData());
|
||||
setThreats((HashMap<ThreatLocation, ThreatReport>) o);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for debugging.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("\n dataURI: " + getDataURI() + "\n");
|
||||
sb.append("data_array: " + getDataArray().length + "\n");
|
||||
sb.append("Threats map: " + getThreats().size() + "\n");
|
||||
sb.append("Icao: " + getIcao() + "\n");
|
||||
sb.append("Field: " + getParameterName() + "\n");
|
||||
sb.append("Unit: " + getParameterUnit() + "\n");
|
||||
sb.append("dataTime: "
|
||||
+ getDataTime().getValidTime().getTime().toString() + "\n");
|
||||
sb.append("PersistanceTime: " + getPersistenceTime().toString() + "\n");
|
||||
sb.append("Nx: " + getNx() + "\n");
|
||||
sb.append("Ny: " + getNy() + "\n");
|
||||
sb.append("Dx: " + getDx() + "\n");
|
||||
sb.append("Dy: " + getDy() + "\n");
|
||||
sb.append("MaxSCTI: " + getMaxScti() + "\n");
|
||||
sb.append("lat: " + getSpatialInfo().getLat() + "\n");
|
||||
sb.append("lon: " + getSpatialInfo().getLon() + "\n");
|
||||
sb.append("CRS: " + getCRS().toWKT() + "\n");
|
||||
sb.append("WFO: " + getSpatialInfo().getWfoId() + "\n");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the actual string text for the name
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getParameterName() {
|
||||
String paramName = null;
|
||||
for (DATA_TYPE name : DATA_TYPE.values()) {
|
||||
if (getFieldName().equals(name.name())) {
|
||||
paramName = name.getFieldName();
|
||||
}
|
||||
}
|
||||
return paramName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the actual string text for the unit
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getParameterUnit() {
|
||||
String paramUnit = null;
|
||||
for (UNIT_TYPE name : UNIT_TYPE.values()) {
|
||||
if (getFieldName().equals(name.name())) {
|
||||
paramUnit = name.getFieldUnit();
|
||||
}
|
||||
}
|
||||
return paramUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpatialObject getSpatialObject() {
|
||||
return getSpatialInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HashMap<ThreatLocation, ThreatReport>containing the data
|
||||
*
|
||||
* @param threats
|
||||
*/
|
||||
public void setThreats(HashMap<ThreatLocation, ThreatReport> threats) {
|
||||
this.threats = threats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Hash containing the data, when you've populated it!
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public HashMap<ThreatLocation, ThreatReport> getThreats() {
|
||||
return threats;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "cwat";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an incremental override file, indicating that the files
|
||||
at different localization levels will be combined.
|
||||
-->
|
||||
<styleRuleset>
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>cwat</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>%</displayUnits>
|
||||
<defaultColormap>scan/SCANCWAThreatIndex</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' label='' />
|
||||
<entry displayValue='10.0' label='' />
|
||||
<entry displayValue='15.0' label='GEN' />
|
||||
<entry displayValue='30.0' label='' />
|
||||
<entry displayValue='40.0' label='' />
|
||||
<entry displayValue='50.0' label='MED' />
|
||||
<entry displayValue='70.0' label='' />
|
||||
<entry displayValue='85.0' label='HIGH' />
|
||||
<entry displayValue='100.0' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
</styleRuleset>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.ffmp</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,29 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: FFMP common Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.ffmp
|
||||
Bundle-Version: 1.17.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.ffmp,
|
||||
com.raytheon.uf.common.dataplugin.ffmp.collections,
|
||||
com.raytheon.uf.common.dataplugin.ffmp.dataaccess
|
||||
Require-Bundle: javax.persistence,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.monitor,
|
||||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.common.site,
|
||||
com.raytheon.uf.common.dataplugin.shef,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.common.dataaccess,
|
||||
com.google.guava,
|
||||
javax.measure,
|
||||
com.raytheon.uf.common.message,
|
||||
com.raytheon.uf.common.dataquery,
|
||||
com.raytheon.uf.common.datastorage,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.xmrg,
|
||||
com.raytheon.uf.common.dataplugin.radar
|
||||
Import-Package: com.raytheon.uf.common.util
|
|
@ -0,0 +1,6 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
utility/,\
|
||||
.,\
|
||||
res/
|
|
@ -0,0 +1,126 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Aggregate record implementation for FFMP data
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 01/27/13 1478 D. Hladky Created to reduce memory and disk read/writes for FFMP
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
@DynamicSerialize
|
||||
public class FFMPAggregateRecord {
|
||||
|
||||
@DynamicSerializeElement
|
||||
private String wfo;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private String sourceSiteDataKey;
|
||||
|
||||
/**
|
||||
* Aggregate Record implementation for FFMP
|
||||
*/
|
||||
public FFMPAggregateRecord() {
|
||||
|
||||
}
|
||||
|
||||
@DynamicSerializeElement
|
||||
private FFMPBasinData basins;
|
||||
|
||||
public FFMPBasinData getBasins() {
|
||||
return basins;
|
||||
}
|
||||
|
||||
public void setBasins(FFMPBasinData basins) {
|
||||
this.basins = basins;
|
||||
}
|
||||
|
||||
@DynamicSerializeElement
|
||||
private List<Long> times = new ArrayList<Long>();
|
||||
|
||||
/**
|
||||
* Sets the times array
|
||||
* @param times
|
||||
*/
|
||||
public void setTimes(List<Long> times) {
|
||||
this.times = times;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the times array
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getTimes() {
|
||||
return times;
|
||||
}
|
||||
|
||||
/**
|
||||
* WFO designator
|
||||
* @return
|
||||
*/
|
||||
public String getWfo() {
|
||||
return wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the WFO designator
|
||||
* @param wfo
|
||||
*/
|
||||
public void setWfo(String wfo) {
|
||||
this.wfo = wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the source / site / data key
|
||||
* @param sourceSiteDataKey
|
||||
*/
|
||||
public void setSourceSiteDataKey(String sourceSiteDataKey) {
|
||||
this.sourceSiteDataKey = sourceSiteDataKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source / site / data key
|
||||
* @return
|
||||
*/
|
||||
public String getSourceSiteDataKey() {
|
||||
return sourceSiteDataKey;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,466 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.collections.ArrayBackedMap;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.collections.BasinMapFactory;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* FFMP basin/aggregated value holder
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/22/09 2152 D. Hladky Initial release
|
||||
* 01/27/13 1478 D. Hladky Added support for writing aggregate record cache
|
||||
* Apr 22, 2013 1912 bsteffen optimized the creation of NavigableMaps
|
||||
* from aggregate records and delayed
|
||||
* TreeMap creation to the tertiary loader.
|
||||
* Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP.
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
* Jul 31, 2013 2242 bsteffen Optimize FFMP NavigableMap memory.
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
* Oct 10, 2015 4756 dhladky Prevent null values from being inserted.
|
||||
* Oct 26, 2015 5056 dhladky Better debugging info.
|
||||
* Feb 11, 2016 5273 tjensen Fixed getAccumValue not tracking latest time.
|
||||
* Jun 03, 2016 19090 dhladky (code checked in by zhao) Fixed a bug in Accum calculation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class FFMPBasin implements Cloneable {
|
||||
|
||||
/** pfafstetter id(key) in GIS **/
|
||||
@DynamicSerializeElement
|
||||
protected Long pfaf;
|
||||
|
||||
/** boolean aggregator **/
|
||||
@DynamicSerializeElement
|
||||
protected boolean aggregated = false;
|
||||
|
||||
/**
|
||||
* object used in calculations not serialized!
|
||||
**/
|
||||
@Transient
|
||||
protected NavigableMap<Date, Float> values;
|
||||
|
||||
/**
|
||||
* Set to either the values map or the BasinMapFactory that was used to
|
||||
* create it to enable correct synchronization.
|
||||
*/
|
||||
@Transient
|
||||
protected Object valuesSynchronization;
|
||||
|
||||
/** object used for serialization **/
|
||||
@DynamicSerializeElement
|
||||
public float[] serializedValues;
|
||||
|
||||
public void setSerializedValues(float[] serializedValues) {
|
||||
this.serializedValues = serializedValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the float array of serialized values
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public float[] getSerializedValues() {
|
||||
return serializedValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pfaf_id
|
||||
*/
|
||||
public Long getPfaf() {
|
||||
return pfaf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param basin_id
|
||||
* the basin_id to set
|
||||
*/
|
||||
public void setPfaf(Long pfaf) {
|
||||
this.pfaf = pfaf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggregation marker
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean getAggregated() {
|
||||
return aggregated;
|
||||
}
|
||||
|
||||
/**
|
||||
* required setter
|
||||
*
|
||||
* @param aggregated
|
||||
*/
|
||||
public void setAggregated(boolean aggregated) {
|
||||
this.aggregated = aggregated;
|
||||
}
|
||||
|
||||
public boolean contains(Date date) {
|
||||
return values.containsKey(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Value for a date
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public Float getValue(Date date) {
|
||||
Float dvalue = null;
|
||||
|
||||
if (date != null) {
|
||||
dvalue = values.get(date);
|
||||
}
|
||||
|
||||
if (dvalue == null) {
|
||||
dvalue = 0.0f;
|
||||
}
|
||||
|
||||
return dvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the most recent
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Float getValue() {
|
||||
Float value = 0.0f;
|
||||
Entry<Date, Float> entry = values.firstEntry();
|
||||
if (entry != null) {
|
||||
value = entry.getValue();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the accumulated value from this time back.
|
||||
*
|
||||
* @param afterDate
|
||||
* @param beforeDate
|
||||
* @return
|
||||
*/
|
||||
public float getAccumValue(Date afterDate, Date beforeDate,
|
||||
long expirationTime, boolean rate) {
|
||||
float dvalue = 0.0f;
|
||||
Date prevDate = null;
|
||||
|
||||
// map ordered newest first, so grab from newest date to oldest date
|
||||
if (afterDate.before(beforeDate) && (!values.isEmpty())) {
|
||||
|
||||
synchronized (valuesSynchronization) {
|
||||
|
||||
float factor = 0.0f;
|
||||
|
||||
for (Entry<Date, Float> entry : values.subMap(beforeDate,
|
||||
false, afterDate, true).entrySet()) {
|
||||
Date tdate = entry.getKey();
|
||||
float val = entry.getValue();
|
||||
|
||||
if (!rate) {
|
||||
|
||||
if (prevDate == null) {
|
||||
prevDate = beforeDate;
|
||||
}
|
||||
|
||||
if (val > 0.0f) {
|
||||
|
||||
if ((prevDate.getTime() - tdate.getTime()) > expirationTime) {
|
||||
// handle the gap and accumulate the book ends
|
||||
// of it
|
||||
factor = ((prevDate.getTime() - (prevDate
|
||||
.getTime() - expirationTime)) / (TimeUtil.MILLIS_PER_HOUR*1.0f));
|
||||
} else {
|
||||
factor = ((prevDate.getTime() - tdate.getTime()) / (TimeUtil.MILLIS_PER_HOUR*1.0f));
|
||||
}
|
||||
// do absolute values so it dosen't matter which way
|
||||
// you traverse the list
|
||||
val = val * Math.abs(factor);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
dvalue += val;
|
||||
prevDate = tdate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value within a time window
|
||||
*
|
||||
* @param afterDate
|
||||
* @param beforeDate
|
||||
* @return
|
||||
*/
|
||||
public Float getValue(Date afterDate, Date beforeDate) {
|
||||
Float val = 0.0f;
|
||||
synchronized (valuesSynchronization) {
|
||||
Date checkDate = values.ceilingKey(afterDate);
|
||||
if ((checkDate != null) && checkDate.before(beforeDate)) {
|
||||
val = values.get(checkDate);
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for mosaic sources where the times come in irregularly (QPF)
|
||||
*
|
||||
* @param date
|
||||
* @param buffer
|
||||
* @return
|
||||
*/
|
||||
public Float getAverageValue(Date date, long buffer) {
|
||||
Date afterDate = new Date(date.getTime() - (buffer / 2));
|
||||
Date beforeDate = new Date(date.getTime() + (buffer / 2));
|
||||
// System.out.println("AfterDate: "+afterDate+
|
||||
// " BeforeDate: "+beforeDate);
|
||||
return getAverageValue(afterDate, beforeDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the average value within a time window, used for mosaic
|
||||
*
|
||||
* @param afterDate
|
||||
* @param beforeDate
|
||||
* @return
|
||||
*/
|
||||
public Float getAverageValue(Date afterDate, Date beforeDate) {
|
||||
Float val = 0.0f;
|
||||
int i = 0;
|
||||
|
||||
synchronized (valuesSynchronization) {
|
||||
|
||||
for (Date date : values.keySet()) {
|
||||
if (date.before(beforeDate) && date.after(afterDate)) {
|
||||
float val1 = values.get(date);
|
||||
if (val1 > 0.0) {
|
||||
val += val1;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i != 0) {
|
||||
val = val / i;
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the average value within a time window, used for mosaic
|
||||
*
|
||||
* @param afterDate
|
||||
* @param beforeDate
|
||||
* @return
|
||||
*/
|
||||
public Float getMaxValue(Date afterDate, Date beforeDate) {
|
||||
Float val = 0.0f;
|
||||
|
||||
synchronized (valuesSynchronization) {
|
||||
|
||||
for (Date date : values.keySet()) {
|
||||
if (date.before(beforeDate) && date.after(afterDate)) {
|
||||
if (val > values.get(date)) {
|
||||
val = values.get(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a date/value pair
|
||||
*
|
||||
* @param date
|
||||
* @param value
|
||||
*/
|
||||
public void setValue(Date date, Float dvalue) {
|
||||
|
||||
// Do not allow null values to be added!
|
||||
if (dvalue == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (valuesSynchronization) {
|
||||
values.put(date, dvalue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the TreeMap for data
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public NavigableMap<Date, Float> getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the linked Hash for archived data
|
||||
*
|
||||
* @param values
|
||||
*/
|
||||
public void setValues(TreeMap<Date, Float> values) {
|
||||
this.values = values;
|
||||
this.valuesSynchronization = values;
|
||||
}
|
||||
|
||||
/**
|
||||
* No arg serial constructor
|
||||
*/
|
||||
public FFMPBasin() {
|
||||
|
||||
values = new TreeMap<Date, Float>(Collections.reverseOrder());
|
||||
valuesSynchronization = values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Useful constructor
|
||||
*
|
||||
* @param pfaf
|
||||
* @param aggregated
|
||||
*/
|
||||
public FFMPBasin(Long pfaf, boolean aggregated) {
|
||||
setPfaf(pfaf);
|
||||
setAggregated(aggregated);
|
||||
values = new TreeMap<Date, Float>(Collections.reverseOrder());
|
||||
valuesSynchronization = values;
|
||||
}
|
||||
|
||||
public FFMPBasin(Long pfaf, boolean aggregated,
|
||||
BasinMapFactory<Date> mapFactory) {
|
||||
setPfaf(pfaf);
|
||||
setAggregated(aggregated);
|
||||
values = mapFactory.getMap();
|
||||
valuesSynchronization = mapFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the map from the serialized values
|
||||
*
|
||||
* @param times
|
||||
*/
|
||||
public void deserialize(long[] times, BasinMapFactory<Date> mapFactory) {
|
||||
// safe to avoid Array Index Exceptions / shouldn't happen but.....
|
||||
|
||||
if (serializedValues != null
|
||||
&& (times.length == serializedValues.length)) {
|
||||
NavigableMap<Date, Float> fastMap = new ArrayBackedMap(times,
|
||||
serializedValues);
|
||||
|
||||
values = mapFactory.getMap(fastMap.descendingMap());
|
||||
valuesSynchronization = mapFactory;
|
||||
}
|
||||
serializedValues = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* populates the serialized array
|
||||
*/
|
||||
public void serialize() {
|
||||
|
||||
serializedValues = new float[values.size()];
|
||||
int i = 0;
|
||||
|
||||
for (Date date : values.descendingKeySet()) {
|
||||
serializedValues[i] = values.get(date);
|
||||
i++;
|
||||
}
|
||||
// System.out.println("wrote :"+i+" pfaf : "+pfaf);
|
||||
}
|
||||
|
||||
/**
|
||||
* purge out old entries
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
public void purgeData(Date date) {
|
||||
if (values != null) {
|
||||
synchronized (valuesSynchronization) {
|
||||
ArrayList<Date> removes = new ArrayList<Date>();
|
||||
for (Date mdate : values.keySet()) {
|
||||
if (mdate.before(date)) {
|
||||
removes.add(mdate);
|
||||
}
|
||||
}
|
||||
|
||||
for (Date rdate : removes) {
|
||||
values.remove(rdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuffer buff = new StringBuffer();
|
||||
buff.append("PFAF ID: " + pfaf + "\n");
|
||||
buff.append("Aggregated : " + aggregated + "\n");
|
||||
for (Date date : values.keySet()) {
|
||||
buff.append("Date : " + date + "\n");
|
||||
buff.append("Value : " + values.get(date) + "\n");
|
||||
}
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
FFMPBasin basin = new FFMPBasin(pfaf, aggregated);
|
||||
basin.setValues(new TreeMap<Date, Float>(values));
|
||||
return basin;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,941 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPDataRecordLoader.LoadTask;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.collections.BasinMapFactory;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* FFMPBasinData Container
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/22/09 2152 D. Hladky Initial release
|
||||
* 01/27/13 1478 D. Hladky Added support for write of aggregate record cache
|
||||
* 01/27/13 1569 D. Hladky Added support for write of aggregate record cache
|
||||
* 04/16/13 1912 bsteffen Initial bulk hdf5 access for ffmp
|
||||
* 05/09/13 1919 mpduff Use parent pfaf instead of lookupId.
|
||||
* 07/09/13 2152 njensen Ensure purgeData() does not load data
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
* 07/16/13 2197 njensen Added hasAnyBasins() and moved getBasins() calls out of loops
|
||||
* Jul 31, 2013 2242 bsteffen Optimize FFMP NavigableMap memory.
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
* Aug 31, 2015 4780 dhladky Corrected guidance basin mosaic averaging logic.
|
||||
* Oct 26, 2015 5056 dhladky Simplified guidance interpolator.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class FFMPBasinData {
|
||||
|
||||
public static final double GUIDANCE_MISSING = -999999.0;
|
||||
|
||||
// defaults
|
||||
@DynamicSerializeElement
|
||||
private String hucLevel;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private Map<Long, FFMPBasin> basins = new HashMap<Long, FFMPBasin>();
|
||||
|
||||
/**
|
||||
* Pending load tasks that need to be run to fully populate basins
|
||||
*/
|
||||
private final List<LoadTask> tasks = new ArrayList<LoadTask>();
|
||||
|
||||
/**
|
||||
* Cache of basins in order for easy population from Load Tasks.
|
||||
*/
|
||||
private final Map<String, FFMPBasin[]> orderedBasinsCache = new HashMap<String, FFMPBasin[]>();
|
||||
|
||||
/**
|
||||
* Shared factory for efficient storage of data in basins.
|
||||
*/
|
||||
private BasinMapFactory<Date> mapFactory = null;
|
||||
|
||||
/**
|
||||
* Public one arg constructor
|
||||
*
|
||||
* @param huc_level
|
||||
*/
|
||||
public FFMPBasinData(String hucLevel) {
|
||||
setHucLevel(hucLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* No arg hibernate constructor
|
||||
*/
|
||||
public FFMPBasinData() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get the basin map
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<Long, FFMPBasin> getBasins() {
|
||||
if (!tasks.isEmpty()) {
|
||||
loadNow();
|
||||
}
|
||||
return basins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the basin map
|
||||
*
|
||||
* @param basins
|
||||
*/
|
||||
public void setBasins(Map<Long, FFMPBasin> basins) {
|
||||
if (!tasks.isEmpty()) {
|
||||
synchronized (tasks) {
|
||||
tasks.clear();
|
||||
orderedBasinsCache.clear();
|
||||
}
|
||||
}
|
||||
this.basins = basins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HUC Level for this map
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getHucLevel() {
|
||||
return hucLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HUC Level for this map
|
||||
*/
|
||||
public void setHucLevel(String hucLevel) {
|
||||
this.hucLevel = hucLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add to the hash
|
||||
*
|
||||
* @param key
|
||||
* @param basin
|
||||
*/
|
||||
public void put(Long key, FFMPBasin basin) {
|
||||
getBasins().put(key, basin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the FFMPBasin from the hash
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public FFMPBasin get(Long key) {
|
||||
return getBasins().get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of pfaf ids from the keys
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getPfafIds() {
|
||||
return new ArrayList<Long>(getBasins().keySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the average value for an aggregation of basins
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param startDate
|
||||
* @param finishDate
|
||||
* @return
|
||||
*/
|
||||
public float getAverageValue(ArrayList<Long> pfaf_ids, Date beforeDate,
|
||||
Date afterDate) {
|
||||
float tvalue = 0.0f;
|
||||
int i = 0;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
tvalue += basin.getValue(beforeDate, afterDate);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
tvalue = tvalue / i;
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the average value for an aggregation of basins
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param exact
|
||||
* date
|
||||
* @return
|
||||
*/
|
||||
public float getAverageValue(ArrayList<Long> pfaf_ids, Date date) {
|
||||
float tvalue = 0.0f;
|
||||
int i = 0;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
tvalue += basin.getValue(date);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
tvalue = tvalue / i;
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the average value for an aggregation of basins
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param date
|
||||
* @param expirationTime
|
||||
* @return
|
||||
*/
|
||||
public float getAverageValue(ArrayList<Long> pfaf_ids, Date date,
|
||||
long epirationTime) {
|
||||
|
||||
float tvalue = 0.0f;
|
||||
int i = 0;
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = getBasins().get(pfaf);
|
||||
if (basin != null) {
|
||||
tvalue += basin.getAverageValue(date, epirationTime);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
tvalue = tvalue / i;
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the average value for an aggregation of basins with areal
|
||||
* weighting
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @return
|
||||
*/
|
||||
public float getAverageValue(ArrayList<Long> pfaf_ids,
|
||||
ArrayList<Double> areas) {
|
||||
|
||||
float tvalue = 0.0f;
|
||||
float tarea = 0.0f;
|
||||
int i = 0;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
if (basin.getValue() != FFMPUtils.MISSING) {
|
||||
tvalue += (basin.getValue() * areas.get(i));
|
||||
tarea += areas.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tvalue < 0.0f) {
|
||||
tvalue = FFMPUtils.MISSING;
|
||||
} else {
|
||||
tvalue = tvalue / tarea;
|
||||
}
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the average value for an aggregation of basins to a given time
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @return
|
||||
*/
|
||||
public float getAccumAverageValue(List<Long> pfaf_ids, Date beforeDate,
|
||||
Date afterDate, long expirationTime, boolean rate) {
|
||||
float tvalue = 0.0f;
|
||||
int i = 0;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
tvalue += basin.getAccumValue(beforeDate, afterDate,
|
||||
expirationTime, rate);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
tvalue = tvalue / i;
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the Max value for a range of times in an aggregation of basins
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param hour
|
||||
* @return
|
||||
*/
|
||||
public float getMaxValue(ArrayList<Long> pfaf_ids, Date beforeDate,
|
||||
Date afterDate) {
|
||||
float tvalue = 0.0f;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
Float value = basin.getValue(beforeDate, afterDate);
|
||||
if (value > tvalue) {
|
||||
tvalue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for mosaic sources
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param date
|
||||
* @param expiration
|
||||
* @return
|
||||
*/
|
||||
public float getAverageMaxValue(List<Long> pfaf_ids, Date date,
|
||||
long expiration) {
|
||||
float tvalue = 0.0f;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
Float value = basin.getAverageValue(date, expiration);
|
||||
if (value > tvalue) {
|
||||
tvalue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for mosaic sources
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param date
|
||||
* @param expiration
|
||||
* @return
|
||||
*/
|
||||
public float getAverageMaxValue(ArrayList<Long> pfaf_ids, Date afterDate,
|
||||
Date beforeDate) {
|
||||
float tvalue = 0.0f;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
Float value = basin.getAverageValue(afterDate, beforeDate);
|
||||
if (value > tvalue) {
|
||||
tvalue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the Max value for a specific time in an aggregation of basins
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param hour
|
||||
* @return
|
||||
*/
|
||||
public float getMaxValue(List<Long> pfaf_ids, Date date) {
|
||||
float tvalue = 0.0f;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
Float value = basin.getValue(date);
|
||||
if (value > tvalue) {
|
||||
tvalue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Average Guidance
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public float getAverageGuidanceValue(List<Long> pfaf_ids,
|
||||
FFMPGuidanceInterpolation interpolation, float guidance,
|
||||
List<Long> forcedPfafs, long expiration) {
|
||||
float tvalue = 0.0f;
|
||||
float value;
|
||||
int i = 0;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
|
||||
if (basin == null) {
|
||||
return guidance;
|
||||
}
|
||||
|
||||
if (basin != null) {
|
||||
FFMPGuidanceBasin fgb = (FFMPGuidanceBasin) basin;
|
||||
if (forcedPfafs.contains(pfaf)) {
|
||||
if (interpolation.isInterpolate()) {
|
||||
value = fgb.getInterpolatedValue(interpolation,
|
||||
expiration);
|
||||
} else {
|
||||
value = fgb.getValue(interpolation.getStandardSource(),
|
||||
interpolation, expiration);
|
||||
}
|
||||
// ignore missing values
|
||||
if (value < -999) {
|
||||
continue;
|
||||
}
|
||||
tvalue += value;
|
||||
i++;
|
||||
} else {
|
||||
if (interpolation.isInterpolate()) {
|
||||
float nvalue;
|
||||
if (new Float(guidance).isNaN()) {
|
||||
nvalue = fgb.getInterpolatedValue(interpolation,
|
||||
expiration);
|
||||
} else {
|
||||
nvalue = guidance;
|
||||
}
|
||||
|
||||
if (nvalue > 0.0f) {
|
||||
tvalue += nvalue;
|
||||
}
|
||||
i++;
|
||||
} else {
|
||||
if (new Float(guidance).isNaN()) {
|
||||
value = fgb.getValue(
|
||||
interpolation.getStandardSource(),
|
||||
interpolation, expiration);
|
||||
} else {
|
||||
value = guidance;
|
||||
}
|
||||
if (value > 0.0f) {
|
||||
tvalue += value;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tvalue == 0.0f) {
|
||||
return Float.NaN;
|
||||
}
|
||||
|
||||
return tvalue / i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the Max value for a guidance aggregation of basins THIS IS
|
||||
* BACKWARDS FROM LOGIC THOUGH!!!!, lower GUIDANCE values are actually worse
|
||||
*
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public float getMaxGuidanceValue(List<Long> pfaf_ids,
|
||||
FFMPGuidanceInterpolation interpolation, long expiration,
|
||||
long parentPfaf) {
|
||||
float tvalue = Float.NaN;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
FFMPGuidanceBasin fgb = (FFMPGuidanceBasin) basin;
|
||||
fgb.setCountyFips(parentPfaf);
|
||||
if (interpolation.isInterpolate()) {
|
||||
float nvalue = fgb.getInterpolatedValue(interpolation,
|
||||
expiration);
|
||||
// ignore missing values
|
||||
if (nvalue < -999) {
|
||||
continue;
|
||||
}
|
||||
if (((nvalue < tvalue) && (nvalue > 0.0f))
|
||||
|| Float.isNaN(tvalue)) {
|
||||
tvalue = nvalue;
|
||||
}
|
||||
} else {
|
||||
float value = fgb.getValue(
|
||||
interpolation.getStandardSource(), interpolation,
|
||||
expiration);
|
||||
// ignore missing values
|
||||
if (value < -999) {
|
||||
continue;
|
||||
}
|
||||
if (((value < tvalue) && (value > 0.0f))
|
||||
|| Float.isNaN(tvalue)) {
|
||||
tvalue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tvalue == 0.0f) {
|
||||
tvalue = Float.NaN;
|
||||
}
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the Accumulated Max value for an aggregation of basins
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param beforeDate
|
||||
* @param afterDate
|
||||
* @return
|
||||
*/
|
||||
public float getAccumMaxValue(List<Long> pfaf_ids, Date beforeDate,
|
||||
Date afterDate, long expirationTime, boolean rate) {
|
||||
float tvalue = 0.0f;
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
|
||||
float val = basin.getAccumValue(afterDate, beforeDate,
|
||||
expirationTime, rate);
|
||||
|
||||
if (val > tvalue) {
|
||||
tvalue = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* used for max ratio and diff calcs
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param interpolation
|
||||
* @return
|
||||
*/
|
||||
public List<Float> getGuidanceValues(List<Long> pfaf_ids,
|
||||
FFMPGuidanceInterpolation interpolation, long expiration) {
|
||||
List<Float> values = new ArrayList<Float>();
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
FFMPGuidanceBasin fgb = (FFMPGuidanceBasin) basin;
|
||||
if (interpolation.isInterpolate()) {
|
||||
values.add(fgb.getInterpolatedValue(interpolation,
|
||||
expiration));
|
||||
} else {
|
||||
values.add(fgb.getValue(interpolation.getStandardSource(),
|
||||
interpolation, expiration));
|
||||
}
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the average guidance value for an aggregate basin
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param interpolation
|
||||
* @param expiration
|
||||
* @return
|
||||
*/
|
||||
public Float getAverageGuidanceValue(List<Long> pfaf_ids,
|
||||
FFMPGuidanceInterpolation interpolation, long expiration) {
|
||||
|
||||
float tvalue = 0.0f;
|
||||
int i = 0;
|
||||
|
||||
List<Float> vals = getGuidanceValues(pfaf_ids, interpolation,
|
||||
expiration);
|
||||
if (vals != null) {
|
||||
for (Float val : vals) {
|
||||
tvalue += val;
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return tvalue / i;
|
||||
}
|
||||
|
||||
/**
|
||||
* used for max ratio and diff calcs
|
||||
*
|
||||
* @param pfaf_ids
|
||||
* @param beforeDate
|
||||
* @param afterDate
|
||||
* @param rate
|
||||
* @return
|
||||
*/
|
||||
public List<Float> getAccumValues(List<Long> pfaf_ids, Date beforeDate,
|
||||
Date afterDate, long expirationTime, boolean rate) {
|
||||
List<Float> values = new ArrayList<Float>();
|
||||
Map<Long, FFMPBasin> localBasins = getBasins();
|
||||
for (Long pfaf : pfaf_ids) {
|
||||
FFMPBasin basin = localBasins.get(pfaf);
|
||||
if (basin != null) {
|
||||
values.add(basin.getAccumValue(beforeDate, afterDate,
|
||||
expirationTime, rate));
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge out old data
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
public void purgeData(Date date) {
|
||||
// remove old tasks before calling getBasins() since that may
|
||||
// cause them to run
|
||||
if (!tasks.isEmpty()) {
|
||||
synchronized (tasks) {
|
||||
Iterator<LoadTask> itr = tasks.iterator();
|
||||
{
|
||||
while (itr.hasNext()) {
|
||||
LoadTask task = itr.next();
|
||||
if (task instanceof LoadMapTask) {
|
||||
LoadMapTask mtask = (LoadMapTask) task;
|
||||
if (mtask.date.before(date)) {
|
||||
itr.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tasks.isEmpty()) {
|
||||
orderedBasinsCache.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
for (FFMPBasin basin : basins.values()) {
|
||||
basin.purgeData(date);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deserialize data from the aggregate record
|
||||
*
|
||||
* @param times
|
||||
*/
|
||||
public void populate(List<Long> times) {
|
||||
if (mapFactory == null) {
|
||||
mapFactory = new BasinMapFactory<Date>(Collections.reverseOrder(),
|
||||
getBasins().size());
|
||||
}
|
||||
|
||||
long[] timesArr = new long[times.size()];
|
||||
for (int i = 0; i < timesArr.length; i += 1) {
|
||||
timesArr[i] = times.get(i);
|
||||
}
|
||||
for (FFMPBasin basin : getBasins().values()) {
|
||||
basin.deserialize(timesArr, mapFactory);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* populates the serialized array/objects
|
||||
*/
|
||||
public void serialize() {
|
||||
for (FFMPBasin basin : getBasins().values()) {
|
||||
basin.serialize();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add basins some basins from a datastoreFile. The basins will not be
|
||||
* loaded immediately, they will be loaded when they are needed.
|
||||
*
|
||||
* @param datastoreFile
|
||||
* - the file containing data.
|
||||
* @param uri
|
||||
* - datauri of record to load
|
||||
* @param siteKey
|
||||
* - siteKey to load
|
||||
* @param cwa
|
||||
* - cwa to load
|
||||
* @param huc
|
||||
* - huc to load
|
||||
* @param sourceName
|
||||
* - the sourceName for the data.
|
||||
* @param date
|
||||
* - the date of the data.
|
||||
* @param orderedPfafs
|
||||
* - a collection of Longs which is in the same order as the data
|
||||
* in the dataStore.
|
||||
* @param aggregate
|
||||
*/
|
||||
public void addBasins(File datastoreFile, String uri, String siteKey,
|
||||
String cwa, String huc, String sourceName, Date date,
|
||||
Collection<Long> orderedPfafs, boolean aggregate) {
|
||||
SourceXML source = FFMPSourceConfigurationManager.getInstance()
|
||||
.getSource(sourceName);
|
||||
boolean guidance = source.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType());
|
||||
String basinsKey = siteKey + ' ' + cwa + ' ' + huc;
|
||||
String datasetGroupPath = uri + DataStoreFactory.DEF_SEPARATOR + cwa
|
||||
+ DataStoreFactory.DEF_SEPARATOR + huc;
|
||||
|
||||
synchronized (tasks) {
|
||||
FFMPBasin[] basins = this.orderedBasinsCache.get(basinsKey);
|
||||
if (basins == null) {
|
||||
basins = new FFMPBasin[orderedPfafs.size()];
|
||||
int j = 0;
|
||||
for (Long pfaf : orderedPfafs) {
|
||||
FFMPBasin basin = this.basins.get(pfaf);
|
||||
if (basin == null) {
|
||||
if (guidance) {
|
||||
basin = new FFMPGuidanceBasin(pfaf, aggregate);
|
||||
} else {
|
||||
if (mapFactory == null) {
|
||||
mapFactory = new BasinMapFactory<Date>(
|
||||
Collections.reverseOrder(),
|
||||
orderedPfafs.size());
|
||||
}
|
||||
basin = new FFMPBasin(pfaf, aggregate, mapFactory);
|
||||
}
|
||||
this.basins.put(pfaf, basin);
|
||||
}
|
||||
basins[j++] = basin;
|
||||
}
|
||||
this.orderedBasinsCache.put(basinsKey, basins);
|
||||
}
|
||||
if (guidance) {
|
||||
tasks.add(new LoadGuidanceMapTask(datastoreFile,
|
||||
datasetGroupPath, basins, date, sourceName));
|
||||
} else {
|
||||
tasks.add(new LoadMapTask(datastoreFile, datasetGroupPath,
|
||||
basins, date));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add virtual basins from a datastoreFile. The basins will not be loaded
|
||||
* immediately, they will be loaded when they are needed.
|
||||
*
|
||||
* @param datastoreFile
|
||||
* - the file containing data.
|
||||
* @param uri
|
||||
* - datauri of record to load
|
||||
* @param dataKey
|
||||
* - dataKey to load
|
||||
* @param cwa
|
||||
* - cwa to load
|
||||
* @param date
|
||||
* - the date of the data.
|
||||
* @param orderedMetadata
|
||||
* - a collection of FFMPVirtualGageBasinMetaData which is in the
|
||||
* same order as the data in the dataStore.
|
||||
*/
|
||||
public void addVirtualBasins(File datastoreFile, String uri,
|
||||
String dataKey, String cwa, Date date,
|
||||
Collection<FFMPVirtualGageBasinMetaData> orderedMetadata) {
|
||||
String basinsKey = dataKey + ' ' + cwa;
|
||||
String datasetGroupPath = uri + DataStoreFactory.DEF_SEPARATOR + cwa
|
||||
+ DataStoreFactory.DEF_SEPARATOR + FFMPRecord.ALL;
|
||||
synchronized (tasks) {
|
||||
FFMPBasin[] basins = this.orderedBasinsCache.get(basinsKey);
|
||||
if (basins == null) {
|
||||
basins = new FFMPBasin[orderedMetadata.size()];
|
||||
int j = 0;
|
||||
for (FFMPVirtualGageBasinMetaData fvgbmd : orderedMetadata) {
|
||||
FFMPBasin basin = this.basins.get(fvgbmd.getLookupId());
|
||||
if (basin == null) {
|
||||
basin = new FFMPVirtualGageBasin(fvgbmd.getLid(),
|
||||
fvgbmd.getParentPfaf(), false);
|
||||
this.basins.put(fvgbmd.getLookupId(), basin);
|
||||
}
|
||||
basins[j++] = basin;
|
||||
}
|
||||
this.orderedBasinsCache.put(basinsKey, basins);
|
||||
}
|
||||
tasks.add(new LoadVirtualMapTask(datastoreFile, datasetGroupPath,
|
||||
basins, date));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not any basins have been put in the basins map. Faster
|
||||
* than calling getBasins().size() or getBasins().isEmpty().
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean hasAnyBasins() {
|
||||
return !basins.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load now.
|
||||
*/
|
||||
public void loadNow() {
|
||||
synchronized (tasks) {
|
||||
if (!tasks.isEmpty()) {
|
||||
FFMPDataRecordLoader.loadRecords(tasks);
|
||||
tasks.clear();
|
||||
orderedBasinsCache.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Base task for loading data from a dataRecord into FFMPBasins
|
||||
*/
|
||||
private class LoadMapTask extends LoadTask {
|
||||
|
||||
protected final FFMPBasin[] basins;
|
||||
|
||||
protected final Date date;
|
||||
|
||||
public LoadMapTask(File datastoreFile, String datasetGroupPath,
|
||||
FFMPBasin[] basins, Date date) {
|
||||
super(datastoreFile, datasetGroupPath);
|
||||
this.basins = basins;
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void process(FloatDataRecord record) {
|
||||
float[] values = record.getFloatData();
|
||||
for (int j = 0; j < values.length; j += 1) {
|
||||
applyValue(basins[j], values[j]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the value to the basin/
|
||||
*/
|
||||
protected void applyValue(FFMPBasin basin, float value) {
|
||||
if (basin.contains(date)) {
|
||||
float curval = basin.getValue(date);
|
||||
// These are QPF and QPE so, 0.0 is a valid amount
|
||||
if (curval >= 0.0f && value >= 0.0f) {
|
||||
basin.setValue(date, (curval + value) / 2);
|
||||
} else if (value >= 0.0f) {
|
||||
basin.setValue(date, value);
|
||||
}
|
||||
// do not overwrite original value
|
||||
} else {
|
||||
// no value at time exists, write regardless
|
||||
basin.setValue(date, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Task for loading data from a dataRecord into FFMPGuidanceBasins
|
||||
*/
|
||||
private class LoadGuidanceMapTask extends LoadMapTask {
|
||||
|
||||
private final String sourceName;
|
||||
|
||||
public LoadGuidanceMapTask(File datastoreFile, String datasetGroupPath,
|
||||
FFMPBasin[] basins, Date date, String sourceName) {
|
||||
super(datastoreFile, datasetGroupPath, basins, date);
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyValue(FFMPBasin basin, float value) {
|
||||
|
||||
FFMPGuidanceBasin gBasin = (FFMPGuidanceBasin) basin;
|
||||
Float curval = gBasin.getValue(date, sourceName);
|
||||
|
||||
if (curval != FFMPUtils.MISSING && !curval.isNaN()) {
|
||||
// average of original and new value
|
||||
if (curval > 0.0f && value > 0.0f) {
|
||||
gBasin.setValue(sourceName, date, (curval + value) / 2);
|
||||
} else {
|
||||
// curval zero, overwrite original value
|
||||
if (curval == 0.0f) {
|
||||
gBasin.setValue(sourceName, date, value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// curval NaN or MISSING, Overwrite original value
|
||||
gBasin.setValue(sourceName, date, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Task for loading data from a dataRecord into FFMPVirtualGageBasins
|
||||
*/
|
||||
private class LoadVirtualMapTask extends LoadMapTask {
|
||||
|
||||
public LoadVirtualMapTask(File datastoreFile, String datasetGroupPath,
|
||||
FFMPBasin[] basins, Date date) {
|
||||
super(datastoreFile, datasetGroupPath, basins, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyValue(FFMPBasin basin, float value) {
|
||||
basin.setValue(date, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,339 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds geometry info for FFMP basins.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 05Aug09 2521 dhladky Setup
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@DynamicSerialize
|
||||
public class FFMPBasinMetaData {
|
||||
|
||||
/** default display name for basin **/
|
||||
@DynamicSerializeElement
|
||||
private String streamName = "XXXX";
|
||||
|
||||
/** default display name for basin **/
|
||||
@DynamicSerializeElement
|
||||
private String hucName = "XXXX";
|
||||
|
||||
/** basin id(key) in GIS **/
|
||||
@DynamicSerializeElement
|
||||
private Integer basinId = 0;
|
||||
|
||||
/** basin id(key) in GIS **/
|
||||
@DynamicSerializeElement
|
||||
private Double area = 0.00;
|
||||
|
||||
/** county **/
|
||||
@DynamicSerializeElement
|
||||
private String county;
|
||||
|
||||
/** state **/
|
||||
@DynamicSerializeElement
|
||||
private String state;
|
||||
|
||||
/** state **/
|
||||
@DynamicSerializeElement
|
||||
private String rfc;
|
||||
|
||||
/** state **/
|
||||
@DynamicSerializeElement
|
||||
private String cwa;
|
||||
|
||||
/** is it the primary cwa **/
|
||||
@DynamicSerializeElement
|
||||
private boolean primaryCwa = false;
|
||||
|
||||
@DynamicSerializeElement
|
||||
public Long pfaf = null;
|
||||
|
||||
@DynamicSerializeElement
|
||||
public Long aggregatedPfaf = null;
|
||||
|
||||
/** aggregated pfafs if applicable **/
|
||||
@DynamicSerializeElement
|
||||
private ArrayList<Long> aggregatedPfafs = null;
|
||||
|
||||
/** stream pfafs if applicable **/
|
||||
@DynamicSerializeElement
|
||||
private ArrayList<Integer> streamPfafs = null;
|
||||
|
||||
public FFMPBasinMetaData() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pfaf_id
|
||||
*/
|
||||
public Long getPfaf() {
|
||||
return pfaf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param basin_id
|
||||
* the basin_id to set
|
||||
*/
|
||||
public void setPfaf(Long pfaf) {
|
||||
this.pfaf = pfaf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cwa
|
||||
*/
|
||||
public String getCwa() {
|
||||
return cwa;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cwa
|
||||
* to set
|
||||
*/
|
||||
public void setCwa(String cwa) {
|
||||
this.cwa = cwa;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the stream name
|
||||
*
|
||||
* @param streamName
|
||||
*/
|
||||
public void setStreamName(String streamName) {
|
||||
this.streamName = streamName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the stream name
|
||||
*
|
||||
* @param streamName
|
||||
*/
|
||||
public String getStreamName() {
|
||||
return streamName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the county name
|
||||
*
|
||||
* @param county
|
||||
*/
|
||||
public void setCounty(String county) {
|
||||
this.county = county;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the county name
|
||||
*
|
||||
* @param county
|
||||
*/
|
||||
public String getCounty() {
|
||||
return county;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the state name
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the state name
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the rfc name
|
||||
*
|
||||
* @param rfc
|
||||
*/
|
||||
public void setRfc(String rfc) {
|
||||
this.rfc = rfc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the rfc name
|
||||
*
|
||||
* @param rfc
|
||||
*/
|
||||
public String getRfc() {
|
||||
return rfc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HUC name
|
||||
*
|
||||
* @param HUCName
|
||||
*/
|
||||
public void setHucName(String hucName) {
|
||||
this.hucName = hucName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HUC name
|
||||
*
|
||||
* @param HUCName
|
||||
*/
|
||||
public String getHucName() {
|
||||
return hucName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the basin_id
|
||||
*/
|
||||
public Integer getBasinId() {
|
||||
return basinId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param basin_id
|
||||
* the basin_id to set
|
||||
*/
|
||||
public void setBasinId(Integer basinId) {
|
||||
this.basinId = basinId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a pfaf for aggregations
|
||||
*
|
||||
* @param pfaf
|
||||
*/
|
||||
public void addPfaf(Long pfaf_id) {
|
||||
aggregatedPfafs.add(pfaf_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of aggregated pfafs for higher HUC levels
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<Long> getAggregatedPfafs() {
|
||||
return aggregatedPfafs;
|
||||
}
|
||||
|
||||
/**
|
||||
* required setter
|
||||
*
|
||||
* @param pfafs
|
||||
*/
|
||||
public void setAggregatedPfafs(ArrayList<Long> aggregatedPfafs) {
|
||||
this.aggregatedPfafs = aggregatedPfafs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pfaf to which this is aggregated into if applicable
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getAggregatedPfaf() {
|
||||
return aggregatedPfaf;
|
||||
}
|
||||
|
||||
/**
|
||||
* required setter
|
||||
*
|
||||
* @param pfaf
|
||||
*/
|
||||
public void setAggregatedPfaf(Long aggregatedPfaf) {
|
||||
this.aggregatedPfaf = aggregatedPfaf;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer buff = new StringBuffer();
|
||||
buff.append("PFAF ID: " + pfaf + "\n");
|
||||
buff.append("CWA : " + cwa + "\n");
|
||||
buff.append("State : " + state + "\n");
|
||||
buff.append("RFC : " + rfc + "\n");
|
||||
buff.append("basinID : " + basinId + "\n");
|
||||
buff.append("Area : " + area + "\n");
|
||||
buff.append("HUC NAME : " + hucName + "\n");
|
||||
buff.append("Stream Name : " + streamName + "\n");
|
||||
buff.append("County : " + county + "\n");
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
public void setPrimaryCwa(boolean primaryCwa) {
|
||||
this.primaryCwa = primaryCwa;
|
||||
}
|
||||
|
||||
public boolean isPrimaryCwa() {
|
||||
return primaryCwa;
|
||||
}
|
||||
|
||||
public void setArea(Double area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public Double getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setStreamPfafs(ArrayList<Integer> streamPfafs) {
|
||||
this.streamPfafs = streamPfafs;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getStreamPfafs() {
|
||||
return streamPfafs;
|
||||
}
|
||||
|
||||
public void addStreamPfaf(Integer streamPfaf) {
|
||||
if (streamPfafs == null) {
|
||||
streamPfafs = new ArrayList<Integer>();
|
||||
}
|
||||
streamPfafs.add(streamPfaf);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets rid of junk stream pfafs
|
||||
*/
|
||||
public void removeZeros() {
|
||||
ArrayList<Integer> removes = new ArrayList<Integer>();
|
||||
for (int streamPfaf : streamPfafs) {
|
||||
if (streamPfaf == 0) {
|
||||
removes.add(streamPfaf);
|
||||
}
|
||||
}
|
||||
streamPfafs.removeAll(removes);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
/**
|
||||
* FFMP Config exception class
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 08/13/2015 4722 dhladky Initial check-in
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPConfigurationException extends Exception {
|
||||
|
||||
/**
|
||||
* Default serial verion UID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* Create an FFMPConfigurationException instance from only a message
|
||||
* @param message
|
||||
*/
|
||||
public FFMPConfigurationException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an FFMPConfigurationException instance from both a message and a cause
|
||||
* @param message
|
||||
* @param cause
|
||||
*/
|
||||
public FFMPConfigurationException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
public class FFMPCounties {
|
||||
public enum CountySort {
|
||||
NAME, ID, DISPLAY_NAME
|
||||
};
|
||||
|
||||
private static CountySort sortBy = CountySort.ID;
|
||||
|
||||
private ArrayList<FFMPCounty> countyArray;
|
||||
|
||||
public FFMPCounties(ArrayList<FFMPCounty> counties) {
|
||||
|
||||
setCounties(counties);
|
||||
}
|
||||
|
||||
public void setCounties(ArrayList<FFMPCounty> counties) {
|
||||
ArrayList<FFMPCounty> removes = new ArrayList<FFMPCounty>();
|
||||
|
||||
for (FFMPCounty county : counties) {
|
||||
if (county.getGid() == null) {
|
||||
removes.add(county);
|
||||
}
|
||||
}
|
||||
|
||||
for (FFMPCounty county : removes) {
|
||||
counties.remove(county);
|
||||
}
|
||||
|
||||
this.countyArray = counties;
|
||||
|
||||
Collections.sort(this.countyArray);
|
||||
}
|
||||
|
||||
public ArrayList<FFMPCounty> getCounties() {
|
||||
return countyArray;
|
||||
}
|
||||
|
||||
public void sortBy(CountySort sortBy) {
|
||||
FFMPCounties.sortBy = sortBy;
|
||||
Collections.sort(countyArray);
|
||||
}
|
||||
|
||||
public static CountySort getSortBy() {
|
||||
return sortBy;
|
||||
}
|
||||
|
||||
public void addCounty(FFMPCounty county) {
|
||||
countyArray.add(county);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPCounties.CountySort;
|
||||
|
||||
/**
|
||||
* County
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 12 Feb, 2010 3915 dhladky Initial creation
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPCounty implements Comparable<FFMPCounty> {
|
||||
private String countyName = null;
|
||||
|
||||
private String state = null;
|
||||
|
||||
private Long gid = null;
|
||||
|
||||
private String countyFips = null;
|
||||
|
||||
private String displayFips = null;
|
||||
|
||||
private String displayCountyName = null;
|
||||
|
||||
public FFMPCounty() {
|
||||
}
|
||||
|
||||
public FFMPCounty(Long gid, String countyName, String countyFips,
|
||||
String state) {
|
||||
this.countyName = countyName;
|
||||
this.state = state;
|
||||
this.gid = gid;
|
||||
this.countyFips = countyFips;
|
||||
|
||||
// Create the display for the county ID list.
|
||||
StringBuilder sb = new StringBuilder(state);
|
||||
sb.append("C").append(this.countyFips.substring(2));
|
||||
this.displayFips = sb.toString();
|
||||
|
||||
// Create the display string for the county name list.
|
||||
sb = new StringBuilder(state).append(",").append(this.countyName);
|
||||
this.displayCountyName = sb.toString();
|
||||
}
|
||||
|
||||
public String getCountyName() {
|
||||
return countyName;
|
||||
}
|
||||
|
||||
public void setCountyName(String countyName) {
|
||||
this.countyName = countyName;
|
||||
}
|
||||
|
||||
public String getCountyFips() {
|
||||
return countyFips;
|
||||
}
|
||||
|
||||
public void setCountyFips(String countyFips) {
|
||||
this.countyFips = countyFips;
|
||||
}
|
||||
|
||||
public Long getGid() {
|
||||
return gid;
|
||||
}
|
||||
|
||||
public void setGid(Long gid) {
|
||||
this.gid = gid;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getDisplayFips() {
|
||||
return displayFips;
|
||||
}
|
||||
|
||||
public void setDisplayFips(String displayFips) {
|
||||
this.displayFips = displayFips;
|
||||
}
|
||||
|
||||
public String getDisplayCountyName() {
|
||||
return displayCountyName;
|
||||
}
|
||||
|
||||
public void setDisplayCountyName(String displayCountyName) {
|
||||
this.displayCountyName = displayCountyName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(FFMPCounty obj) {
|
||||
|
||||
if (obj != null) {
|
||||
|
||||
if (FFMPCounties.getSortBy() == CountySort.NAME) {
|
||||
return this.countyName.compareTo(obj.getCountyName());
|
||||
} else if (FFMPCounties.getSortBy() == CountySort.ID) {
|
||||
return this.countyFips.compareTo(obj.getCountyFips());
|
||||
} else if (FFMPCounties.getSortBy() == CountySort.DISPLAY_NAME) {
|
||||
return this.displayCountyName.compareTo(obj.getDisplayCountyName());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return countyName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,600 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* FFMP Data Container
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 03/31/11 5489 D. Hladky Initial release
|
||||
* 07/31/12 578 D.Hladky finished it
|
||||
* 09/27/12 DR 15471 G.Zhang Fixed ConcurrentModificationException
|
||||
* 01/27/13 1478 D. Hladky Re-worked to help with memory size and NAS read write stress
|
||||
* Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp
|
||||
* 07/03/13 2131 D. Hladky Fixed null pointers thrown by new container creation.
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
public class FFMPDataContainer {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(FFMPDataContainer.class);
|
||||
|
||||
private FFMPBasinData basins;
|
||||
|
||||
private String sourceName = null;
|
||||
|
||||
private boolean isPurged = false;
|
||||
|
||||
public FFMPDataContainer() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Usual constructor
|
||||
*
|
||||
* @param sourceName
|
||||
*/
|
||||
public FFMPDataContainer(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
basins = new FFMPBasinData();
|
||||
}
|
||||
|
||||
/**
|
||||
* special constuctor
|
||||
*
|
||||
* @param sourceName
|
||||
* @param hucs
|
||||
*/
|
||||
public FFMPDataContainer(String sourceName, ArrayList<String> hucs) {
|
||||
// System.out.println("Creating source with hucs: " + sourceName);
|
||||
this.sourceName = sourceName;
|
||||
basins = new FFMPBasinData();
|
||||
}
|
||||
|
||||
/**
|
||||
* new container first time read in from cache
|
||||
*
|
||||
* @param sourceName
|
||||
* @param hucs
|
||||
* @param record
|
||||
*/
|
||||
public FFMPDataContainer(String sourceName, FFMPAggregateRecord record) {
|
||||
// System.out.println("Creating source with hucs: " + sourceName);
|
||||
this.sourceName = sourceName;
|
||||
|
||||
FFMPBasinData basinData = record.getBasins();
|
||||
if (basinData != null) {
|
||||
basinData.populate(record.getTimes());
|
||||
basins = basinData;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds to the cache
|
||||
*
|
||||
* @param date
|
||||
* @param newBasinData
|
||||
*/
|
||||
public void addFFMPEntry(Date date, SourceXML source,
|
||||
FFMPBasinData newBasinData, String siteKey) {
|
||||
|
||||
boolean guid = false;
|
||||
|
||||
if (source.getSourceType().equals(SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
guid = true;
|
||||
}
|
||||
|
||||
FFMPBasinData currBasinData = getBasinData();
|
||||
|
||||
if (currBasinData == null) {
|
||||
setBasinData(newBasinData);
|
||||
} else {
|
||||
|
||||
synchronized (currBasinData) {
|
||||
|
||||
for (Long key : newBasinData.getBasins().keySet()) {
|
||||
|
||||
if (guid) {
|
||||
|
||||
FFMPGuidanceBasin basin = null;
|
||||
|
||||
if (currBasinData.get(key) instanceof FFMPGuidanceBasin) {
|
||||
basin = (FFMPGuidanceBasin) currBasinData.get(key);
|
||||
}
|
||||
|
||||
if (basin == null) {
|
||||
|
||||
FFMPBasin newbasin = newBasinData.get(key);
|
||||
basin = new FFMPGuidanceBasin(key,
|
||||
newbasin.getAggregated());
|
||||
|
||||
if (newbasin instanceof FFMPGuidanceBasin) {
|
||||
|
||||
Float val = ((FFMPGuidanceBasin) newbasin)
|
||||
.getValue(date, source.getSourceName());
|
||||
basin.setValue(source.getSourceName(), date,
|
||||
val);
|
||||
} else {
|
||||
Float val = newbasin.getValue(date);
|
||||
basin.setValue(source.getSourceName(), date,
|
||||
val);
|
||||
}
|
||||
|
||||
syncPut(currBasinData, key, basin);
|
||||
} else {
|
||||
|
||||
FFMPBasin newbasin = newBasinData.get(key);
|
||||
|
||||
if (newbasin instanceof FFMPGuidanceBasin) {
|
||||
|
||||
FFMPGuidanceBasin newGbasin = (FFMPGuidanceBasin) newBasinData
|
||||
.get(key);
|
||||
Float basinVal = basin.getValue(date,
|
||||
source.getSourceName());
|
||||
Float newBasinVal = newGbasin.getValue(date,
|
||||
source.getSourceName());
|
||||
|
||||
if (basinVal != null && basinVal >= 0.0f
|
||||
&& !basinVal.isNaN()
|
||||
&& basinVal != FFMPUtils.MISSING) {
|
||||
|
||||
if (newBasinVal != null
|
||||
&& newBasinVal >= 0.0f
|
||||
&& !newBasinVal.isNaN()
|
||||
&& newBasinVal != FFMPUtils.MISSING) {
|
||||
|
||||
float val = (float) ((basinVal + newBasinVal) / 2.0);
|
||||
basin.setValue(source.getSourceName(),
|
||||
date, val);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (newBasinVal.isNaN()) {
|
||||
newBasinVal = FFMPUtils.MISSING;
|
||||
}
|
||||
|
||||
basin.setValue(source.getSourceName(),
|
||||
date, newBasinVal);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Float basinVal = basin.getValue(date,
|
||||
source.getSourceName());
|
||||
Float newBasinVal = newbasin.getValue();
|
||||
|
||||
if (basinVal != null && basinVal >= 0.0f
|
||||
&& !basinVal.isNaN()
|
||||
&& basinVal != FFMPUtils.MISSING) {
|
||||
|
||||
if (newBasinVal != null
|
||||
&& newBasinVal >= 0.0f
|
||||
&& !newBasinVal.isNaN()
|
||||
&& newBasinVal != FFMPUtils.MISSING) {
|
||||
|
||||
float val = (float) ((basinVal + newBasinVal) / 2.0);
|
||||
basin.setValue(source.getSourceName(),
|
||||
date, val);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (newBasinVal.isNaN()) {
|
||||
newBasinVal = FFMPUtils.MISSING;
|
||||
}
|
||||
|
||||
basin.setValue(source.getSourceName(),
|
||||
date, newBasinVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
FFMPBasin basin = currBasinData.get(key);
|
||||
FFMPBasin newbasin = newBasinData.get(key);
|
||||
Float val = 0.0f;
|
||||
|
||||
if (basin == null) {
|
||||
|
||||
basin = new FFMPBasin(key, newbasin.getAggregated());
|
||||
val = newbasin.getValue(date);
|
||||
|
||||
if (val.isNaN()) {
|
||||
val = 0.0f;
|
||||
}
|
||||
|
||||
basin.setValue(date, val);
|
||||
// currBasinData.put(key, basin);
|
||||
syncPut(currBasinData, key, basin);
|
||||
} else {
|
||||
|
||||
if (basin.getValue(date) != null
|
||||
&& !basin.getValue(date).isNaN()
|
||||
&& basin.getValue(date) != 0.0) {
|
||||
if (newbasin.getValue(date) != null
|
||||
&& !newbasin.getValue(date).isNaN()
|
||||
&& newbasin.getValue(date) != 0.0) {
|
||||
|
||||
val = (float) ((basin.getValue(date) + newbasin
|
||||
.getValue(date)) / 2);
|
||||
}
|
||||
|
||||
} else {
|
||||
val = newbasin.getValue(date);
|
||||
|
||||
if (val.isNaN()) {
|
||||
val = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
basin.setValue(date, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check for the key
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public boolean containsKey(Date date) {
|
||||
boolean contains = false;
|
||||
|
||||
if (getBasinData() != null) {
|
||||
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
contains = basin.getValues().containsKey(date);
|
||||
if (contains == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for the key
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public boolean containsKey(String sourceName) {
|
||||
boolean contains = false;
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
if (basin instanceof FFMPGuidanceBasin) {
|
||||
contains = ((FFMPGuidanceBasin) basin)
|
||||
.containsKey(sourceName);
|
||||
if (contains == true) {
|
||||
// System.out.println("Contains Key: " + sourceName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// System.out.println("No Key: " + sourceName);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the one you are looking for
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FFMPBasinData getBasinData() {
|
||||
if (basins != null) {
|
||||
return basins;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum value in the monitored area.
|
||||
*
|
||||
* @param pfafs
|
||||
* @param backDate
|
||||
* @param currDate
|
||||
* @param expirationTime
|
||||
* @param rate
|
||||
* @return
|
||||
*/
|
||||
public double getMaxValue(ArrayList<Long> pfafs, Date backDate,
|
||||
Date currDate, long expirationTime, boolean rate) {
|
||||
|
||||
double val = getBasinData().getAccumMaxValue(pfafs, currDate, backDate,
|
||||
expirationTime, rate);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for the newest key
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getNewest() {
|
||||
try {
|
||||
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
if (basin instanceof FFMPGuidanceBasin) {
|
||||
((FFMPGuidanceBasin) basin).getGuidValues().lastKey();
|
||||
} else {
|
||||
return basin.getValues().lastKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.debug("No new times available..." + getSourceName());
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for the oldest key
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getOldest() {
|
||||
try {
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
if (basin instanceof FFMPGuidanceBasin) {
|
||||
((FFMPGuidanceBasin) basin).getGuidValues().firstKey();
|
||||
} else {
|
||||
return basin.getValues().firstKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.debug("No old times available..." + getSourceName());
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of ordered time keys
|
||||
*
|
||||
* @param barrierTime
|
||||
* @return
|
||||
*/
|
||||
public List<Date> getOrderedTimes(Date barrierTime) {
|
||||
ArrayList<Date> orderedTimes = new ArrayList<Date>();
|
||||
try {
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
for (Date time : basin.getValues().descendingKeySet()) {
|
||||
if (time.after(barrierTime)) {
|
||||
orderedTimes.add(time);
|
||||
}
|
||||
}
|
||||
|
||||
return orderedTimes;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.debug("No ordered times available..."
|
||||
+ getSourceName());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of times for serialization
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getOrderedTimes() {
|
||||
ArrayList<Long> orderedTimes = new ArrayList<Long>();
|
||||
try {
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
for (Date time : basin.getValues().descendingKeySet()) {
|
||||
orderedTimes.add(time.getTime());
|
||||
}
|
||||
|
||||
return orderedTimes;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.debug("No ordered times available..."
|
||||
+ getSourceName());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source name for this Data Container
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up old junk
|
||||
*
|
||||
* @param backDate
|
||||
*/
|
||||
public void purge(Date backDate) {
|
||||
statusHandler.handle(Priority.INFO, "Purging " + getSourceName()
|
||||
+ " Container back to: " + backDate);
|
||||
getBasinData().purgeData(backDate);
|
||||
setPurged(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Cache data for this container
|
||||
*
|
||||
* @param cacheRecord
|
||||
*/
|
||||
public void setAggregateData(FFMPAggregateRecord cacheRecord) {
|
||||
|
||||
// create a record from the cache record
|
||||
FFMPRecord record = new FFMPRecord(cacheRecord);
|
||||
|
||||
FFMPBasinData dentry = record.getBasinData();
|
||||
|
||||
for (Entry<Long, FFMPBasin> entry : dentry.getBasins().entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
if (basin != null) {
|
||||
if (basin instanceof FFMPGuidanceBasin) {
|
||||
FFMPGuidanceBasin gbasin = (FFMPGuidanceBasin) basin;
|
||||
gbasin.getGuidValues().putAll(
|
||||
((FFMPGuidanceBasin) entry.getValue())
|
||||
.getGuidValues());
|
||||
} else {
|
||||
basin.getValues().putAll(entry.getValue().getValues());
|
||||
}
|
||||
} else {
|
||||
syncPut(getBasinData(), entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a brand new one for new source, or initialization
|
||||
*
|
||||
* @param basins
|
||||
*/
|
||||
public void setBasinData(FFMPBasinData basins) {
|
||||
this.basins = basins;
|
||||
}
|
||||
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for size
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public int size() {
|
||||
|
||||
Map<Long, FFMPBasin> basins = getBasinData().getBasins();
|
||||
|
||||
synchronized (basins) {
|
||||
for (Entry<Long, FFMPBasin> entry : basins.entrySet()) {
|
||||
FFMPBasin basin = entry.getValue();
|
||||
if (basin instanceof FFMPGuidanceBasin) {
|
||||
return ((FFMPGuidanceBasin) basin).getGuidValues().size();
|
||||
} else {
|
||||
return basin.getValues().size();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* DR 15471 lock put() to avoid ConcurrentModificationException
|
||||
*/
|
||||
|
||||
private void syncPut(FFMPBasinData fbd, Long key, FFMPBasin value) {
|
||||
if (fbd == null || key == null)
|
||||
return;
|
||||
|
||||
Map<Long, FFMPBasin> basins = fbd.getBasins();
|
||||
if (basins == null)
|
||||
return;
|
||||
|
||||
synchronized (basins) {
|
||||
basins.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this container has been purged or not
|
||||
*
|
||||
* @param isPurged
|
||||
*/
|
||||
public void setPurged(boolean isPurged) {
|
||||
this.isPurged = isPurged;
|
||||
}
|
||||
|
||||
/**
|
||||
* Has this container been purged?
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPurged() {
|
||||
return isPurged;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,153 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* Implements a bulk retrieval mechanism for FFMP.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 5, 2013 1912 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPDataRecordLoader {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(FFMPDataRecordLoader.class);
|
||||
|
||||
// Anything that needs bulk loading will need to extend this task.
|
||||
public static abstract class LoadTask {
|
||||
|
||||
private final File datastoreFile;
|
||||
|
||||
private final String datasetGroupPath;
|
||||
|
||||
public LoadTask(File datastoreFile, String datasetGroupPath) {
|
||||
this.datastoreFile = datastoreFile;
|
||||
this.datasetGroupPath = datasetGroupPath;
|
||||
}
|
||||
|
||||
public abstract void process(FloatDataRecord record);
|
||||
|
||||
public File getDatastoreFile() {
|
||||
return datastoreFile;
|
||||
}
|
||||
|
||||
public String getDatasetGroupPath() {
|
||||
return datasetGroupPath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk load all records for a set of tasks. Tasks are guaranteed to be
|
||||
* executed in order but the data records will be loaded as efficiently as
|
||||
* possible.
|
||||
*
|
||||
* @param tasks
|
||||
*/
|
||||
public static void loadRecords(List<LoadTask> tasks) {
|
||||
// sort all the tasks by file.
|
||||
Map<File, List<LoadTask>> fileMap = new HashMap<File, List<LoadTask>>();
|
||||
for (LoadTask task : tasks) {
|
||||
List<LoadTask> taskList = fileMap.get(task.getDatastoreFile());
|
||||
if (taskList == null) {
|
||||
taskList = new ArrayList<LoadTask>();
|
||||
fileMap.put(task.getDatastoreFile(), taskList);
|
||||
}
|
||||
taskList.add(task);
|
||||
}
|
||||
Map<LoadTask, FloatDataRecord> dataMap = new HashMap<LoadTask, FloatDataRecord>();
|
||||
// load each file
|
||||
for (Entry<File, List<LoadTask>> fileEntry : fileMap.entrySet()) {
|
||||
IDataStore dataStore = DataStoreFactory.getDataStore(fileEntry
|
||||
.getKey());
|
||||
List<LoadTask> taskList = fileEntry.getValue();
|
||||
// assemble all the paths.
|
||||
String[] datasetGroupPath = new String[taskList.size()];
|
||||
for (int i = 0; i < datasetGroupPath.length; i += 1) {
|
||||
datasetGroupPath[i] = taskList.get(i).getDatasetGroupPath();
|
||||
}
|
||||
// perform the data request.
|
||||
IDataRecord[] dataRecords = null;
|
||||
try {
|
||||
dataRecords = dataStore.retrieveDatasets(datasetGroupPath,
|
||||
Request.ALL);
|
||||
} catch (Exception e) {
|
||||
// If something went wrong try to retrieve each record
|
||||
// individually so only records with errors are skipped.
|
||||
dataRecords = new IDataRecord[datasetGroupPath.length];
|
||||
for (int i = 0; i < datasetGroupPath.length; i += 1) {
|
||||
try {
|
||||
IDataRecord[] drs = dataStore.retrieveDatasets(
|
||||
new String[] { datasetGroupPath[i] },
|
||||
Request.ALL);
|
||||
dataRecords[i] = drs[0];
|
||||
} catch (Exception e1) {
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"FFMPRecord: no data record for: "
|
||||
+ datasetGroupPath, e1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// correlate them in the dataMap.
|
||||
for (int i = 0; i < dataRecords.length; i += 1) {
|
||||
if (dataRecords[i] != null
|
||||
&& dataRecords[i] instanceof FloatDataRecord) {
|
||||
dataMap.put(taskList.get(i),
|
||||
(FloatDataRecord) dataRecords[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// execute all tasks.
|
||||
for (LoadTask task : tasks) {
|
||||
FloatDataRecord rec = dataMap.get(task);
|
||||
if (rec != null) {
|
||||
task.process(rec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
/**
|
||||
* gap for FFMP
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 03/03/11 7334 D. Hladky Initial release
|
||||
* 01/27/13 1478 D. Hladky Added use of constants for calculations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
public class FFMPGap {
|
||||
|
||||
private Date startTime;
|
||||
|
||||
private Date endTime;
|
||||
|
||||
private double gap;
|
||||
|
||||
public FFMPGap() {
|
||||
|
||||
}
|
||||
|
||||
public FFMPGap(Date startTime, Date endTime) {
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setGap(double gap) {
|
||||
this.gap = gap;
|
||||
}
|
||||
|
||||
public double getGap() {
|
||||
return gap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the gaps in the FFMP data
|
||||
*
|
||||
* @param times
|
||||
* @param expirationTime
|
||||
* @param barrierTime
|
||||
* @param mostRecentTime
|
||||
* @return
|
||||
*/
|
||||
public static List<FFMPGap> getGaps(List<Date> times,
|
||||
long expirationTime, Date barrierTime, Date mostRecentTime) {
|
||||
ArrayList<FFMPGap> gaps = new ArrayList<FFMPGap>();
|
||||
long gapStep = expirationTime * TimeUtil.MILLIS_PER_MINUTE;
|
||||
Date prevTime = null;
|
||||
// System.out.println("Calling getGaps()...Recent Time: " + mostRecentTime
|
||||
// + " BarrierTime: " + barrierTime);
|
||||
if (times.size() == 1) {
|
||||
FFMPGap gap = new FFMPGap();
|
||||
long totalMillis = mostRecentTime.getTime() - barrierTime.getTime() - gapStep;
|
||||
float gapMinutes = totalMillis/TimeUtil.MILLIS_PER_MINUTE;
|
||||
if (gapMinutes < 0.0) {
|
||||
gapMinutes = 0.0f;
|
||||
}
|
||||
gap.setGap(gapMinutes);
|
||||
gaps.add(gap);
|
||||
return gaps;
|
||||
}
|
||||
|
||||
for (Date time : times) {
|
||||
// skip times that aren't in the current range
|
||||
if (time.before(barrierTime) || time.after(mostRecentTime)) {
|
||||
// System.out.println("Skipping time: " + time);
|
||||
continue;
|
||||
} else {
|
||||
if (prevTime == null) {
|
||||
prevTime = barrierTime;
|
||||
}
|
||||
}
|
||||
long gapTime = time.getTime() - prevTime.getTime();
|
||||
if (gapTime > gapStep) {
|
||||
FFMPGap gap = new FFMPGap(prevTime, time);
|
||||
// convert to minutes and set gap
|
||||
// Need to subtract the expirationTime from the gapTime as well
|
||||
gap.setGap((gapTime - gapStep) / TimeUtil.MILLIS_PER_MINUTE);
|
||||
gaps.add(gap);
|
||||
}
|
||||
prevTime = time;
|
||||
}
|
||||
|
||||
return gaps;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,474 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FFFGDataMgr;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* FFMP basin/aggregated guidance value holder
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 08/22/10 3437 D. Hladky Initial release
|
||||
* 01/17/13 1478 D. Hladky Removed un-needed XML attributes
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
* Oct 26, 2015 5056 dhladky Simplified Guidance interpolator.
|
||||
* Jun 21, 2016 5704 dhladky Updated getClosest() logic to include 0.0f checks.
|
||||
* Aug 31, 2016 5704 mduff Changed iteration of TreeMap to use navigableKeySet.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class FFMPGuidanceBasin extends FFMPBasin {
|
||||
|
||||
public FFMPGuidanceBasin() {
|
||||
|
||||
}
|
||||
|
||||
@DynamicSerializeElement
|
||||
protected TreeMap<Date, HashMap<String, Float>> guidValues;
|
||||
|
||||
@Transient
|
||||
protected long countyFips = 0l;
|
||||
|
||||
/**
|
||||
* Adds a source/value pair
|
||||
*
|
||||
* @param source
|
||||
* @param value
|
||||
*/
|
||||
public void setValue(String sourceName, Date date, Float dvalue) {
|
||||
if (guidValues.containsKey(date)) {
|
||||
guidValues.get(date).put(sourceName, dvalue);
|
||||
} else {
|
||||
HashMap<String, Float> guids = new HashMap<String, Float>();
|
||||
guids.put(sourceName, dvalue);
|
||||
guidValues.put(date, guids);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the Hash for data
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public TreeMap<Date, HashMap<String, Float>> getGuidValues() {
|
||||
return guidValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the Hash for data
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void setGuidValues(TreeMap<Date, HashMap<String, Float>> guidValues) {
|
||||
this.guidValues = guidValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* used by stand alone guidance displays
|
||||
*
|
||||
* @param date
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public Float getValue(Date date, String sourceName) {
|
||||
if (guidValues.containsKey(date)) {
|
||||
if (guidValues.get(date).containsKey(sourceName)) {
|
||||
return guidValues.get(date).get(sourceName);
|
||||
} else {
|
||||
return Float.NaN;
|
||||
}
|
||||
} else {
|
||||
return Float.NaN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* purge out old entries
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
public void purgeData(Date date) {
|
||||
if (guidValues != null) {
|
||||
synchronized (guidValues) {
|
||||
ArrayList<Date> removes = new ArrayList<Date>();
|
||||
for (Date mdate : guidValues.keySet()) {
|
||||
if (mdate.before(date)) {
|
||||
removes.add(mdate);
|
||||
}
|
||||
}
|
||||
|
||||
for (Date rdate : removes) {
|
||||
guidValues.remove(rdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for a source, only recent date
|
||||
*
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public boolean containsKey(String sourceName) {
|
||||
if (guidValues.firstEntry() != null) {
|
||||
return guidValues.firstEntry().getValue().containsKey(sourceName);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check for a source with the date
|
||||
*
|
||||
* @param date
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public boolean containsKey(Date date, String sourceName) {
|
||||
if (guidValues.containsKey(date)) {
|
||||
HashMap<String, Float> guids = guidValues.get(date);
|
||||
if (guids.containsKey(sourceName)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the most recent value with interpolation delay
|
||||
*
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public Float getValue(String sourceName, long expiration) {
|
||||
Float val = Float.NaN;
|
||||
Date date = getMostRecent(sourceName, expiration);
|
||||
// System.out.println("Most recent date: " + date);
|
||||
|
||||
if (date != null) {
|
||||
val = guidValues.get(date).get(sourceName);
|
||||
// System.out.println("Value: " + val);
|
||||
if (val == null) {
|
||||
val = Float.NaN;
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Value for a FFG source
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public Float getValue(String sourceName,
|
||||
FFMPGuidanceInterpolation interpolation, long expiration) {
|
||||
Float dvalue = Float.NaN;
|
||||
|
||||
dvalue = getValue(sourceName, expiration);
|
||||
|
||||
FFFGDataMgr dman = FFFGDataMgr.getInstance();
|
||||
if (dman.isExpired() == false) {
|
||||
dvalue = dman.adjustValue(dvalue, sourceName, this.pfaf,
|
||||
this.countyFips);
|
||||
}
|
||||
|
||||
return dvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Value for a FFG source stand alone
|
||||
*
|
||||
* @param sourceName
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public Float getValue(String sourceName, Date date,
|
||||
FFMPGuidanceInterpolation interpolation, long expiration) {
|
||||
|
||||
Float dvalue = Float.NaN;
|
||||
Float value = Float.NaN;
|
||||
Date closestDate = getClosest(sourceName, date, expiration);
|
||||
|
||||
if (closestDate != null) {
|
||||
value = getValue(closestDate, sourceName);
|
||||
}
|
||||
|
||||
if (!value.isNaN()) {
|
||||
FFFGDataMgr dman = FFFGDataMgr.getInstance();
|
||||
if (dman.isExpired() == false) {
|
||||
|
||||
dvalue = dman.adjustValue(value, sourceName, this.pfaf,
|
||||
this.countyFips);
|
||||
} else {
|
||||
dvalue = value;
|
||||
}
|
||||
}
|
||||
|
||||
return dvalue;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Youngest Key
|
||||
*
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public Date getMostRecent(String sourceName, long expiration) {
|
||||
|
||||
Date rdate = null;
|
||||
|
||||
if (guidValues != null && guidValues.size() > 0) {
|
||||
|
||||
Date markerDate = guidValues.firstKey();
|
||||
|
||||
for (Date checkDate : guidValues.keySet()) {
|
||||
|
||||
if (guidValues.get(checkDate).containsKey(sourceName)) {
|
||||
float val = guidValues.get(checkDate).get(sourceName);
|
||||
if (val != FFMPUtils.MISSING && val != 0.0f) {
|
||||
|
||||
long time1 = markerDate.getTime();
|
||||
long time2 = checkDate.getTime();
|
||||
|
||||
if ((time1 - time2) < expiration) {
|
||||
rdate = checkDate;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Closest Key
|
||||
*
|
||||
* @param sourceName
|
||||
* @param Date
|
||||
* @param expiration
|
||||
* @return
|
||||
*/
|
||||
public Date getClosest(String sourceName, Date date, long expiration) {
|
||||
|
||||
Date rdate = null;
|
||||
|
||||
if (guidValues != null && guidValues.size() > 0) {
|
||||
|
||||
if (guidValues.containsKey(date)) {
|
||||
if (guidValues.get(date).containsKey(sourceName)) {
|
||||
|
||||
float val = guidValues.get(date).get(sourceName);
|
||||
|
||||
if (val != FFMPUtils.MISSING && val != 0.0f) {
|
||||
rdate = date;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rdate == null) {
|
||||
|
||||
long time1 = date.getTime();
|
||||
|
||||
for (Date checkDate : guidValues.navigableKeySet()) {
|
||||
if (guidValues.get(checkDate).containsKey(sourceName)) {
|
||||
|
||||
float val2 = guidValues.get(checkDate).get(sourceName);
|
||||
|
||||
if (val2 != FFMPUtils.MISSING && val2 != 0.0f) {
|
||||
|
||||
long time2 = checkDate.getTime();
|
||||
// as long as it is +- expiration from orig date,
|
||||
// golden
|
||||
if (date.after(checkDate)) {
|
||||
if ((time1 - time2) < expiration) {
|
||||
rdate = checkDate;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ((time2 - time1) < expiration) {
|
||||
rdate = checkDate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interpolate between guidance sources
|
||||
*
|
||||
* @param interpolation
|
||||
* @param expiration
|
||||
* @return
|
||||
*/
|
||||
public Float getInterpolatedValue(FFMPGuidanceInterpolation interpolation,
|
||||
long expiration) {
|
||||
|
||||
float value1 = 0.0f;
|
||||
float value2 = 0.0f;
|
||||
|
||||
String source1 = interpolation.getSource1();
|
||||
String source2 = interpolation.getSource2();
|
||||
double ratioOffset = interpolation.getInterpolationOffset();
|
||||
// interpolate from zero to first guidance
|
||||
if (source1.equals(source2)) {
|
||||
if ((ratioOffset == Double.NaN) || (ratioOffset == 0.0)) {
|
||||
return Float.NaN;
|
||||
}
|
||||
Float value = getValue(source2, null, expiration);
|
||||
if (value.isNaN()) {
|
||||
// interpolate for this source
|
||||
value2 = interpolation.interpolateSourcePoint(source2, this);
|
||||
} else {
|
||||
value2 = value.floatValue();
|
||||
}
|
||||
|
||||
// straight from awips1 code ( FFMPdataUtils.C )
|
||||
// We have an extrapolation to zero (the low side).
|
||||
// The formula below yields:
|
||||
// coeff = 0.62 for 0.25 time frame (endpoints.second)
|
||||
// coeff = 0.75 for 0.50 time frame (endpoints.second)
|
||||
// coeff = 0.88 for 0.75 time frame (endpoints.second)
|
||||
// coeff = 0.95 for 0.90 time frame (endpoints.second)
|
||||
// float mid, frac;
|
||||
// mid = endpoints.second / 2.0;
|
||||
// frac = 1.0 - ( ( duration - mid ) / mid );
|
||||
// coeff = ( duration / endpoints.second ) + (0.25 * frac);
|
||||
|
||||
if ((interpolation.getHour(source1) == 0)
|
||||
|| (source1.equals(source2) && (interpolation
|
||||
.getHour(source2) == 1))) {
|
||||
Double ratio = new Double(ratioOffset);
|
||||
if (ratio.equals(.25)) {
|
||||
return (float) (.62 * value2);
|
||||
} else if (ratio.equals(.5)) {
|
||||
return (float) (.75 * value2);
|
||||
} else if (ratio.equals(.75)) {
|
||||
return (float) (.88 * value2);
|
||||
} else if (ratio.equals(.9)) {
|
||||
return (float) (.95 * value2);
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise interpolate linearly I guess
|
||||
|
||||
} else {
|
||||
// check if values at the source do not exist
|
||||
Float value = getValue(source1, interpolation, expiration);
|
||||
if (value.isNaN()) {
|
||||
// interpolate a value for this source
|
||||
value1 = interpolation.interpolateSourcePoint(source1, this);
|
||||
} else {
|
||||
value1 = value.floatValue();
|
||||
}
|
||||
value = getValue(source2, interpolation, expiration);
|
||||
if (value.isNaN()) {
|
||||
// interpolate for this source
|
||||
value2 = interpolation.interpolateSourcePoint(source2, this);
|
||||
} else {
|
||||
value2 = value.floatValue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((value1 == Float.NaN) || (value2 == Float.NaN)) {
|
||||
return Float.NaN;
|
||||
}
|
||||
|
||||
return (float) (value1 + ((value2 - value1) * ratioOffset));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor used in producing a new GuidanceBasin
|
||||
*
|
||||
* @param pfaf
|
||||
* @param aggregated
|
||||
*/
|
||||
public FFMPGuidanceBasin(Long pfaf, boolean aggregated) {
|
||||
setPfaf(pfaf);
|
||||
setAggregated(aggregated);
|
||||
|
||||
guidValues = new TreeMap<Date, HashMap<String, Float>>(
|
||||
new Comparator<Date>() {
|
||||
@Override
|
||||
public int compare(Date o1, Date o2) {
|
||||
// Null checks?
|
||||
return (o2.before(o1) ? -1 : (o1.equals(o2) ? 0 : 1));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the countyFips
|
||||
*/
|
||||
public long getCountyFips() {
|
||||
return countyFips;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param countyFips
|
||||
* the countyFips to set
|
||||
*/
|
||||
public void setCountyFips(long countyFips) {
|
||||
this.countyFips = countyFips;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuffer buff = new StringBuffer();
|
||||
buff.append("PFAF ID: " + pfaf + "\n");
|
||||
buff.append("Aggregated : " + aggregated + "\n");
|
||||
for (Date date : guidValues.keySet()) {
|
||||
for (String source : guidValues.get(date).keySet())
|
||||
buff.append("Source: " + source + " Value : "
|
||||
+ guidValues.get(source) + "\n");
|
||||
}
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
public void deserialize(List<Long> times) {
|
||||
// does nothing here, this class is serialized as is.
|
||||
}
|
||||
|
||||
/**
|
||||
* populates the serialized array
|
||||
*/
|
||||
public void serialize() {
|
||||
// does nothing here, this class is serialized as is.
|
||||
}
|
||||
}
|
|
@ -0,0 +1,299 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FFFGDataMgr;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductXML;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* Guidance Interpolation
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 29 Jan, 2010 3915 dhladky Initial creation
|
||||
* 01/27/13 1478 dhladky Added use of constants
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPGuidanceInterpolation {
|
||||
|
||||
public String primarySource = null;
|
||||
|
||||
public FFMPSourceConfigurationManager manager = null;
|
||||
|
||||
public HashMap<String, Boolean> interpolationOffsets = null;
|
||||
|
||||
// all hours
|
||||
public ArrayList<Double> orderedHours = new ArrayList<Double>();
|
||||
|
||||
private ArrayList<String> interpolationSources = new ArrayList<String>();
|
||||
|
||||
private double interpolationOffset = 0;
|
||||
|
||||
private boolean isInterpolate = false;
|
||||
|
||||
private ProductRunXML productRun;
|
||||
|
||||
private ProductXML product;
|
||||
|
||||
private String guidType;
|
||||
|
||||
private String siteKey;
|
||||
|
||||
public FFMPGuidanceInterpolation(FFMPSourceConfigurationManager manager,
|
||||
ProductXML product, ProductRunXML productRun, String primarySource,
|
||||
String ffgName, String siteKey) {
|
||||
|
||||
this.manager = manager;
|
||||
this.primarySource = primarySource;
|
||||
this.productRun = productRun;
|
||||
this.product = product;
|
||||
this.guidType = ffgName;
|
||||
this.siteKey = siteKey;
|
||||
interpolationOffsets = new HashMap<String, Boolean>();
|
||||
|
||||
for (SourceXML source : productRun.getGuidanceSources(product, ffgName)) {
|
||||
if (source.isInterpolatedGuidanceTransition()) {
|
||||
if (true) {
|
||||
interpolationOffsets.put(source.getSourceName(),
|
||||
source.getInterpolatedGuidanceDelay());
|
||||
orderedHours.add(getHour(source.getSourceName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(orderedHours, new SortNumber());
|
||||
}
|
||||
|
||||
public double getHour(String source) {
|
||||
SourceXML sourceXml = manager.getSource(source);
|
||||
return sourceXml.getDurationHour();
|
||||
}
|
||||
|
||||
private String getSource(double i) {
|
||||
String rsource = null;
|
||||
ArrayList<SourceXML> sources = productRun.getGuidanceSources(product,
|
||||
guidType);
|
||||
for (SourceXML source : sources) {
|
||||
if (getHour(source.getSourceName()) == i) {
|
||||
rsource = source.getSourceName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rsource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort by double
|
||||
*
|
||||
* @author dhladky
|
||||
*
|
||||
*/
|
||||
public class SortNumber implements Comparator<Double> {
|
||||
|
||||
@Override
|
||||
public int compare(Double o1, Double o2) {
|
||||
|
||||
return o1.compareTo(o2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the source(s) used for getting guidance data
|
||||
*
|
||||
* @param time
|
||||
*/
|
||||
public void setInterpolationSources(double time) {
|
||||
|
||||
Double previous = null;
|
||||
boolean skip = false;
|
||||
interpolationSources.clear();
|
||||
|
||||
int index = 0;
|
||||
for (index = 0; index < orderedHours.size(); ++index) {
|
||||
Double i = orderedHours.get(index);
|
||||
if (time == i) {
|
||||
interpolationSources.add(getSource(i));
|
||||
// System.err.println("0: Time == " + i);
|
||||
skip = true;
|
||||
break;
|
||||
} else if (time < i) {
|
||||
if (previous == null) {
|
||||
interpolationSources
|
||||
.add(getSource(orderedHours.get(index)));
|
||||
interpolationSources
|
||||
.add(getSource(orderedHours.get(index)));
|
||||
// System.err.println("1: " + time /
|
||||
// orderedHours.get(index));
|
||||
setInterpolationOffset(time / orderedHours.get(index));
|
||||
isInterpolate = true;
|
||||
skip = true;
|
||||
break;
|
||||
} else {
|
||||
interpolationSources.add(getSource(orderedHours
|
||||
.get(index - 1)));
|
||||
interpolationSources
|
||||
.add(getSource(orderedHours.get(index)));
|
||||
double totaldiff = orderedHours.get(index)
|
||||
- orderedHours.get(index - 1);
|
||||
double timediff = time - orderedHours.get(index - 1);
|
||||
// System.err.println("2: " + timediff / totaldiff);
|
||||
setInterpolationOffset(timediff / totaldiff);
|
||||
isInterpolate = true;
|
||||
skip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
previous = i;
|
||||
}
|
||||
// if the loop has exited and time is still > previous it is higher than
|
||||
// max
|
||||
if (!skip && (time > previous)) {
|
||||
interpolationSources.add(getSource(orderedHours.get(index - 1)));
|
||||
interpolationSources.add(getSource(orderedHours.get(index - 1)));
|
||||
// System.err.println("3: NaN");
|
||||
setInterpolationOffset(Double.NaN);
|
||||
isInterpolate = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void setInterpolationOffset(double interpolationOffset) {
|
||||
this.interpolationOffset = interpolationOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* offset from the time
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getInterpolationOffset() {
|
||||
return interpolationOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sources for interpolation / or not
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<String> getInterpolationSources() {
|
||||
return interpolationSources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not interpolating
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getStandardSource() {
|
||||
return interpolationSources.get(0);
|
||||
}
|
||||
|
||||
public String getSource1() {
|
||||
if (interpolationSources.size() > 0) {
|
||||
return interpolationSources.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getSource2() {
|
||||
if (interpolationSources.size() > 1) {
|
||||
return interpolationSources.get(1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isInterpolate() {
|
||||
return isInterpolate;
|
||||
}
|
||||
|
||||
public Float interpolateSourcePoint(String source, FFMPGuidanceBasin basin) {
|
||||
double hour = getHour(source);
|
||||
// System.err.println("interpolating for " + source);
|
||||
|
||||
FFFGDataMgr dman = FFFGDataMgr.getInstance();
|
||||
Float lowVal = Float.NaN;
|
||||
double lowHour = 0;
|
||||
|
||||
Float highVal = Float.NaN;
|
||||
double highHour = 0;
|
||||
|
||||
boolean skip = false;
|
||||
|
||||
for (int index = 0; index < orderedHours.size(); ++index) {
|
||||
Double thisHour = orderedHours.get(index);
|
||||
Float thisVal = basin
|
||||
.getValue(
|
||||
getSource(orderedHours.get(index)),
|
||||
null,
|
||||
manager.getSource(source).getExpirationMinutes(
|
||||
siteKey) * TimeUtil.MILLIS_PER_MINUTE);
|
||||
if (dman.isExpired() == false) {
|
||||
|
||||
thisVal = dman.adjustValue(thisVal,
|
||||
getSource(orderedHours.get(index)), basin.getPfaf(),
|
||||
basin.getCountyFips());
|
||||
}
|
||||
|
||||
if (thisVal.isNaN()) {
|
||||
break;
|
||||
}
|
||||
if ((hour > thisHour) && !thisVal.isNaN()) {
|
||||
lowVal = thisVal;
|
||||
lowHour = thisHour;
|
||||
} else if ((hour <= thisHour) && !thisVal.isNaN()) {
|
||||
skip = true;
|
||||
highVal = thisVal;
|
||||
highHour = thisHour;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (skip == false) {
|
||||
// this means there is no hour higher, return NaN;
|
||||
// System.err.println("\tNo higher hour");
|
||||
return Float.NaN;
|
||||
} else {
|
||||
// System.err.println("\tfrom " + lowHour + " to " + highHour);
|
||||
// calculate offset
|
||||
double totalDiff = highHour - lowHour;
|
||||
double timeDiff = hour - lowHour;
|
||||
double offset = timeDiff / totalDiff;
|
||||
// calculate value and return it
|
||||
return (float) (lowVal + ((highVal - lowVal) * offset));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,705 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IHDFFilePathProvider;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.StorageException;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.xml.DomainXML;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.util.ImmutableDate;
|
||||
|
||||
/**
|
||||
* Record implementation for FFMP plugin
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jun 03, 2009 2521 D. Hladky Initial release
|
||||
* Jan 27, 2013 1478 D. Hladky OUN memory help
|
||||
* Feb 28, 2013 1729 dhladky Supressed un-necessary debug loggers
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Apr,09, 2013 1890 dhladky Moved dates to referenced map in record
|
||||
* rather than multiple dates in FFMPBasin
|
||||
* objs.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp
|
||||
* Apr 18, 2013 1919 dhladky Added method for VGB loading
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed XML annotations
|
||||
* May 01, 2014 3026 mpduff Added metadata column.
|
||||
* Jun 11, 2014 2061 bsteffen Remove IDecoderGettable
|
||||
* Jul 23, 2015 2360 rferrel Add name to unique constraint.
|
||||
* Oct 10, 2015 4756 dhladky Got rid of e.printStacks.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ffmpseq")
|
||||
@Table(name = "ffmp", uniqueConstraints = { @UniqueConstraint(name = "uk_ffmp_datauri_fields", columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "ffmp", indexes = { @Index(name = "ffmp_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
public class FFMPRecord extends PersistablePluginDataObject implements
|
||||
IPersistable {
|
||||
|
||||
private static final long serialVersionUID = 76774564365671L;
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
private String wfo;
|
||||
|
||||
@Column(length = 32)
|
||||
@DataURI(position = 2)
|
||||
@DynamicSerializeElement
|
||||
private String sourceName;
|
||||
|
||||
@Column(length = 32)
|
||||
@DataURI(position = 3)
|
||||
@DynamicSerializeElement
|
||||
private String dataKey;
|
||||
|
||||
@Column(length = 32)
|
||||
@DataURI(position = 4)
|
||||
@DynamicSerializeElement
|
||||
private String siteKey;
|
||||
|
||||
@Column(length = 255)
|
||||
@DynamicSerializeElement
|
||||
private String metaData;
|
||||
|
||||
@Transient
|
||||
private FFMPBasinData basins = new FFMPBasinData();;
|
||||
|
||||
@Transient
|
||||
private int expiration = 0;
|
||||
|
||||
@Transient
|
||||
private boolean isRate = false;
|
||||
|
||||
protected static ConcurrentMap<Long, WeakReference<ImmutableDate>> cacheTimes = new ConcurrentHashMap<Long, WeakReference<ImmutableDate>>();
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(FFMPRecord.class);
|
||||
|
||||
/** ALL HUC LEVEL **/
|
||||
public static final String ALL = "ALL";
|
||||
|
||||
/** COUNTY HUC LEVEL **/
|
||||
public static final String COUNTY = "COUNTY";
|
||||
|
||||
/** VIRTUAL HUC LEVEL **/
|
||||
public static final String VIRTUAL = "VIRTUAL";
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public FFMPRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a record from a dataURI
|
||||
*
|
||||
* @param uri
|
||||
* The dataURI
|
||||
* @param tableDef
|
||||
* The table definition associated with this class
|
||||
*/
|
||||
public FFMPRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
public enum CLICK_TYPE {
|
||||
|
||||
UP_DOWN("both"), UP("up"), DOWN("DOWN"), TREND("TREND"), CLEAR("CLEAR");
|
||||
|
||||
private final String clickName;
|
||||
|
||||
private CLICK_TYPE(String name) {
|
||||
clickName = name;
|
||||
}
|
||||
|
||||
public String getClickName() {
|
||||
return clickName;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ZOOM levels in FFMP
|
||||
*
|
||||
* @author dhladky
|
||||
*
|
||||
*/
|
||||
public enum ZOOM {
|
||||
|
||||
WFO("WFO"), AGGREGATE("AGGREGATE"), BASIN("BASIN");
|
||||
|
||||
private final String zoomLevel;
|
||||
|
||||
private ZOOM(String name) {
|
||||
zoomLevel = name;
|
||||
}
|
||||
|
||||
public String getZoom() {
|
||||
return zoomLevel;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the of columns you can label by
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum LABEL {
|
||||
|
||||
COUNTY("countyname"), STREAM("streamname"), HUC("huc_name"), PFAF(
|
||||
"pfaf_id");
|
||||
|
||||
private final String labelName;
|
||||
|
||||
private LABEL(String name) {
|
||||
labelName = name;
|
||||
}
|
||||
|
||||
public String getLabelName() {
|
||||
return labelName;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the data fields for FFMP
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum FIELDS {
|
||||
NAME("name"), RATE("rate"), QPE("qpe"), QPF("qpf"), GUIDANCE("guidance"), RATIO(
|
||||
"ratio"), DIFF("diff"), VIRTUAL("virtual");
|
||||
|
||||
private final String fieldName;
|
||||
|
||||
private FIELDS(String name) {
|
||||
fieldName = name;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the units
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String getUnitType(FIELDS field) {
|
||||
String unit = null;
|
||||
if (field == FIELDS.RATE) {
|
||||
unit = "in/hr";
|
||||
} else if ((field == FIELDS.QPE) || (field == FIELDS.QPF)
|
||||
|| (field == FIELDS.GUIDANCE) || (field == FIELDS.DIFF)) {
|
||||
unit = "in";
|
||||
} else if (field == FIELDS.RATIO) {
|
||||
unit = "%";
|
||||
}
|
||||
|
||||
return unit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the correct text for the screen string
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String getFieldLongDescription(FIELDS field) {
|
||||
String desc = null;
|
||||
if (field == FIELDS.RATE) {
|
||||
desc = "Instantaneous Precip Rate";
|
||||
} else if (field == FIELDS.QPE) {
|
||||
desc = "Precipitation Accumulation";
|
||||
} else if (field == FIELDS.QPF) {
|
||||
desc = "Precipitation Accumulation";
|
||||
} else if (field == FIELDS.GUIDANCE) {
|
||||
desc = "Precip Guidance";
|
||||
} else if (field == FIELDS.DIFF) {
|
||||
desc = "Precip - Guidance Diff";
|
||||
} else if (field == FIELDS.RATIO) {
|
||||
desc = "Precip / Guidance Ratio";
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the site
|
||||
*
|
||||
* @param site
|
||||
*/
|
||||
public void setWfo(String wfo) {
|
||||
this.wfo = wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the wfo
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getWfo() {
|
||||
return wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sourceName
|
||||
*
|
||||
* @param sourceName
|
||||
*/
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sourceName
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* finds the correct basin bin by hucName to place into
|
||||
*
|
||||
* @param basins
|
||||
* @param hucName
|
||||
*/
|
||||
|
||||
public void setBasinData(FFMPBasinData basins) {
|
||||
this.basins = basins;
|
||||
}
|
||||
|
||||
/**
|
||||
* finds the correct basin bin by hucName to place into
|
||||
*
|
||||
* @param basins
|
||||
* @param hucName
|
||||
*/
|
||||
public FFMPBasinData getBasinData() {
|
||||
return basins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Hash out of the datastore by HUC
|
||||
*
|
||||
* @param dataStore
|
||||
* @param huc
|
||||
*/
|
||||
public void retrieveMapFromDataStore(File datastoreFile, String uri,
|
||||
FFMPTemplates template, Date date, String sourceName)
|
||||
throws Exception {
|
||||
|
||||
FFMPBasinData fbd = getBasinData();
|
||||
ImmutableDate idate = getCacheDate(date);
|
||||
boolean aggregate = false;
|
||||
|
||||
for (DomainXML domain : template.getDomains()) {
|
||||
|
||||
LinkedHashMap<Long, ?> map = template.getMap(getSiteKey(),
|
||||
domain.getCwa(), FFMPRecord.ALL);
|
||||
|
||||
if ((map != null) && !map.isEmpty()) {
|
||||
fbd.addBasins(datastoreFile, uri, getSiteKey(),
|
||||
domain.getCwa(), FFMPRecord.ALL, sourceName, idate,
|
||||
map.keySet(), aggregate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void retrieveMapFromDataStore(FFMPTemplates template)
|
||||
throws Exception {
|
||||
retrieveMapFromDataStore(getDataStoreFile(), getDataURI(), template,
|
||||
getDataTime().getRefTime(), getSourceName());
|
||||
}
|
||||
|
||||
public void retrieveVirtualMapFromDataStore(FFMPTemplates template)
|
||||
throws Exception {
|
||||
retrieveVirtualMapFromDataStore(getDataStoreFile(), getDataURI(),
|
||||
template, getDataTime().getRefTime(), getSourceName());
|
||||
}
|
||||
|
||||
private File getDataStoreFile() {
|
||||
IHDFFilePathProvider pathProvider = getHDFPathProvider();
|
||||
|
||||
String path = pathProvider.getHDFPath(getPluginName(), this);
|
||||
String fileName = pathProvider.getHDFFileName(getPluginName(), this);
|
||||
|
||||
File datastoreFile = new File(getPluginName() + IPathManager.SEPARATOR
|
||||
+ path + IPathManager.SEPARATOR + fileName);
|
||||
return datastoreFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single basin out of the dataStore
|
||||
*
|
||||
* @param dataStore
|
||||
* @param huc
|
||||
*/
|
||||
public void retrieveBasinFromDataStore(IDataStore dataStore, String uri,
|
||||
FFMPTemplates template, String huc, Date date, String sourceName,
|
||||
FFMPBasin basin) {
|
||||
try {
|
||||
|
||||
SourceXML source = FFMPSourceConfigurationManager.getInstance()
|
||||
.getSource(sourceName);
|
||||
Long pfaf = basin.getPfaf();
|
||||
ImmutableDate idate = getCacheDate(date);
|
||||
|
||||
for (DomainXML domain : template.getDomains()) {
|
||||
|
||||
LinkedHashMap<Long, ?> map = template.getMap(getSiteKey(),
|
||||
domain.getCwa(), huc);
|
||||
|
||||
if ((map != null) && (map.get(pfaf) != null)) {
|
||||
|
||||
int index = 0;
|
||||
for (Long pfafToCheck : map.keySet()) {
|
||||
if (pfafToCheck.equals(pfaf)) {
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
try {
|
||||
IDataRecord rec = dataStore.retrieve(
|
||||
uri + DataStoreFactory.DEF_SEPARATOR
|
||||
+ domain.getCwa(), huc,
|
||||
Request.buildPointRequest(new Point(index, 0)));
|
||||
|
||||
if (rec != null) {
|
||||
float[] values = ((FloatDataRecord) rec)
|
||||
.getFloatData();
|
||||
|
||||
boolean isFFG = false;
|
||||
|
||||
if (source.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
isFFG = true;
|
||||
}
|
||||
|
||||
if (values != null) {
|
||||
// System.err.println(sourceName);
|
||||
if (isFFG) {
|
||||
((FFMPGuidanceBasin) basin).setValue(
|
||||
sourceName, idate, values[0]);
|
||||
} else {
|
||||
basin.setValue(idate, values[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"ERROR Retrieving Map for URI: " + uri + "..."
|
||||
+ huc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.ERROR, "ERROR Retrieving HUC..."
|
||||
+ huc);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Virtual Hash out of the datastore by HUC
|
||||
*
|
||||
* @param dataStore
|
||||
* @param huc
|
||||
*/
|
||||
public void retrieveVirtualMapFromDataStore(File datastoreFile, String uri,
|
||||
FFMPTemplates template, Date date, String sourceName)
|
||||
throws StorageException, FileNotFoundException {
|
||||
FFMPBasinData fbd = getBasinData();
|
||||
String key = getDataKey();
|
||||
ImmutableDate idate = getCacheDate(date);
|
||||
|
||||
for (DomainXML domain : template.getDomains()) {
|
||||
|
||||
LinkedHashMap<String, FFMPVirtualGageBasinMetaData> lids = template
|
||||
.getVirtualGageBasins(key, domain.getCwa());
|
||||
|
||||
if (lids != null) {
|
||||
int size = lids.size();
|
||||
|
||||
if (size > 0) {
|
||||
fbd.addVirtualBasins(datastoreFile, uri, key,
|
||||
domain.getCwa(), idate, lids.values());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Virtual Hash out of the datastore by HUC
|
||||
*
|
||||
* @param dataStore
|
||||
* @param huc
|
||||
*/
|
||||
public void retrieveVirtualBasinFromDataStore(File datastoreFile,
|
||||
String uri, FFMPTemplates template, Date date, FFMPBasin basin) {
|
||||
try {
|
||||
// Should this be retrieving a single basin instead of all of them?
|
||||
retrieveVirtualMapFromDataStore(datastoreFile, uri, template, date,
|
||||
uri);
|
||||
} catch (Throwable e) {
|
||||
statusHandler.handle(Priority.ERROR, "ERROR Retrieving Virtual..."
|
||||
+ ALL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for debugging.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("\n dataURI: " + getDataURI() + "\n");
|
||||
if (basins != null) {
|
||||
for (Long key : basins.getBasins().keySet()) {
|
||||
sb.append(key + " : " + basins.get(key).getValue() + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("WFO/CWA: " + getWfo() + "\n");
|
||||
sb.append("SourceName: " + getSourceName() + "\n");
|
||||
sb.append("SiteKey: " + getSiteKey() + "\n");
|
||||
sb.append("DataKey: " + getDataKey() + "\n");
|
||||
sb.append("dataTime: "
|
||||
+ getDataTime().getValidTime().getTime().toString() + "\n");
|
||||
sb.append("PersistanceTime: " + getPersistenceTime().toString() + "\n");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets you the path to the FFMP data
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDataPath() {
|
||||
return getWfo() + File.separator + getSourceName() + File.separator
|
||||
+ getDataKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* corresponds to What is processed in the FFMPRunConfig
|
||||
*
|
||||
* @param dataKey
|
||||
*/
|
||||
public void setDataKey(String dataKey) {
|
||||
this.dataKey = dataKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* corresponds to What is processed in the FFMPRunConfig
|
||||
*/
|
||||
public String getDataKey() {
|
||||
return dataKey;
|
||||
}
|
||||
|
||||
public void setExpiration(int expiration) {
|
||||
this.expiration = expiration;
|
||||
}
|
||||
|
||||
public int getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
|
||||
public void setRate(boolean isRate) {
|
||||
this.isRate = isRate;
|
||||
}
|
||||
|
||||
public boolean isRate() {
|
||||
return isRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the metaData
|
||||
*/
|
||||
public String getMetaData() {
|
||||
return metaData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param metaData
|
||||
* the metaData to set
|
||||
*/
|
||||
public void setMetaData(String metaData) {
|
||||
this.metaData = metaData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purges out old data
|
||||
*
|
||||
* @param date
|
||||
*/
|
||||
public void purgeData(Date date) {
|
||||
basins.purgeData(date);
|
||||
}
|
||||
|
||||
public void setSiteKey(String siteKey) {
|
||||
this.siteKey = siteKey;
|
||||
}
|
||||
|
||||
public String getSiteKey() {
|
||||
return siteKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fully populated aggregate record
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FFMPAggregateRecord getAggregateRecord() {
|
||||
FFMPAggregateRecord fdcr = new FFMPAggregateRecord();
|
||||
|
||||
fdcr.setBasins(basins);
|
||||
|
||||
return fdcr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and populates a version of this record from an aggregate record
|
||||
*
|
||||
* @param fdcr
|
||||
*/
|
||||
public FFMPRecord(FFMPAggregateRecord fdcr) {
|
||||
|
||||
List<Long> times = fdcr.getTimes();
|
||||
FFMPBasinData fdcrBasins = fdcr.getBasins();
|
||||
fdcrBasins.populate(times);
|
||||
setBasinData(fdcrBasins);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets and maintains the list of times. This will lesson memory consumption
|
||||
* because it means all FFMPBasin TreeMap date keys reference back to this
|
||||
* Hash. Seeing as there are 10000+ of those this will certainly help.
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
protected ImmutableDate getCacheDate(Date date) {
|
||||
|
||||
WeakReference<ImmutableDate> idate = cacheTimes.get(date.getTime());
|
||||
ImmutableDate myDate = null;
|
||||
|
||||
if (idate != null) {
|
||||
myDate = idate.get();
|
||||
}
|
||||
|
||||
if (myDate == null) {
|
||||
long time = date.getTime();
|
||||
myDate = new ImmutableDate(time);
|
||||
idate = new WeakReference<ImmutableDate>(myDate);
|
||||
cacheTimes.putIfAbsent(time, idate);
|
||||
}
|
||||
|
||||
return myDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate data from the cache files
|
||||
*
|
||||
* @param basins
|
||||
* @param hucName
|
||||
*/
|
||||
public void populate(FFMPBasinData basins) {
|
||||
setBasinData(basins);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "ffmp";
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,94 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds VGB FFMP basin PC and PP data.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 02may10 3937 dhladky Setup
|
||||
* 01/27/13 1478 dhladky Removed un-needed XML annotations
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class FFMPVirtualGageBasin extends FFMPBasin {
|
||||
|
||||
public FFMPVirtualGageBasin() {
|
||||
|
||||
}
|
||||
|
||||
@DynamicSerializeElement
|
||||
public String lid;
|
||||
|
||||
public String getLid() {
|
||||
return lid;
|
||||
}
|
||||
|
||||
public void setLid(String lid) {
|
||||
this.lid = lid;
|
||||
}
|
||||
|
||||
/**
|
||||
* useful constructor
|
||||
*/
|
||||
public FFMPVirtualGageBasin(String lid, Long pfaf, boolean aggregated) {
|
||||
setLid(lid);
|
||||
setPfaf(pfaf);
|
||||
setAggregated(aggregated);
|
||||
values = new TreeMap<Date, Float>(new Comparator<Date>() {
|
||||
@Override
|
||||
public int compare(Date o1, Date o2) {
|
||||
// Null checks?
|
||||
return (o2.before(o1) ? -1 : (o1.equals(o2) ? 0 : 1));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
StringBuffer buff = new StringBuffer();
|
||||
buff.append("LID: " + lid + "\n");
|
||||
buff.append("PFAF ID: " + pfaf + "\n");
|
||||
buff.append("Aggregated : " + aggregated + "\n");
|
||||
for (Date date : values.keySet()) {
|
||||
buff.append("Value : " + values.get(date) + "\n");
|
||||
}
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds VGB FFMP basin Meta Data.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 01may10 3937 dhladky Setup
|
||||
* 01mar13 DR13228 gzhang Add basin state
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@DynamicSerialize
|
||||
public class FFMPVirtualGageBasinMetaData {
|
||||
|
||||
/** basin id(key) in GIS **/
|
||||
@DynamicSerializeElement
|
||||
public String lid;
|
||||
|
||||
/** which pfaf (basin) it is in **/
|
||||
@DynamicSerializeElement
|
||||
public Long parentPfaf;
|
||||
|
||||
/** basin description **/
|
||||
@DynamicSerializeElement
|
||||
public String name;
|
||||
|
||||
/** basin county **/
|
||||
@DynamicSerializeElement
|
||||
public String county;
|
||||
|
||||
/** basin state DR 13228 **/
|
||||
@DynamicSerializeElement
|
||||
public String state;
|
||||
|
||||
/** basin county **/
|
||||
@DynamicSerializeElement
|
||||
public String cwa;
|
||||
|
||||
/** VGB coordinate **/
|
||||
@DynamicSerializeElement
|
||||
public Coordinate coordinate = new Coordinate();
|
||||
|
||||
/** unique id for the gage in a data source */
|
||||
@DynamicSerializeElement
|
||||
public Long lookupId;
|
||||
|
||||
public FFMPVirtualGageBasinMetaData() {
|
||||
|
||||
}
|
||||
|
||||
public String getLid() {
|
||||
return lid;
|
||||
}
|
||||
|
||||
public void setLid(String lid) {
|
||||
this.lid = lid;
|
||||
}
|
||||
|
||||
public Coordinate getCoordinate() {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
public void setCoordinate(Coordinate coordinate) {
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCounty() {
|
||||
return county;
|
||||
}
|
||||
|
||||
public void setCounty(String county) {
|
||||
this.county = county;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;// DR 13228
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;// DR 13228
|
||||
}
|
||||
|
||||
public Long getParentPfaf() {
|
||||
return parentPfaf;
|
||||
}
|
||||
|
||||
public void setParentPfaf(Long parentPfaf) {
|
||||
this.parentPfaf = parentPfaf;
|
||||
}
|
||||
|
||||
public String getCwa() {
|
||||
return cwa;
|
||||
}
|
||||
|
||||
public void setCwa(String cwa) {
|
||||
this.cwa = cwa;
|
||||
}
|
||||
|
||||
public Long getLookupId() {
|
||||
return lookupId;
|
||||
}
|
||||
|
||||
public void setLookupId(Long lookupId) {
|
||||
this.lookupId = lookupId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,542 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import com.raytheon.uf.common.localization.ILocalizationFile;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.LocalizationUtil;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.SaveableOutputStream;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.vividsolutions.jts.geom.Envelope;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
import com.vividsolutions.jts.geom.MultiPolygon;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
|
||||
|
||||
/**
|
||||
* Manage a cache of geometries and envelopes for different areas/resolutions.
|
||||
* The first time FFMP is loaded the geometries will be simplified and stored to
|
||||
* localization for faster retrieval. All geometries and envelopes are held in
|
||||
* memory by a soft reference or until they are explicitly cleared.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- --------- --------------------------------------------
|
||||
* Dec 09, 2010 rjpeter Initial creation
|
||||
* Apr 25, 2013 1954 bsteffen Decompress ffmp geometries to save time
|
||||
* loading them.
|
||||
* Apr 25, 2013 1954 bsteffen Undo last commit to avoid invalid geoms.
|
||||
* Jul 03, 2013 2152 rjpeter Use streams for serialization
|
||||
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to
|
||||
* LocalizationException
|
||||
* Feb 15, 2016 5244 nabowle Replace deprecated LocalizationFile methods.
|
||||
* Aug 09, 2016 5819 mapeters Geom/envelope files moved from SITE to
|
||||
* CONFIGURED
|
||||
* Aug 15, 2016 5819 mapeters Geom/envelope files moved back to SITE since
|
||||
* code that writes them is called by CAVE
|
||||
* Sep 13, 2017 20297 lshi FFMP AlertViz errors when changing layers and
|
||||
* opening basin trend graphs
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rjpeter
|
||||
*/
|
||||
public class HucLevelGeometriesFactory {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(HucLevelGeometriesFactory.class);
|
||||
|
||||
private static final double SIMPLIFICATION_LEVEL = 0.0005;
|
||||
|
||||
private static final double BUFFER_LEVEL = SIMPLIFICATION_LEVEL / 4;
|
||||
|
||||
private static HucLevelGeometriesFactory instance = new HucLevelGeometriesFactory();
|
||||
|
||||
private static final String hucGeomBasePath = "ffmp"
|
||||
+ IPathManager.SEPARATOR + "aggrGeom";
|
||||
|
||||
private final IPathManager pathManager;
|
||||
|
||||
public static HucLevelGeometriesFactory getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private final ConcurrentMap<String, SoftReference<Map<Long, Geometry>>> geomCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final ConcurrentMap<String, SoftReference<Map<Long, Envelope>>> envCache = new ConcurrentHashMap<>();
|
||||
|
||||
private HucLevelGeometriesFactory() {
|
||||
pathManager = PathManagerFactory.getPathManager();
|
||||
}
|
||||
|
||||
public synchronized Geometry getGeometry(FFMPTemplates template,
|
||||
String dataKey, String domain, String huc, Long pfaf)
|
||||
throws Exception {
|
||||
return getGeometries(template, dataKey, domain, huc).get(pfaf);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public synchronized Map<Long, Geometry> getGeometries(
|
||||
FFMPTemplates template, String dataKey, String cwa, String huc)
|
||||
throws Exception {
|
||||
String key = dataKey + cwa + huc;
|
||||
SoftReference<Map<Long, Geometry>> ref = geomCache.get(key);
|
||||
Map<Long, Geometry> map = null;
|
||||
if (ref != null) {
|
||||
map = ref.get();
|
||||
}
|
||||
|
||||
// load from disk
|
||||
if (map == null) {
|
||||
// generate map/check all entries in list vs map
|
||||
Set<Long> pfafs = template.getMap(dataKey, cwa, huc).keySet();
|
||||
Collection<Long> pfafsToGenerate = null;
|
||||
|
||||
LocalizationContext lc = pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
LocalizationFile f = pathManager.getLocalizationFile(lc,
|
||||
getGeomPath(dataKey, cwa, huc));
|
||||
|
||||
if (f.exists()) {
|
||||
boolean deleteFile = false;
|
||||
long length = f.getFile().length();
|
||||
|
||||
// read from disk in 8k chunks
|
||||
int bufferSize = 8 * 1024;
|
||||
if (bufferSize > length) {
|
||||
bufferSize = (int) length;
|
||||
}
|
||||
|
||||
try (InputStream is = f.openInputStream();
|
||||
GZIPInputStream gis = new GZIPInputStream(is,
|
||||
bufferSize)) {
|
||||
|
||||
map = SerializationUtil.transformFromThrift(Map.class, gis);
|
||||
int sizeGuess = Math.max(
|
||||
Math.abs(pfafs.size() - map.size()), 10);
|
||||
pfafsToGenerate = new ArrayList<>(sizeGuess);
|
||||
for (Long pfafToCheck : pfafs) {
|
||||
if (!map.containsKey(pfafToCheck)) {
|
||||
pfafsToGenerate.add(pfafToCheck);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String msg = "Failed to read geometry map from file: "
|
||||
+ f.getPath() + ". Deleting file and regenerating.";
|
||||
statusHandler.handle(Priority.WARN, msg, e);
|
||||
|
||||
deleteFile = true;
|
||||
pfafsToGenerate = pfafs;
|
||||
} finally {
|
||||
if (deleteFile) {
|
||||
try {
|
||||
f.delete();
|
||||
} catch (LocalizationException e) {
|
||||
String msg = "Error deleting file: " + f.getPath();
|
||||
statusHandler.handle(Priority.WARN, msg, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pfafsToGenerate = pfafs;
|
||||
}
|
||||
|
||||
if (pfafsToGenerate.size() > 0) {
|
||||
Map<Long, Geometry> tmp = null;
|
||||
if (FFMPRecord.ALL.equals(huc)) {
|
||||
tmp = generateSimplifiedGeometry(template, dataKey, cwa,
|
||||
pfafs);
|
||||
} else {
|
||||
tmp = generateUnifiedGeometry(template, dataKey, cwa, huc,
|
||||
pfafs);
|
||||
}
|
||||
|
||||
if (map == null) {
|
||||
map = tmp;
|
||||
} else {
|
||||
map.putAll(tmp);
|
||||
}
|
||||
|
||||
persistGeometryMap(dataKey, cwa, huc, map);
|
||||
}
|
||||
|
||||
geomCache.put(key, new SoftReference<>(map));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
protected synchronized Map<Long, Geometry> generateSimplifiedGeometry(
|
||||
FFMPTemplates template, String dataKey, String cwa,
|
||||
Collection<Long> pfafs) {
|
||||
Map<Long, Geometry> rawGeometries = template.getRawGeometries(dataKey,
|
||||
cwa);
|
||||
Map<Long, Geometry> simplifiedGeometries = new HashMap<>(
|
||||
(int) (pfafs.size() * 1.3) + 1);
|
||||
GeometryFactory gf = new GeometryFactory();
|
||||
|
||||
for (Long pfaf : pfafs) {
|
||||
Geometry tmpGeom = rawGeometries.get(pfaf);
|
||||
if (tmpGeom != null) {
|
||||
tmpGeom = TopologyPreservingSimplifier.simplify(tmpGeom,
|
||||
SIMPLIFICATION_LEVEL);
|
||||
// add slight buffer to fill internal sections
|
||||
tmpGeom = gf.createGeometryCollection(
|
||||
new Geometry[] { tmpGeom }).buffer(BUFFER_LEVEL);
|
||||
tmpGeom = TopologyPreservingSimplifier.simplify(tmpGeom,
|
||||
SIMPLIFICATION_LEVEL / 2);
|
||||
simplifiedGeometries.put(pfaf, tmpGeom);
|
||||
}
|
||||
}
|
||||
|
||||
return simplifiedGeometries;
|
||||
}
|
||||
|
||||
protected synchronized Map<Long, Geometry> generateUnifiedGeometry(
|
||||
FFMPTemplates template, String dataKey, String cwa, String huc,
|
||||
Collection<Long> aggrPfafs) throws Exception {
|
||||
Map<Long, Geometry> rval = null;
|
||||
rval = new HashMap<>((int) (aggrPfafs.size() * 1.3) + 1);
|
||||
GeometryFactory gf = new GeometryFactory();
|
||||
String childHuc = getChildHuc(template, huc);
|
||||
Map<Long, Collection<Long>> childHucMapping = getChildHucMapping(
|
||||
template, dataKey, cwa, huc, childHuc);
|
||||
Map<Long, Geometry> childHucGeometries = getGeometries(template,
|
||||
dataKey, cwa, childHuc);
|
||||
|
||||
// organize child pfafs by parent aggr
|
||||
for (Long aggrPfaf : aggrPfafs) {
|
||||
Collection<Long> childPfafs = childHucMapping.get(aggrPfaf);
|
||||
|
||||
if ((childPfafs != null) && (childPfafs.size() > 0)) {
|
||||
Geometry[] hucGeometries = new Geometry[childPfafs.size()];
|
||||
Iterator<Long> iter = childPfafs.iterator();
|
||||
int i = 0;
|
||||
while (iter.hasNext()) {
|
||||
Long pfaf = iter.next();
|
||||
hucGeometries[i++] = childHucGeometries.get(pfaf);
|
||||
}
|
||||
|
||||
if (hucGeometries.length > 0){
|
||||
Geometry tmpGeom = gf.createGeometryCollection(hucGeometries)
|
||||
.buffer(0);
|
||||
try {
|
||||
if (tmpGeom instanceof Polygon) {
|
||||
tmpGeom = deholer(gf, (Polygon) tmpGeom);
|
||||
} else if (tmpGeom instanceof MultiPolygon) {
|
||||
MultiPolygon mp = (MultiPolygon) tmpGeom;
|
||||
int numGeoms = mp.getNumGeometries();
|
||||
hucGeometries = new Geometry[numGeoms];
|
||||
for (i = 0; i < numGeoms; i++) {
|
||||
hucGeometries[i] = deholer(gf,
|
||||
(Polygon) mp.getGeometryN(i));
|
||||
}
|
||||
tmpGeom = gf.createGeometryCollection(hucGeometries)
|
||||
.buffer(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
rval.put(aggrPfaf, tmpGeom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to remove interior holes on a polygon. Will take up to 3 passes
|
||||
* over the polygon expanding any interior rings and merging rings back in.
|
||||
*
|
||||
* @param gf
|
||||
* @param p
|
||||
* @return
|
||||
*/
|
||||
protected Geometry deholer(GeometryFactory gf, Polygon p) {
|
||||
int interiorRings = p.getNumInteriorRing();
|
||||
int iterations = 0;
|
||||
while ((interiorRings > 0) && (iterations < 3)) {
|
||||
Geometry[] hucGeometries = new Geometry[interiorRings + 1];
|
||||
hucGeometries[0] = p;
|
||||
for (int i = 0; i < interiorRings; i++) {
|
||||
hucGeometries[i + 1] = p.getInteriorRingN(i).buffer(
|
||||
BUFFER_LEVEL);
|
||||
}
|
||||
p = (Polygon) gf.createGeometryCollection(hucGeometries).buffer(0);
|
||||
iterations++;
|
||||
interiorRings = p.getNumInteriorRing();
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the huc that is one aggregation smaller.
|
||||
*
|
||||
* @param tempate
|
||||
* @param huc
|
||||
* @return
|
||||
*/
|
||||
protected String getChildHuc(FFMPTemplates tempate, String huc) {
|
||||
String rval = FFMPRecord.ALL;
|
||||
if (huc.startsWith("HUC")) {
|
||||
int totalHuc = tempate.getTotalHucLevels();
|
||||
|
||||
if (!huc.equals("HUC" + (totalHuc - 1))) {
|
||||
int myHucNum = Integer.parseInt(huc.substring(3));
|
||||
rval = "HUC" + (myHucNum + 1);
|
||||
}
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map of pfafs to a collection of child pfafs for the child huc.
|
||||
*
|
||||
* @param template
|
||||
* @param cwa
|
||||
* @param huc
|
||||
* @param childHuc
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Map<Long, Collection<Long>> getChildHucMapping(
|
||||
FFMPTemplates template, String dataKey, String cwa, String huc,
|
||||
String childHuc) {
|
||||
|
||||
if (FFMPRecord.ALL.equals(childHuc)) {
|
||||
return (Map<Long, Collection<Long>>) template.getMap(dataKey, cwa,
|
||||
huc);
|
||||
} else if (childHuc.startsWith("HUC")) {
|
||||
int myHucNum = 0;
|
||||
if (huc.startsWith("HUC")) {
|
||||
myHucNum = Integer.parseInt(huc.substring(3));
|
||||
}
|
||||
int childHucNum = Integer.parseInt(childHuc.substring(3));
|
||||
long divisor = (long) Math.pow(10, childHucNum - myHucNum);
|
||||
|
||||
Set<Long> childPfafs = template.getMap(dataKey, cwa, childHuc)
|
||||
.keySet();
|
||||
Map<Long, Collection<Long>> childHucMapping = new HashMap<>(
|
||||
(int) ((childPfafs.size() / 10) * 1.3) + 1);
|
||||
for (Long childPfaf : childPfafs) {
|
||||
Long pfaf = new Long(childPfaf / divisor);
|
||||
Collection<Long> mappedChildPfafs = childHucMapping.get(pfaf);
|
||||
if (mappedChildPfafs == null) {
|
||||
mappedChildPfafs = new ArrayList<>();
|
||||
childHucMapping.put(pfaf, mappedChildPfafs);
|
||||
}
|
||||
mappedChildPfafs.add(childPfaf);
|
||||
}
|
||||
|
||||
return childHucMapping;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Huc " + childHuc
|
||||
+ " is an invalid child huc for " + huc);
|
||||
}
|
||||
|
||||
protected synchronized void persistGeometryMap(String dataKey, String cwa,
|
||||
String huc, Map<Long, Geometry> map) throws Exception {
|
||||
/*
|
||||
* TODO: we should be saving the geometry files to CONFIGURED, but we
|
||||
* can't currently since this code is called from CAVE
|
||||
*/
|
||||
LocalizationContext lc = pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
ILocalizationFile lf = pathManager.getLocalizationFile(lc,
|
||||
getGeomPath(dataKey, cwa, huc));
|
||||
|
||||
try (SaveableOutputStream mapSos = lf.openOutputStream();
|
||||
GZIPOutputStream mapGos = new GZIPOutputStream(mapSos)) {
|
||||
mapGos.write(SerializationUtil.transformToThrift(map));
|
||||
mapGos.finish();
|
||||
mapGos.flush();
|
||||
mapSos.save();
|
||||
}
|
||||
}
|
||||
|
||||
protected synchronized String getGeomPath(String dataKey, String cwa,
|
||||
String huc) {
|
||||
return LocalizationUtil.join(hucGeomBasePath, dataKey, cwa, huc,
|
||||
"geometries.bin");
|
||||
}
|
||||
|
||||
protected synchronized String getEnvelopePath(String dataKey, String cwa,
|
||||
String huc) {
|
||||
return LocalizationUtil.join(hucGeomBasePath, dataKey, cwa, huc,
|
||||
"envelopes.bin");
|
||||
}
|
||||
|
||||
public synchronized Envelope getEnvelope(FFMPTemplates template,
|
||||
String dataKey, String cwa, String huc, Long pfafId) {
|
||||
return getEnvelopes(template, dataKey, cwa, huc).get(pfafId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public synchronized Map<Long, Envelope> getEnvelopes(
|
||||
FFMPTemplates template, String dataKey, String cwa, String huc) {
|
||||
String key = dataKey + cwa + huc;
|
||||
SoftReference<Map<Long, Envelope>> ref = envCache.get(key);
|
||||
Map<Long, Envelope> map = null;
|
||||
if (ref != null) {
|
||||
map = ref.get();
|
||||
}
|
||||
|
||||
if (map == null) {
|
||||
// generate map/check all entries in list vs map
|
||||
Set<Long> pfafs = template.getMap(dataKey, cwa, huc).keySet();
|
||||
Collection<Long> pfafsToGenerate = null;
|
||||
|
||||
LocalizationContext lc = pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
LocalizationFile f = pathManager.getLocalizationFile(lc,
|
||||
getEnvelopePath(dataKey, cwa, huc));
|
||||
|
||||
if (f.exists()) {
|
||||
boolean deleteFile = false;
|
||||
long length = f.getFile().length();
|
||||
|
||||
// read from disk in 8k chunks
|
||||
int bufferSize = 8 * 1024;
|
||||
if (bufferSize > length) {
|
||||
bufferSize = (int) length;
|
||||
}
|
||||
try (InputStream is = f.openInputStream();
|
||||
GZIPInputStream gis = new GZIPInputStream(is,
|
||||
bufferSize)) {
|
||||
|
||||
map = SerializationUtil.transformFromThrift(Map.class, gis);
|
||||
int sizeGuess = Math.max(
|
||||
Math.abs(pfafs.size() - map.size()), 10);
|
||||
pfafsToGenerate = new ArrayList<>(sizeGuess);
|
||||
for (Long pfafToCheck : pfafs) {
|
||||
if (!map.containsKey(pfafToCheck)) {
|
||||
pfafsToGenerate.add(pfafToCheck);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String msg = "Failed to read envelope map from file: "
|
||||
+ f.getPath() + ". Deleting file and regenerating.";
|
||||
statusHandler.handle(Priority.WARN, msg, e);
|
||||
|
||||
deleteFile = true;
|
||||
pfafsToGenerate = pfafs;
|
||||
} finally {
|
||||
if (deleteFile) {
|
||||
try {
|
||||
f.delete();
|
||||
} catch (LocalizationException e) {
|
||||
String msg = "Error deleting file: " + f.getPath();
|
||||
statusHandler.handle(Priority.WARN, msg, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pfafsToGenerate = pfafs;
|
||||
}
|
||||
|
||||
if (pfafsToGenerate.size() > 0) {
|
||||
if (map == null) {
|
||||
map = new HashMap<>(
|
||||
(int) (pfafsToGenerate.size() * 1.3) + 1);
|
||||
}
|
||||
try {
|
||||
Map<Long, Geometry> geoms = getGeometries(template,
|
||||
dataKey, cwa, huc);
|
||||
for (Long pfaf : pfafsToGenerate) {
|
||||
Envelope env = geoms.get(pfaf).getEnvelopeInternal();
|
||||
map.put(pfaf, env);
|
||||
}
|
||||
|
||||
persistEnvelopeMap(dataKey, cwa, huc, map);
|
||||
} catch (Exception e) {
|
||||
System.err.println("Can't locate geometries: No file: "
|
||||
+ dataKey + " CWA: " + cwa);
|
||||
}
|
||||
}
|
||||
|
||||
envCache.put(key, new SoftReference<>(map));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
protected synchronized void persistEnvelopeMap(String dataKey, String cwa,
|
||||
String huc, Map<Long, Envelope> map) throws Exception {
|
||||
/*
|
||||
* TODO: we should be saving the envelope files to CONFIGURED, but we
|
||||
* can't currently since this code is called from CAVE
|
||||
*/
|
||||
LocalizationContext lc = pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
ILocalizationFile lf = pathManager.getLocalizationFile(lc,
|
||||
getEnvelopePath(dataKey, cwa, huc));
|
||||
|
||||
try (SaveableOutputStream sos = lf.openOutputStream();
|
||||
GZIPOutputStream gos = new GZIPOutputStream(sos)) {
|
||||
SerializationUtil.transformToThriftUsingStream(map, gos);
|
||||
gos.finish();
|
||||
gos.flush();
|
||||
sos.save();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void clear() {
|
||||
geomCache.clear();
|
||||
envCache.clear();
|
||||
}
|
||||
|
||||
public synchronized void clearGeomCache(String hucLevel) {
|
||||
Iterator<String> iter = geomCache.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
String hucKey = iter.next();
|
||||
if (hucKey.startsWith(hucLevel)) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,144 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* FFMP source binning object
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 10/22/10 6581 D. Hladky Initial release
|
||||
* 01/27/13 1478 D. Hladky Removed un needed XML annotations
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
@DynamicSerialize
|
||||
public class SourceBin {
|
||||
|
||||
/** sourceName and dataKey **/
|
||||
@DynamicSerializeElement
|
||||
public double[] lats;
|
||||
|
||||
@DynamicSerializeElement
|
||||
public double[] lons;
|
||||
|
||||
@DynamicSerializeElement
|
||||
public double[] areaPercent;
|
||||
|
||||
public SourceBin() {
|
||||
|
||||
}
|
||||
|
||||
public SourceBin(Coordinate[] coors, double[] areaPercent) {
|
||||
lats = new double[coors.length];
|
||||
lons = new double[coors.length];
|
||||
this.areaPercent = areaPercent;
|
||||
for (int i = 0; i < coors.length;i++) {
|
||||
lons[i] = coors[i].x;
|
||||
lats[i] = coors[i].y;
|
||||
}
|
||||
}
|
||||
|
||||
public SourceBin(ArrayList<SourceBinEntry> sbes) {
|
||||
lats = new double[sbes.size()];
|
||||
lons = new double[sbes.size()];
|
||||
areaPercent = new double[sbes.size()];
|
||||
for (int i = 0; i < sbes.size(); i++) {
|
||||
Coordinate coor = sbes.get(i).getCoor();
|
||||
lons[i] = coor.x;
|
||||
lats[i] = coor.y;
|
||||
areaPercent[i] = sbes.get(i).getArea();
|
||||
}
|
||||
}
|
||||
|
||||
public double[] getLats() {
|
||||
return lats;
|
||||
}
|
||||
|
||||
|
||||
public void setLats(double[] lats) {
|
||||
this.lats = lats;
|
||||
}
|
||||
|
||||
|
||||
public double[] getLons() {
|
||||
return lons;
|
||||
}
|
||||
|
||||
|
||||
public void setLons(double[] lons) {
|
||||
this.lons = lons;
|
||||
}
|
||||
|
||||
public Coordinate[] getCoordinates() {
|
||||
Coordinate[] coors = new Coordinate[lats.length];
|
||||
for(int i = 0;i < lats.length;i++) {
|
||||
coors[i] = new Coordinate(lons[i], lats[i]);
|
||||
}
|
||||
return coors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the entries for the source bins
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<SourceBinEntry> getEntries() {
|
||||
|
||||
ArrayList<SourceBinEntry> entries = new ArrayList<SourceBinEntry>(
|
||||
lats.length);
|
||||
for (int i = 0; i < lats.length; i++) {
|
||||
SourceBinEntry sbe = new SourceBinEntry();
|
||||
sbe.setCoor(new Coordinate(lons[i], lats[i]));
|
||||
sbe.setArea(areaPercent[i]);
|
||||
entries.add(sbe);
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
||||
public double[] getAreaPercent() {
|
||||
return areaPercent;
|
||||
}
|
||||
|
||||
public double getPercent(int i) {
|
||||
return areaPercent[i];
|
||||
}
|
||||
|
||||
public void setAreaPercent(double[] areaPercent) {
|
||||
this.areaPercent = areaPercent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
/**
|
||||
* FFMP source binning entry object
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 01/27/13 1478 D. Hladky Removed un needed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
|
||||
@DynamicSerialize
|
||||
public class SourceBinEntry {
|
||||
|
||||
/** sourceName and dataKey **/
|
||||
@DynamicSerializeElement
|
||||
public Coordinate coor;
|
||||
|
||||
@DynamicSerializeElement
|
||||
public double area;
|
||||
|
||||
public Coordinate getCoor() {
|
||||
return coor;
|
||||
}
|
||||
|
||||
public void setCoor(Coordinate coor) {
|
||||
this.coor = coor;
|
||||
}
|
||||
|
||||
public double getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(double area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
||||
/**
|
||||
* FFMP source binning object
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 10/22/10 6581 D. Hladky Initial release
|
||||
* 01/27/13 1478 D. Hladky Removed un needed XML annotations
|
||||
* Aug 08, 2015 4722 dhladky Dynamic serialize imp not needed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class SourceBinList {
|
||||
|
||||
/** sourceName and dataKey **/
|
||||
@DynamicSerializeElement
|
||||
public String sourceId;
|
||||
|
||||
@DynamicSerializeElement
|
||||
public HashMap<Long, SourceBin> sourceMap;
|
||||
|
||||
public SourceBinList() {
|
||||
|
||||
}
|
||||
|
||||
public SourceBinList(String sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
this.sourceMap = new HashMap<Long, SourceBin>();
|
||||
}
|
||||
|
||||
public String getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceId(String sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public HashMap<Long, SourceBin> getSourceMap() {
|
||||
return sourceMap;
|
||||
}
|
||||
|
||||
public void setSourceMap(HashMap<Long, SourceBin> sourceMap) {
|
||||
this.sourceMap = sourceMap;
|
||||
}
|
||||
|
||||
public void addBin(Long pfaf, SourceBin map) {
|
||||
getSourceMap().put(pfaf, map);
|
||||
}
|
||||
|
||||
public SourceBin getMap(Long pfaf) {
|
||||
return getSourceMap().get(pfaf);
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,621 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.collections;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.AbstractSet;
|
||||
import java.util.Arrays;
|
||||
import java.util.BitSet;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* Factory for constructing maps to use in FFMPBasins for organizing values.
|
||||
*
|
||||
* Each basin in FFMP requires a NavigableMap<Date,Float> in order to achieve
|
||||
* fast dynamic calculations. Unfortunately due to the large number of basins
|
||||
* TreeMaps require too much memory. This factory produces maps that have the
|
||||
* same performance as TreeMaps but are much more memory efficient.
|
||||
*
|
||||
* This factory achieves efficiency by taking advantage of the fact that all
|
||||
* basins will have data for the same times, so it can use a single TreeMap as
|
||||
* the backing map for all basins. Each NavigableMap returned from this factory
|
||||
* is simply a view into the backing map.
|
||||
*
|
||||
* Because all maps returned from this factory use the same backing map, they
|
||||
* cannot be synchronized individually. Internally all map modifications are
|
||||
* synchronized on the factory object to prevent concurrent modification. If any
|
||||
* iterators are being used from any maps then the iteration should also be
|
||||
* synchronized on the factory.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 30, 2013 2242 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class BasinMapFactory<K> {
|
||||
|
||||
/*
|
||||
* How much to grow the backing arrays to make room for new maps, this is
|
||||
* much more conservative than the algorithms used by ArrayList or HashMap
|
||||
* because typically growth will occur very briefly during initialization
|
||||
* and the extra overhead of a slower growth rate is minimal. Once all
|
||||
* basins are created, growth will stop and a conservative growth algorithm
|
||||
* limits wasted memory after the initial growth phase.
|
||||
*/
|
||||
private static final int GROWTH_RATE = 32;
|
||||
|
||||
/* The amount of space allocated in each value. */
|
||||
protected volatile int allocated_size;
|
||||
|
||||
/* The number of indices used in maps so far. */
|
||||
private volatile int used_size;
|
||||
|
||||
/* This is the real navigable map, responsible for all real work. */
|
||||
private final NavigableMap<K, MultiValue> backingMap;
|
||||
|
||||
/**
|
||||
* Create a new factory
|
||||
*
|
||||
* @param comparator
|
||||
* the comparator to use for map keys
|
||||
* @param initialSize
|
||||
* the amount of space to preallocate for basin maps.
|
||||
*/
|
||||
public BasinMapFactory(Comparator<? super K> comparator, int initialSize) {
|
||||
allocated_size = initialSize;
|
||||
used_size = 0;
|
||||
this.backingMap = new TreeMap<K, MultiValue>(comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a new map from this factory.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public NavigableMap<K, Float> getMap() {
|
||||
return new MapView<K>(this, getNextIndex(),
|
||||
backingMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a new map from this factory, populated with all the values from m. If
|
||||
* m has the same keyset as other maps in this factory than this will
|
||||
* populate the new map faster than putAll.
|
||||
*
|
||||
* @param m
|
||||
* NavigableMap, must have the same comparator as this factory.
|
||||
* @return
|
||||
*/
|
||||
public NavigableMap<K, Float> getMap(NavigableMap<K, Float> m) {
|
||||
Comparator<? super K> bc = backingMap.comparator();
|
||||
Comparator<? super K> mc = m.comparator();
|
||||
if (mc != bc && (mc == null || !mc.equals(bc))) {
|
||||
throw new IllegalArgumentException(
|
||||
"Maps can only be constructed if the compators are the same.");
|
||||
}
|
||||
int index = getNextIndex();
|
||||
Iterator<Entry<K, MultiValue>> bit = backingMap.entrySet().iterator();
|
||||
Iterator<Entry<K, Float>> mit = m.entrySet().iterator();
|
||||
NavigableMap<K, Float> r = new MapView<K>(this, index,
|
||||
backingMap);
|
||||
/*
|
||||
* If both maps have the same keys, then iterating both simultaneously
|
||||
* is faster than multiple puts because it avoids doing multiple lookups
|
||||
*/
|
||||
while (bit.hasNext() && mit.hasNext()) {
|
||||
Entry<K, MultiValue> bent = bit.next();
|
||||
Entry<K, Float> ment = mit.next();
|
||||
if (ment.getKey().equals(bent.getKey())) {
|
||||
bent.getValue().put(index, ment.getValue());
|
||||
} else {
|
||||
/* It turns out keys are not equals */
|
||||
r.put(ment.getKey(), ment.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This loop is only used if the backingMap was empty or if for some
|
||||
* reason the backingMap and the new map do not have the same keys.
|
||||
*/
|
||||
while (mit.hasNext()) {
|
||||
Entry<K, Float> ment = mit.next();
|
||||
r.put(ment.getKey(), ment.getValue());
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/* get the next free index for use in a MapView */
|
||||
private int getNextIndex() {
|
||||
synchronized (this) {
|
||||
int index = used_size;
|
||||
used_size += 1;
|
||||
if (used_size >= allocated_size) {
|
||||
allocated_size += GROWTH_RATE;
|
||||
for (MultiValue v : backingMap.values()) {
|
||||
v.grow(allocated_size);
|
||||
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Value within the backing map. This contains the raw data values for each
|
||||
* basin. In addition it contains a boolean for each basin indicating if the
|
||||
* value has been set. While most of the time all basins will be set, the
|
||||
* extra boolean is needed to allow different views to function as
|
||||
* independent maps, which is needed while new data is getting added.
|
||||
*/
|
||||
private static class MultiValue {
|
||||
|
||||
/* actual values for all basins. */
|
||||
private float[] data;
|
||||
|
||||
/* booleans indicating whether a value has been set yet for a basin */
|
||||
private BitSet occupied;
|
||||
|
||||
/*
|
||||
* The number of occupied basins for this time, when its zero the time
|
||||
* can be removed from the backing map.
|
||||
*/
|
||||
private int size = 0;
|
||||
|
||||
public MultiValue(int allocated_size) {
|
||||
this.data = new float[allocated_size];
|
||||
this.occupied = new BitSet(allocated_size);
|
||||
}
|
||||
|
||||
public void grow(int allocated_size) {
|
||||
data = Arrays.copyOf(data, allocated_size);
|
||||
BitSet occupied = new BitSet(allocated_size);
|
||||
occupied.or(this.occupied);
|
||||
this.occupied = occupied;
|
||||
}
|
||||
|
||||
public Float put(int index, float value) {
|
||||
Float oldValue = null;
|
||||
if (occupied.get(index)) {
|
||||
oldValue = data[index];
|
||||
} else {
|
||||
occupied.set(index);
|
||||
size += 1;
|
||||
}
|
||||
data[index] = value;
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
public Float get(int index) {
|
||||
if (occupied.get(index)) {
|
||||
return data[index];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean contains(int index) {
|
||||
return occupied.get(index);
|
||||
}
|
||||
|
||||
public Float remove(int index) {
|
||||
if (occupied.get(index)) {
|
||||
occupied.clear(index);
|
||||
size -= 1;
|
||||
return data[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size == 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* NavigableMap implementation which provides a view into the backingMap at
|
||||
* a specific index. This class can map any NavigableMap<K, MultiValue>
|
||||
* which simplifies creating sub maps or descending map because all that is
|
||||
* required is getting new maps from the backingMap and wrapping them in a
|
||||
* new MapView.
|
||||
*/
|
||||
private static class MapView<K> extends AbstractMap<K, Float> implements
|
||||
NavigableMap<K, Float> {
|
||||
|
||||
/* Factory, for syncronization */
|
||||
private final BasinMapFactory<K> factory;
|
||||
|
||||
/* index into the MultiValue */
|
||||
private final int index;
|
||||
|
||||
/* backingMap where all the data really lives. */
|
||||
private final NavigableMap<K, MultiValue> backingMap;
|
||||
|
||||
public MapView(BasinMapFactory<K> factory, int index,
|
||||
NavigableMap<K, MultiValue> backingMap) {
|
||||
this.factory = factory;
|
||||
this.index = index;
|
||||
this.backingMap = backingMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float put(K key, Float value) {
|
||||
synchronized (factory) {
|
||||
MultiValue v = backingMap.get(key);
|
||||
if (v == null) {
|
||||
v = new MultiValue(factory.allocated_size);
|
||||
backingMap.put(key, v);
|
||||
}
|
||||
return v.put(index, value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(Object key) {
|
||||
MultiValue v = backingMap.get(key);
|
||||
if (v != null) {
|
||||
return v.contains(index);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float get(Object key) {
|
||||
MultiValue v = backingMap.get(key);
|
||||
if (v != null) {
|
||||
return v.get(index);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float remove(Object key) {
|
||||
Float oldValue = null;
|
||||
MultiValue v = backingMap.get(key);
|
||||
if (v != null) {
|
||||
synchronized (factory) {
|
||||
oldValue = v.remove(index);
|
||||
if (v.isEmpty()) {
|
||||
backingMap.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
/*
|
||||
* The default implementation uses size() which will iterate over
|
||||
* all elements, this is much faster.
|
||||
*/
|
||||
return !entrySet().iterator().hasNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparator<? super K> comparator() {
|
||||
return backingMap.comparator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K firstKey() {
|
||||
Entry<K, Float> e = firstEntry();
|
||||
if (e != null) {
|
||||
return e.getKey();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public K lastKey() {
|
||||
Entry<K, Float> e = lastEntry();
|
||||
if (e != null) {
|
||||
return e.getKey();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> lowerEntry(K key) {
|
||||
return headMap(key).lastEntry();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K lowerKey(K key) {
|
||||
return headMap(key).lastKey();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> floorEntry(K key) {
|
||||
return headMap(key, true).lastEntry();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public K floorKey(K key) {
|
||||
return headMap(key, true).lastKey();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> ceilingEntry(K key) {
|
||||
return tailMap(key).firstEntry();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K ceilingKey(K key) {
|
||||
return tailMap(key).firstKey();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> higherEntry(K key) {
|
||||
return tailMap(key, false).firstEntry();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K higherKey(K key) {
|
||||
return tailMap(key, false).firstKey();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> firstEntry() {
|
||||
for (Entry<K, Float> e : entrySet()) {
|
||||
return e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> lastEntry() {
|
||||
return descendingMap().firstEntry();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> pollFirstEntry() {
|
||||
Iterator<Entry<K, Float>> it = entrySet().iterator();
|
||||
if (it.hasNext()) {
|
||||
Entry<K, Float> e = it.next();
|
||||
it.remove();
|
||||
return e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> pollLastEntry() {
|
||||
return descendingMap().pollFirstEntry();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> descendingMap() {
|
||||
return new MapView<K>(factory, index, backingMap.descendingMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableSet<K> navigableKeySet() {
|
||||
return new NavigableKeySet<K>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableSet<K> descendingKeySet() {
|
||||
return descendingMap().navigableKeySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> subMap(K fromKey, boolean fromInclusive,
|
||||
K toKey, boolean toInclusive) {
|
||||
return new MapView<K>(factory, index, backingMap.subMap(fromKey,
|
||||
fromInclusive, toKey, toInclusive));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> headMap(K toKey, boolean inclusive) {
|
||||
return new MapView<K>(factory, index, backingMap.headMap(toKey,
|
||||
inclusive));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> tailMap(K fromKey, boolean inclusive) {
|
||||
return new MapView<K>(factory, index, backingMap.tailMap(fromKey,
|
||||
inclusive));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> subMap(K fromKey, K toKey) {
|
||||
return new MapView<K>(factory, index, backingMap.subMap(fromKey,
|
||||
true, toKey, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> headMap(K toKey) {
|
||||
return new MapView<K>(factory, index, backingMap.headMap(toKey,
|
||||
false));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableMap<K, Float> tailMap(K fromKey) {
|
||||
return new MapView<K>(factory, index, backingMap.headMap(fromKey,
|
||||
true));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Entry<K, Float>> entrySet() {
|
||||
return new EntrySet<K>(index, backingMap.entrySet());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry set for a MapView, just a wrapper over a Set<Entry<K, MultiValue>>
|
||||
*/
|
||||
private static class EntrySet<K> extends AbstractSet<Entry<K, Float>> {
|
||||
|
||||
private final int index;
|
||||
|
||||
private final Set<Entry<K, MultiValue>> backingSet;
|
||||
|
||||
public EntrySet(int index, Set<Entry<K, MultiValue>> backingSet) {
|
||||
this.index = index;
|
||||
this.backingSet = backingSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Entry<K, Float>> iterator() {
|
||||
return new EntryIterator<K>(index, backingSet.iterator());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
Iterator<Entry<K, Float>> it = iterator();
|
||||
int i = 0;
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
i += 1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterator implementation for an EntrySet, This wraps an Iterator<Entry<K,
|
||||
* MultiValue>> but has extra logic for skipping over values that exist in
|
||||
* the backingSet but are not occupied within the MultiValue.
|
||||
*/
|
||||
private static class EntryIterator<K> implements Iterator<Entry<K, Float>> {
|
||||
|
||||
private final int index;
|
||||
|
||||
private final Iterator<Entry<K, MultiValue>> backingIterator;
|
||||
|
||||
/* The next valid entry in the backingMap */
|
||||
private transient Entry<K, MultiValue> next;
|
||||
|
||||
/* Previous Value returned by next() */
|
||||
private transient Entry<K, MultiValue> previous;
|
||||
|
||||
public EntryIterator(int index,
|
||||
Iterator<Entry<K, MultiValue>> backingIterator) {
|
||||
this.index = index;
|
||||
this.backingIterator = backingIterator;
|
||||
}
|
||||
|
||||
private Entry<K, MultiValue> checkNext() {
|
||||
if (next == null) {
|
||||
while (backingIterator.hasNext()) {
|
||||
Entry<K, MultiValue> e = backingIterator.next();
|
||||
previous = null;
|
||||
MultiValue v = e.getValue();
|
||||
if (v.contains(index)) {
|
||||
next = e;
|
||||
return next;
|
||||
}
|
||||
}
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return checkNext() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, Float> next() {
|
||||
Entry<K, MultiValue> next = checkNext();
|
||||
previous = next;
|
||||
if (next == null) {
|
||||
return null;
|
||||
} else {
|
||||
this.next = null;
|
||||
return new EntryImpl<K>(index, next);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if (previous == null) {
|
||||
throw new IllegalStateException(
|
||||
"Cannot remove from iterator because next() was not called.");
|
||||
}
|
||||
MultiValue v = previous.getValue();
|
||||
previous = null;
|
||||
v.remove(index);
|
||||
if (v.isEmpty()) {
|
||||
backingIterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry for a MapView, just a wrapper over a Entry<K, MultiValue>.
|
||||
*/
|
||||
private static class EntryImpl<K> implements Entry<K, Float> {
|
||||
|
||||
private final int index;
|
||||
|
||||
private final Entry<K, MultiValue> backingEntry;
|
||||
|
||||
public EntryImpl(int index, Entry<K, MultiValue> timeEntry) {
|
||||
this.index = index;
|
||||
this.backingEntry = timeEntry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public K getKey() {
|
||||
return backingEntry.getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float getValue() {
|
||||
return backingEntry.getValue().get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float setValue(Float value) {
|
||||
return backingEntry.getValue().put(index, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,772 @@
|
|||
/**
|
||||
* 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.
|
||||
* */
|
||||
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.collections;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.concurrent.ConcurrentNavigableMap;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.HDF5Util;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPAggregateRecord;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinData;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE;
|
||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest.OrderMode;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.GUIDANCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.xml.DomainXML;
|
||||
import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductXML;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* FFMP Common Data Cache
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 26, 2015 5056 D. Hladky Initial release
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
|
||||
public class FFMPDataCache {
|
||||
|
||||
|
||||
/** Soft reference wrapper for data cache **/
|
||||
private static SoftReference<FFMPDataCache> softCache = new SoftReference<FFMPDataCache>(null);
|
||||
|
||||
/** FFMP Source configuration manager **/
|
||||
private FFMPSourceConfigurationManager fscm = FFMPSourceConfigurationManager.getInstance();
|
||||
|
||||
/** FFMP Running(Comparison) configuration manager **/
|
||||
private FFMPRunConfigurationManager frcm = FFMPRunConfigurationManager.getInstance();
|
||||
|
||||
/** The FFMP templates **/
|
||||
private volatile FFMPTemplates templates;
|
||||
|
||||
/** FFMP Cache Data Container **/
|
||||
private final FFMPSiteDataContainer siteDataMap = new FFMPSiteDataContainer();
|
||||
|
||||
/** Local lock object for URI requests **/
|
||||
private final Object uriRequestLock = new Object();
|
||||
|
||||
/** WFO this cache is active for **/
|
||||
private final String wfo;
|
||||
|
||||
/** Status handler **/
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(FFMPDataCache.class);
|
||||
|
||||
/**
|
||||
* Singleton instance
|
||||
*
|
||||
* @param wfo
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static synchronized FFMPDataCache getInstance(String wfo) {
|
||||
|
||||
FFMPDataCache cache = softCache.get();
|
||||
|
||||
if (cache == null ||!cache.wfo.equals(wfo)) {
|
||||
cache = new FFMPDataCache(wfo);
|
||||
softCache = new SoftReference<FFMPDataCache>(cache);
|
||||
}
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* private instance constructor
|
||||
*
|
||||
* @param wfo
|
||||
*/
|
||||
private FFMPDataCache(String wfo) {
|
||||
this.wfo = wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HUC templates
|
||||
*
|
||||
* @param siteKey
|
||||
* @return
|
||||
*/
|
||||
public FFMPTemplates getTemplates(String siteKey) {
|
||||
|
||||
if (templates == null) {
|
||||
long t0 = System.currentTimeMillis();
|
||||
synchronized (this) {
|
||||
if (templates == null) {
|
||||
FFMPRunXML runner = frcm.getRunner(wfo);
|
||||
templates = FFMPTemplates.getInstance(
|
||||
runner.getPrimaryDomain(), siteKey, MODE.CAVE);
|
||||
|
||||
// backup domains
|
||||
if (runner.getBackupDomains() != null) {
|
||||
for (DomainXML backup : runner.getBackupDomains()) {
|
||||
templates.addDomain(siteKey, backup);
|
||||
}
|
||||
} else {
|
||||
templates.done = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
statusHandler.info("Time spent initializing templates: "
|
||||
+ (System.currentTimeMillis() - t0));
|
||||
}
|
||||
|
||||
if (!templates.isSiteLoaded(siteKey)) {
|
||||
FFMPRunXML runner = frcm.getRunner(wfo);
|
||||
|
||||
for (DomainXML domain : runner.getDomains()) {
|
||||
templates.addDomain(siteKey, domain);
|
||||
}
|
||||
}
|
||||
|
||||
return templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* populate a new FFMPRecord
|
||||
*
|
||||
* @param uri
|
||||
* @param siteKey
|
||||
* @param source
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public FFMPRecord populateFFMPRecord(String uri, String siteKey,
|
||||
String source) throws Exception {
|
||||
|
||||
populateFFMPRecord(siteKey, new FFMPRecord(uri), source);
|
||||
SourceXML sourceXml = fscm.getSource(source);
|
||||
|
||||
if (sourceXml.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
source = sourceXml.getDisplayName();
|
||||
}
|
||||
|
||||
return siteDataMap.get(siteKey).getSourceData(source).getRecord(uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* populate a new FFMPRecord
|
||||
*
|
||||
* @param siteKey
|
||||
* @param dataKey
|
||||
* @param source
|
||||
* @param ptime
|
||||
* @param retrieveNew
|
||||
* @throws Exception
|
||||
*/
|
||||
public void populateFFMPRecord(String siteKey, String dataKey,
|
||||
String source, Date ptime, boolean retrieveNew) throws Exception {
|
||||
if (source != null) {
|
||||
|
||||
boolean dupOverride = false;
|
||||
if (fscm.getSource(source).getSourceType()
|
||||
.equals(SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
dupOverride = true;
|
||||
}
|
||||
|
||||
SortedMap<Date, List<String>> urisByDate = getAvailableUris(
|
||||
siteKey, dataKey, source, ptime, retrieveNew);
|
||||
|
||||
if (urisByDate != null) {
|
||||
for (List<String> uris : urisByDate.values()) {
|
||||
for (String uri : uris) {
|
||||
if (uri != null) {
|
||||
if (dupOverride
|
||||
|| !getLoadedUris(siteKey, source)
|
||||
.contains(uri)) {
|
||||
populateFFMPRecord(siteKey,
|
||||
new FFMPRecord(uri), source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts the loader records directly into the cache
|
||||
*
|
||||
*
|
||||
* @param data
|
||||
* @param uris
|
||||
* @param siteKey
|
||||
* @param source
|
||||
*/
|
||||
public void insertFFMPData(FFMPAggregateRecord data,
|
||||
NavigableMap<Date, List<String>> uris, String siteKey, String source) {
|
||||
|
||||
// get record from cache
|
||||
FFMPSourceData sourceData = siteDataMap.get(siteKey).getSourceData(
|
||||
source);
|
||||
|
||||
// add all of the uris
|
||||
for (Entry<Date, List<String>> duris : uris.entrySet()) {
|
||||
if (data.getTimes().contains(duris.getKey().getTime())) {
|
||||
for (String uri : duris.getValue()) {
|
||||
sourceData.getRecord(uri);
|
||||
if (!sourceData.getLoadedUris().contains(uri)) {
|
||||
sourceData.addLoadedUri(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceData.getRecord() != null) {
|
||||
FFMPBasinData basinData = data.getBasins();
|
||||
basinData.populate(data.getTimes());
|
||||
sourceData.getRecord().populate(basinData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try and get the loading off of the GUI thread
|
||||
*
|
||||
* @param siteKey
|
||||
* @param ffmpRec
|
||||
* @param source
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void populateFFMPRecord(String siteKey, FFMPRecord ffmpRec,
|
||||
String source) throws Exception {
|
||||
|
||||
if (ffmpRec != null) {
|
||||
|
||||
List<String> uris = getLoadedUris(siteKey, source);
|
||||
String dataUri = ffmpRec.getDataURI();
|
||||
if (!uris.contains(dataUri)) {
|
||||
Date refTime = ffmpRec.getDataTime().getRefTime();
|
||||
File loc = HDF5Util.findHDF5Location(ffmpRec);
|
||||
|
||||
FFMPSiteData siteData = siteDataMap.get(siteKey);
|
||||
String mySource = source;
|
||||
boolean isGageSource = false;
|
||||
SourceXML sourceXML = fscm.getSource(source);
|
||||
|
||||
if (sourceXML.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
mySource = sourceXML.getDisplayName();
|
||||
} else if (sourceXML.getSourceType().equals(
|
||||
SOURCE_TYPE.GAGE.getSourceType())) {
|
||||
isGageSource = true;
|
||||
}
|
||||
|
||||
FFMPSourceData sourceData = siteData
|
||||
.getSourceData(mySource);
|
||||
FFMPRecord curRecord = sourceData.getRecord(dataUri);
|
||||
|
||||
if (isGageSource) {
|
||||
curRecord.retrieveVirtualMapFromDataStore(loc, dataUri,
|
||||
getTemplates(siteKey), refTime,
|
||||
ffmpRec.getSourceName());
|
||||
} else {
|
||||
curRecord.retrieveMapFromDataStore(loc, dataUri,
|
||||
getTemplates(ffmpRec.getSiteKey()), refTime,
|
||||
ffmpRec.getSourceName());
|
||||
}
|
||||
|
||||
sourceData.addLoadedUri(dataUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load data for a particular basin
|
||||
*
|
||||
* @param dataUri
|
||||
* @param siteKey
|
||||
* @param source
|
||||
* @param phuc
|
||||
* @param basin
|
||||
* @throws Exception
|
||||
*/
|
||||
public void populateFFMPBasin(String dataUri, String siteKey,
|
||||
String source, String phuc, FFMPBasin basin) throws Exception {
|
||||
|
||||
if (dataUri != null) {
|
||||
List<String> uris = getLoadedUris(siteKey, source);
|
||||
if (!uris.contains(dataUri)) {
|
||||
|
||||
SourceXML sourceXML = fscm.getSource(source);
|
||||
FFMPRecord ffmpRec = populateFFMPRecord(dataUri, siteKey,
|
||||
source);
|
||||
File loc = HDF5Util.findHDF5Location(ffmpRec);
|
||||
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
|
||||
|
||||
if (sourceXML.getSourceType().equals(
|
||||
SOURCE_TYPE.GAGE.getSourceType())
|
||||
&& phuc.equals(FFMPRecord.ALL)) {
|
||||
ffmpRec.retrieveVirtualBasinFromDataStore(loc, dataUri,
|
||||
getTemplates(siteKey), ffmpRec.getDataTime()
|
||||
.getRefTime(), basin);
|
||||
} else {
|
||||
ffmpRec.retrieveBasinFromDataStore(dataStore, dataUri,
|
||||
getTemplates(siteKey), phuc, ffmpRec
|
||||
.getDataTime().getRefTime(), ffmpRec
|
||||
.getSourceName(), basin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the URI's by field type and site
|
||||
*
|
||||
* @param siteKey
|
||||
* @param pfield
|
||||
* @return
|
||||
*/
|
||||
|
||||
public List<String> getLoadedUris(String siteKey, String source) {
|
||||
FFMPSiteData siteData = siteDataMap.get(siteKey);
|
||||
FFMPSourceData sourceData = siteData.getSourceData(source);
|
||||
return sourceData.getLoadedUris();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the available uris back to a given time
|
||||
*
|
||||
* @param siteKey
|
||||
* @param dataKey
|
||||
* @param sourceName
|
||||
* @param time
|
||||
* @param retrieveNew
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public ConcurrentNavigableMap<Date, List<String>> getAvailableUris(
|
||||
String siteKey, String dataKey, String sourceName, Date time,
|
||||
boolean retrieveNew) throws Exception {
|
||||
synchronized (uriRequestLock) {
|
||||
ConcurrentNavigableMap<Date, List<String>> sortedUris = siteDataMap
|
||||
.get(siteKey).getSourceData(sourceName).getAvailableUris();
|
||||
Date previousQueryTime = siteDataMap.get(siteKey)
|
||||
.getSourceData(sourceName).getPreviousUriQueryDate();
|
||||
Date earliestTime = time;
|
||||
|
||||
SourceXML source = fscm.getSource(sourceName);
|
||||
boolean isTimeConstraint = true;
|
||||
|
||||
if (source.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
/**
|
||||
* Always look back for guidance types because of long
|
||||
* expiration times, prevents mosaic brittleness from occurring.
|
||||
*/
|
||||
retrieveNew = true;
|
||||
|
||||
if (source.getGuidanceType() != null
|
||||
&& source.getGuidanceType().equals(
|
||||
GUIDANCE_TYPE.ARCHIVE.getGuidanceType())) {
|
||||
isTimeConstraint = false;
|
||||
} else {
|
||||
long timeOffset = source.getExpirationMinutes(siteKey)
|
||||
* TimeUtil.MILLIS_PER_MINUTE;
|
||||
earliestTime = new Date(time.getTime() - timeOffset);
|
||||
}
|
||||
}
|
||||
|
||||
if (retrieveNew
|
||||
|| (time != null && (previousQueryTime == null || time
|
||||
.before(previousQueryTime)))) {
|
||||
DbQueryRequest request = new DbQueryRequest();
|
||||
request.setEntityClass(FFMPRecord.class);
|
||||
request.addRequestField("dataURI");
|
||||
request.setOrderByField("dataTime.refTime", OrderMode.DESC);
|
||||
|
||||
request.addConstraint("wfo", new RequestConstraint(wfo));
|
||||
request.addConstraint("sourceName", new RequestConstraint(
|
||||
sourceName));
|
||||
request.addConstraint("siteKey", new RequestConstraint(siteKey));
|
||||
if (!source.isMosaic()) {
|
||||
request.addConstraint("dataKey", new RequestConstraint(
|
||||
dataKey));
|
||||
|
||||
}
|
||||
|
||||
// ARCHIVE sources don't have a time constraint
|
||||
if (isTimeConstraint) {
|
||||
String earliestTimeString = TimeUtil
|
||||
.formatToSqlTimestamp(earliestTime);
|
||||
|
||||
if (!retrieveNew && (previousQueryTime != null)) {
|
||||
String latestTimeString = TimeUtil
|
||||
.formatToSqlTimestamp(previousQueryTime);
|
||||
RequestConstraint timeRC = new RequestConstraint(null,
|
||||
ConstraintType.BETWEEN);
|
||||
timeRC.setBetweenValueList(new String[] {
|
||||
earliestTimeString, latestTimeString });
|
||||
request.addConstraint("dataTime.refTime", timeRC);
|
||||
} else {
|
||||
request.addConstraint("dataTime.refTime",
|
||||
new RequestConstraint(earliestTimeString,
|
||||
ConstraintType.GREATER_THAN_EQUALS));
|
||||
}
|
||||
}
|
||||
|
||||
handleURIRequest(request, siteKey, dataKey, time);
|
||||
|
||||
}
|
||||
|
||||
if (time != null) {
|
||||
if (source.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
return sortedUris;
|
||||
} else {
|
||||
return sortedUris.tailMap(time, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a single database request to populate the availableUris for
|
||||
* multiple sources. After preloading the uris the uris for each source can
|
||||
* be retrieved with getAvailableUris
|
||||
*
|
||||
* @param siteKey
|
||||
* @param dataKey
|
||||
* @param sourceNames
|
||||
* @param time
|
||||
* @throws Exception
|
||||
*/
|
||||
public void preloadAvailableUris(String siteKey, String dataKey,
|
||||
Set<String> sourceNames, Date time) throws Exception {
|
||||
synchronized (uriRequestLock) {
|
||||
DbQueryRequest request = new DbQueryRequest();
|
||||
request.setEntityClass(FFMPRecord.class);
|
||||
request.addRequestField("dataURI");
|
||||
request.setOrderByField("dataTime.refTime", OrderMode.DESC);
|
||||
|
||||
request.addConstraint("wfo", new RequestConstraint(wfo));
|
||||
request.addConstraint("siteKey", new RequestConstraint(siteKey));
|
||||
request.addConstraint("dataTime.refTime", new RequestConstraint(
|
||||
TimeUtil.formatToSqlTimestamp(time),
|
||||
ConstraintType.GREATER_THAN_EQUALS));
|
||||
|
||||
RequestConstraint sourceRC = new RequestConstraint(null,
|
||||
ConstraintType.IN);
|
||||
sourceRC.setConstraintValueList(sourceNames);
|
||||
request.addConstraint("sourceName", sourceRC);
|
||||
|
||||
handleURIRequest(request, siteKey, dataKey, time);
|
||||
FFMPSiteData siteData = siteDataMap.get(siteKey);
|
||||
for (String sourceName : sourceNames) {
|
||||
// This is done to ensure that the previous query time is
|
||||
// updated, even for sources with no data.
|
||||
FFMPSourceData sourceData = siteData.getSourceData(sourceName);
|
||||
Date oldPrevTime = sourceData.getPreviousUriQueryDate();
|
||||
if (oldPrevTime == null || time.before(oldPrevTime)) {
|
||||
sourceData.setPreviousUriQueryDate(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a pre assembled database query for uris. The request is sent to
|
||||
* edex and the response is parsed to populate the uris in the siteDataMap.
|
||||
*
|
||||
* @param request
|
||||
* @param siteKey
|
||||
* @param dataKey
|
||||
* @param time
|
||||
* @throws Exception
|
||||
*/
|
||||
private void handleURIRequest(DbQueryRequest request, String siteKey,
|
||||
String dataKey, Date time) throws Exception {
|
||||
|
||||
FFMPSiteData siteData = siteDataMap.get(siteKey);
|
||||
DbQueryResponse dbResponse = (DbQueryResponse) RequestRouter
|
||||
.route(request);
|
||||
Map<String, List<FFMPRecord>> recordsBySource = new HashMap<String, List<FFMPRecord>>();
|
||||
|
||||
for (String datauri : dbResponse.getFieldObjects("dataURI",
|
||||
String.class)) {
|
||||
FFMPRecord record = new FFMPRecord(datauri);
|
||||
List<FFMPRecord> records = recordsBySource.get(record
|
||||
.getSourceName());
|
||||
if (records == null) {
|
||||
records = new ArrayList<FFMPRecord>();
|
||||
recordsBySource.put(record.getSourceName(), records);
|
||||
}
|
||||
records.add(record);
|
||||
}
|
||||
for (Entry<String, List<FFMPRecord>> entry : recordsBySource.entrySet()) {
|
||||
String sourceName = entry.getKey();
|
||||
SourceXML sourceXml = fscm.getSource(sourceName);
|
||||
boolean isMosiac = sourceXml.isMosaic();
|
||||
FFMPSourceData sourceData = siteData.getSourceData(sourceName);
|
||||
Map<Date, List<String>> sortedUris = sourceData.getAvailableUris();
|
||||
|
||||
List<String> list = new LinkedList<String>();
|
||||
Date prevRefTime = null;
|
||||
for (FFMPRecord rec : entry.getValue()) {
|
||||
if (!isMosiac && !rec.getDataKey().equals(dataKey)) {
|
||||
continue;
|
||||
}
|
||||
Date curRefTime = rec.getDataTime().getRefTime();
|
||||
if ((prevRefTime != null) && !prevRefTime.equals(curRefTime)) {
|
||||
sortedUris.put(prevRefTime, list);
|
||||
list = new LinkedList<String>();
|
||||
}
|
||||
prevRefTime = curRefTime;
|
||||
list.add(rec.getDataURI());
|
||||
}
|
||||
|
||||
if (prevRefTime != null) {
|
||||
sortedUris.put(prevRefTime, list);
|
||||
}
|
||||
|
||||
Date prevTime = time;
|
||||
if (sourceXml.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
long timeOffset = sourceXml.getExpirationMinutes(siteKey)
|
||||
* TimeUtil.MILLIS_PER_MINUTE;
|
||||
prevTime = new Date(time.getTime() - timeOffset);
|
||||
}
|
||||
Date oldPrevTime = sourceData.getPreviousUriQueryDate();
|
||||
if (oldPrevTime == null || prevTime.before(oldPrevTime)) {
|
||||
sourceData.setPreviousUriQueryDate(prevTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process an individual URI
|
||||
*
|
||||
* @param isProductLoad
|
||||
* @param uri
|
||||
* @param siteKey
|
||||
* @param sourceName
|
||||
* @param barrierTime
|
||||
* @throws Exception
|
||||
*/
|
||||
public void processUri(String uri, String siteKey, String sourceName,
|
||||
Date barrierTime) throws Exception {
|
||||
if (uri != null) {
|
||||
|
||||
FFMPRecord record = populateFFMPRecord(uri, siteKey, sourceName);
|
||||
if (record != null) {
|
||||
record.getBasinData().loadNow();
|
||||
SourceXML source = fscm.getSource(sourceName);
|
||||
if (source != null) {
|
||||
record.setExpiration(source.getExpirationMinutes(siteKey));
|
||||
record.setRate(source.isRate());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* fire off a cleaner
|
||||
*
|
||||
* @param product
|
||||
* @param source
|
||||
* @param siteKey
|
||||
* @param date
|
||||
*/
|
||||
public void purgeFFMPData(ProductXML product, String source,
|
||||
String siteKey, Date date) {
|
||||
|
||||
ArrayList<String> purgeSources = new ArrayList<String>();
|
||||
|
||||
if (product != null) {
|
||||
|
||||
ProductRunXML productRun = frcm.getProduct(siteKey);
|
||||
|
||||
// guidance
|
||||
for (String type : productRun.getGuidanceTypes(product)) {
|
||||
for (SourceXML guidSource : productRun.getGuidanceSources(
|
||||
product, type)) {
|
||||
// Don't purge archive guidance!
|
||||
if (guidSource != null
|
||||
&& guidSource.getGuidanceType() != null
|
||||
&& !guidSource.getGuidanceType()
|
||||
.equals(GUIDANCE_TYPE.ARCHIVE
|
||||
.getGuidanceType())) {
|
||||
purgeSources.add(guidSource.getSourceName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// qpf
|
||||
for (String type : productRun.getQpfTypes(product)) {
|
||||
for (SourceXML qpfSource : productRun.getQpfSources(
|
||||
product, type)) {
|
||||
if (qpfSource != null) {
|
||||
purgeSources.add(qpfSource.getSourceName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// qpe, etc
|
||||
for (String sourceName : product.getSources()) {
|
||||
if (!purgeSources.contains(sourceName)) {
|
||||
purgeSources.add(sourceName);
|
||||
}
|
||||
}
|
||||
|
||||
for (String sourceName : purgeSources) {
|
||||
|
||||
SourceXML sourceXML = fscm.getSource(sourceName);
|
||||
|
||||
if (sourceXML != null) {
|
||||
if (sourceXML.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
sourceName = SOURCE_TYPE.GUIDANCE.getSourceType();
|
||||
}
|
||||
|
||||
if (siteDataMap != null) {
|
||||
if (siteDataMap.containsSite(siteKey)) {
|
||||
FFMPRecord record = siteDataMap.get(siteKey)
|
||||
.getSourceData(sourceName).getRecord();
|
||||
if (record != null) {
|
||||
record.purgeData(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (siteDataMap != null) {
|
||||
if (siteDataMap.containsSite(siteKey)) {
|
||||
FFMPRecord record = siteDataMap.get(siteKey)
|
||||
.getSourceData(source).getRecord();
|
||||
if (record != null) {
|
||||
record.purgeData(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FFMPSiteData siteData = siteDataMap.get(siteKey);
|
||||
for (String sourceEntry : siteData.getSources()) {
|
||||
ConcurrentNavigableMap<Date, List<String>> oldUris = siteData
|
||||
.getSourceData(sourceEntry).getAvailableUris()
|
||||
.headMap(date);
|
||||
for (List<String> uris : oldUris.headMap(date).values()) {
|
||||
for (String uri : uris) {
|
||||
|
||||
if (product != null) {
|
||||
|
||||
for (String sourceName : purgeSources) {
|
||||
|
||||
if (siteData.getSourceData(sourceName)
|
||||
.hasLoadedAnyUris()) {
|
||||
FFMPSourceData sourceData = siteData
|
||||
.getSourceData(sourceName);
|
||||
|
||||
sourceData.removeLoadedUri(uri);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
FFMPSourceData sourceData = siteData
|
||||
.getSourceData(source);
|
||||
|
||||
sourceData.removeLoadedUri(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oldUris.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear site Data
|
||||
*/
|
||||
public void clear() {
|
||||
siteDataMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a site.
|
||||
* @param siteKey
|
||||
*/
|
||||
public void removeSite(String siteKey) {
|
||||
siteDataMap.removeSite(siteKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the FFMP Data for this site.
|
||||
*
|
||||
* @param siteKey
|
||||
* @return
|
||||
*/
|
||||
public FFMPSiteData getFFMPSiteData(String siteKey) {
|
||||
return siteDataMap.get(siteKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source data for this source.
|
||||
*
|
||||
* @param siteKey
|
||||
* @param sourceName
|
||||
* @return
|
||||
*/
|
||||
public FFMPSourceData getSourceData(String siteKey, String sourceName) {
|
||||
return siteDataMap.get(siteKey).getSourceData(sourceName);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.collections;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* A data container that holds the site's FFMPSourceData for each source.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 18, 2013 njensen Initial creation
|
||||
* Feb 28, 2013 1729 dhladky Sped up, synch blocks were hanging it.
|
||||
* Oct 26, 2015 5056 dhladky Moved to common area for data cache.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPSiteData {
|
||||
|
||||
private ConcurrentMap<String, FFMPSourceData> sourceMap = new ConcurrentHashMap<String, FFMPSourceData>();
|
||||
|
||||
/**
|
||||
* Gets the data of the specified source
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public FFMPSourceData getSourceData(String source) {
|
||||
|
||||
FFMPSourceData sourceData = sourceMap.get(source);
|
||||
|
||||
if (sourceData == null) {
|
||||
sourceData = new FFMPSourceData();
|
||||
FFMPSourceData previous = sourceMap.putIfAbsent(source, sourceData);
|
||||
if (previous != null) {
|
||||
return previous;
|
||||
}
|
||||
}
|
||||
|
||||
return sourceData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all the data for the site
|
||||
*/
|
||||
public void clear() {
|
||||
for (FFMPSourceData source : sourceMap.values()) {
|
||||
source.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there is a data object for the source
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public boolean containsSource(String source) {
|
||||
return sourceMap.containsKey(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sources that have data objects
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<String> getSources() {
|
||||
return sourceMap.keySet();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.collections;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* FFMP data container that holds the FFMPSiteData for each site.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 19, 2013 njensen Initial creation
|
||||
* Feb 28, 2013 1729 dhladky Sped up, synch blocks were hanging it.
|
||||
* Oct 26, 2015 5056 dhladky Moved to common area for data cache.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPSiteDataContainer {
|
||||
|
||||
private ConcurrentMap<String, FFMPSiteData> siteDataMap = new ConcurrentHashMap<String, FFMPSiteData>();
|
||||
|
||||
public FFMPSiteData get(String siteKey) {
|
||||
|
||||
FFMPSiteData data = siteDataMap.get(siteKey);
|
||||
|
||||
if (data == null) {
|
||||
data = new FFMPSiteData();
|
||||
FFMPSiteData previous = siteDataMap.putIfAbsent(siteKey, data);
|
||||
if (previous != null) {
|
||||
return previous;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
Collection<FFMPSiteData> vals = siteDataMap.values();
|
||||
for (FFMPSiteData data : vals) {
|
||||
data.clear();
|
||||
}
|
||||
|
||||
siteDataMap.clear();
|
||||
}
|
||||
|
||||
public FFMPSiteData removeSite(String siteKey) {
|
||||
|
||||
return siteDataMap.remove(siteKey);
|
||||
}
|
||||
|
||||
public boolean containsSite(String siteKey) {
|
||||
return siteDataMap.containsKey(siteKey);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,175 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.collections;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentNavigableMap;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
|
||||
|
||||
/**
|
||||
* A data container that holds FFMPRecords, the previousUriQueryDate, and the
|
||||
* available and loaded URIs for the particular source associated with a site.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 18, 2013 njensen Initial creation
|
||||
* Feb 28, 2013 1729 dhladky Sped up, synch blocks were hanging it.
|
||||
* Jul 15, 2013 2184 dhladky Removed all HUC's but ALL
|
||||
* Oct 26, 2015 5056 dhladky Moved to common area for data cache.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FFMPSourceData {
|
||||
|
||||
private AtomicReference<FFMPRecord> ffmpData = new AtomicReference<FFMPRecord>();
|
||||
|
||||
/** earliest available date queried **/
|
||||
private Date previousUriQueryDate;
|
||||
|
||||
private ConcurrentNavigableMap<Date, List<String>> availableUris = new ConcurrentSkipListMap<Date, List<String>>();
|
||||
|
||||
/** map of huc to list of loaded URIs **/
|
||||
private List<String> loadedUris = new ArrayList<String>();
|
||||
|
||||
/**
|
||||
* Clears the data
|
||||
*/
|
||||
public void clear() {
|
||||
ffmpData = null;
|
||||
previousUriQueryDate = null;
|
||||
availableUris.clear();
|
||||
synchronized (loadedUris) {
|
||||
loadedUris.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the FFMPRecord from the AtomicReference
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FFMPRecord getRecord() {
|
||||
|
||||
return ffmpData.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the FFMPRecord and sets it if null.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FFMPRecord getRecord(String uri) {
|
||||
|
||||
FFMPRecord record = ffmpData.get();
|
||||
|
||||
if (record == null) {
|
||||
record = new FFMPRecord(uri);
|
||||
if (!ffmpData.compareAndSet(null, record)) {
|
||||
record = ffmpData.get();
|
||||
}
|
||||
}
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the previous time that URIs were queried for for this site and
|
||||
* source.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getPreviousUriQueryDate() {
|
||||
return previousUriQueryDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the previous time that URIs were queried for for this site and
|
||||
* source.
|
||||
*
|
||||
* @param previousUriQueryDate
|
||||
*/
|
||||
public void setPreviousUriQueryDate(Date previousUriQueryDate) {
|
||||
this.previousUriQueryDate = previousUriQueryDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URIs that have been loaded.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<String> getLoadedUris() {
|
||||
return Collections.unmodifiableList(loadedUris);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks a URI as loaded.
|
||||
*
|
||||
* @param uri
|
||||
*/
|
||||
public void addLoadedUri(String uri) {
|
||||
synchronized (loadedUris) {
|
||||
loadedUris.add(uri);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this site and source has loaded any URIs yet.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean hasLoadedAnyUris() {
|
||||
return !loadedUris.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Available URIs based on time.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ConcurrentNavigableMap<Date, List<String>> getAvailableUris() {
|
||||
return availableUris;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a URI
|
||||
*
|
||||
* @param uri
|
||||
*/
|
||||
public void removeLoadedUri(String uri) {
|
||||
synchronized (loadedUris) {
|
||||
loadedUris.remove(uri);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,153 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.collections;
|
||||
|
||||
import java.util.AbstractSet;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.SortedSet;
|
||||
|
||||
/**
|
||||
*
|
||||
* Generic NavigableSet which is implemented by wrapping a fully implemented
|
||||
* NavigableMap. Very useful for custom NavigableMap implementations.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 31, 2013 2242 bsteffen Extracted from ArrayBackedMap
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
* @param <K>
|
||||
*/
|
||||
class NavigableKeySet<K> extends AbstractSet<K> implements NavigableSet<K> {
|
||||
|
||||
private final NavigableMap<K, ?> map;
|
||||
|
||||
public NavigableKeySet(NavigableMap<K, ?> map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<K> iterator() {
|
||||
return map.keySet().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return map.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparator<? super K> comparator() {
|
||||
return map.comparator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K first() {
|
||||
return map.firstKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K last() {
|
||||
return map.lastKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K lower(K e) {
|
||||
return map.lowerKey(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public K floor(K e) {
|
||||
return map.floorKey(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public K ceiling(K e) {
|
||||
return map.ceilingKey(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public K higher(K e) {
|
||||
return map.higherKey(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public K pollFirst() {
|
||||
return map.pollFirstEntry().getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K pollLast() {
|
||||
return map.pollLastEntry().getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableSet<K> descendingSet() {
|
||||
return map.descendingKeySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<K> descendingIterator() {
|
||||
return descendingSet().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableSet<K> subSet(K fromElement, boolean fromInclusive,
|
||||
K toElement, boolean toInclusive) {
|
||||
return map.subMap(fromElement, fromInclusive, toElement,
|
||||
toInclusive).navigableKeySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableSet<K> headSet(K toElement, boolean inclusive) {
|
||||
return map.headMap(toElement, inclusive).navigableKeySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigableSet<K> tailSet(K fromElement, boolean inclusive) {
|
||||
return map.tailMap(fromElement, inclusive).navigableKeySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<K> subSet(K fromElement, K toElement) {
|
||||
return subSet(fromElement, true, toElement, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<K> headSet(K toElement) {
|
||||
return headSet(toElement, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<K> tailSet(K fromElement) {
|
||||
return tailSet(fromElement, true);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,734 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp.dataaccess;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.measure.unit.Unit;
|
||||
|
||||
import com.raytheon.uf.common.dataaccess.IDataRequest;
|
||||
import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException;
|
||||
import com.raytheon.uf.common.dataaccess.exception.IncompatibleRequestException;
|
||||
import com.raytheon.uf.common.dataaccess.exception.InvalidIdentifiersException;
|
||||
import com.raytheon.uf.common.dataaccess.exception.TimeAgnosticDataException;
|
||||
import com.raytheon.uf.common.dataaccess.geom.IGeometryData;
|
||||
import com.raytheon.uf.common.dataaccess.impl.AbstractDataPluginFactory;
|
||||
import com.raytheon.uf.common.dataaccess.impl.DefaultGeometryData;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinData;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceBasin;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceInterpolation;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.HucLevelGeometriesFactory;
|
||||
import com.raytheon.uf.common.dataplugin.ffmp.collections.FFMPDataCache;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.common.monitor.config.FFFGDataMgr;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.xml.DomainXML;
|
||||
import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductXML;
|
||||
import com.raytheon.uf.common.monitor.xml.SourceXML;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
/**
|
||||
* A data factory for retrieving FFMP data.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- --------- --------------------------------------------
|
||||
* Jan 24, 2013 1552 mpduff Initial creation
|
||||
* Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
* Aug 20, 2013 2250 mnash Change some methods that were not working in
|
||||
* all cases
|
||||
* Jan 14, 2014 2667 mnash Remove getGridData method
|
||||
* May 01, 2014 3099 bkowal No longer use an empty pfaf list when the
|
||||
* data request locationNames list is empty.
|
||||
* Jun 24, 2014 3170 mnash Get the accumulated time if multiple times
|
||||
* are requested
|
||||
* Jul 14, 2014 3184 njensen Overrode getAvailableLevels()
|
||||
* Jul 30, 2014 3184 njensen Overrode required and optional identifiers
|
||||
* Feb 27, 2015 4180 mapeters Overrode getAvailableParameters().
|
||||
* Jun 15, 2015 4560 ccody Added support for configurable
|
||||
* rate/accumulation calculation for
|
||||
* getGeometryData
|
||||
* Jul 16, 2015 4658 dhladky Expiration times fixed.
|
||||
* Oct 26, 2015 5056 dhladky Re-wrote to take advantage of FFMP common
|
||||
* data cache, fix general bugs.
|
||||
* Jun 07, 2016 5587 tgurney Change get*Identifiers() to take
|
||||
* IDataRequest
|
||||
* Jun 09, 2016 5587 tgurney Return early from getGeometryData if no
|
||||
* records returned from database
|
||||
* Jun 20, 2016 5587 tgurney Implement getIdentifierValues()
|
||||
* Jul 01, 2016 5728 mapeters Support RequestConstraint identifier values
|
||||
* for siteKey and dataKey, only allow 1 param
|
||||
* to be set since only 1 is retrieved, support
|
||||
* getIdentifierValues() for huc, accumHrs
|
||||
* Aug 01, 2016 2416 tgurney Add dataURI as optional identifier
|
||||
* Aug 08, 2016 5728 mapeters Better error handling for invalid sourceName
|
||||
* Mar 06, 2017 6142 bsteffen Remove dataURI as optional identifier
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
*/
|
||||
|
||||
public class FFMPGeometryFactory extends AbstractDataPluginFactory {
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(FFMPGeometryFactory.class);
|
||||
|
||||
/** Site key constant */
|
||||
public static final String SITE_KEY = "siteKey";
|
||||
|
||||
/** Data key constant */
|
||||
public static final String DATA_KEY = "dataKey";
|
||||
|
||||
/** wfo constant */
|
||||
public static final String WFO = "wfo";
|
||||
|
||||
/** plugin constant */
|
||||
public static final String PLUGIN_NAME = "ffmp";
|
||||
|
||||
/** huc constant */
|
||||
public static final String HUC = "huc";
|
||||
|
||||
/** source name constant */
|
||||
public static final String SOURCE_NAME = "sourceName";
|
||||
|
||||
/** accumulation hours, needed for FFG interpolator */
|
||||
public static final String ACCUM_HRS = "accumHrs";
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public FFMPGeometryFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected IGeometryData[] getGeometryData(IDataRequest request,
|
||||
DbQueryResponse dbQueryResponse) {
|
||||
List<Map<String, Object>> results = dbQueryResponse.getResults();
|
||||
|
||||
if (results.isEmpty()) {
|
||||
return new IGeometryData[0];
|
||||
}
|
||||
|
||||
String cwa = extractIdentifierValue(request, WFO, String.class);
|
||||
String sourceName = null;
|
||||
Map<String, Set<String>> siteKeysToDataKeys = new HashMap<>();
|
||||
Map<String, Date> siteKeysToStartDates = new HashMap<>();
|
||||
Map<String, Date> siteKeysToEndDates = new HashMap<>();
|
||||
|
||||
FFMPDataCache cache = getCache(cwa);
|
||||
|
||||
// Ensures that all records have been added to the cache
|
||||
// before calculations
|
||||
for (Map<String, Object> map : results) {
|
||||
for (Map.Entry<String, Object> es : map.entrySet()) {
|
||||
FFMPRecord rec = (FFMPRecord) es.getValue();
|
||||
String siteKey = rec.getSiteKey();
|
||||
if (sourceName == null) {
|
||||
sourceName = rec.getSourceName();
|
||||
}
|
||||
|
||||
Set<String> dataKeys = siteKeysToDataKeys.get(siteKey);
|
||||
if (dataKeys == null) {
|
||||
dataKeys = new HashSet<>();
|
||||
siteKeysToDataKeys.put(siteKey, dataKeys);
|
||||
}
|
||||
dataKeys.add(rec.getDataKey());
|
||||
|
||||
try {
|
||||
cache.populateFFMPRecord(siteKey, rec, rec.getSourceName());
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to populate FFMPRecord: "
|
||||
+ rec.getDataURI(),
|
||||
e);
|
||||
}
|
||||
|
||||
/*
|
||||
* building a time range of the earliest FFMP time (based on
|
||||
* each record) to the latest FFMP time (based on each record)
|
||||
*/
|
||||
Date recDate = rec.getDataTime().getRefTime();
|
||||
Date start = siteKeysToStartDates.get(siteKey);
|
||||
if (start == null || start.after(recDate)) {
|
||||
siteKeysToStartDates.put(siteKey, recDate);
|
||||
}
|
||||
Date end = siteKeysToEndDates.get(siteKey);
|
||||
if (end == null || end.before(recDate)) {
|
||||
siteKeysToEndDates.put(siteKey, recDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IGeometryData> geomRecords = new ArrayList<>();
|
||||
|
||||
// Calculate separate set of records for each site
|
||||
for (Entry<String, Set<String>> entry : siteKeysToDataKeys.entrySet()) {
|
||||
// Time window for FFMP slides +- the 1/2 QPE expiration time.
|
||||
SourceXML source = FFMPSourceConfigurationManager.getInstance()
|
||||
.getSource(sourceName);
|
||||
if (source == null) {
|
||||
String msg = "Invalid source name: " + sourceName
|
||||
+ " (not configured in "
|
||||
+ FFMPSourceConfigurationManager.getInstance()
|
||||
.getConfigFileName()
|
||||
+ ")";
|
||||
throw new IncompatibleRequestException(msg);
|
||||
}
|
||||
String siteKey = entry.getKey();
|
||||
int expirationTime = source.getExpirationMinutes(siteKey);
|
||||
Date start = siteKeysToStartDates.get(siteKey);
|
||||
start = new Date(start.getTime()
|
||||
- TimeUtil.MILLIS_PER_MINUTE * (expirationTime / 2));
|
||||
Date end = siteKeysToEndDates.get(siteKey);
|
||||
|
||||
/*
|
||||
* now that we have all the basin data in the cache, we can use the
|
||||
* methods on the FFMPDataCache class to get the accumulated value
|
||||
* in the case of a non-guidance basin
|
||||
*/
|
||||
Map<Long, DefaultGeometryData> result = null;
|
||||
try {
|
||||
result = makeGeometryData(siteKey, entry.getValue(), sourceName,
|
||||
request, start, end);
|
||||
} catch (Exception e) {
|
||||
String msg = "Unable to create Geometry Data: " + SOURCE_NAME
|
||||
+ "=" + sourceName + ", " + SITE_KEY + "=" + siteKey;
|
||||
throw new DataRetrievalException(msg, e);
|
||||
}
|
||||
|
||||
geomRecords.addAll(result.values());
|
||||
}
|
||||
|
||||
return geomRecords.toArray(new IGeometryData[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, RequestConstraint> buildConstraintsFromRequest(
|
||||
IDataRequest request) {
|
||||
Map<String, RequestConstraint> map = new HashMap<>();
|
||||
for (Map.Entry<String, Object> entry : request.getIdentifiers()
|
||||
.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
// exclude these parameters
|
||||
if (!key.equals(ACCUM_HRS) && !key.equals(HUC)) {
|
||||
Object value = entry.getValue();
|
||||
RequestConstraint constraint;
|
||||
if (value instanceof RequestConstraint) {
|
||||
constraint = (RequestConstraint) value;
|
||||
} else {
|
||||
constraint = new RequestConstraint(value.toString());
|
||||
}
|
||||
map.put(key, constraint);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Most requests will have been validated to have exactly 1 param (for
|
||||
* requesting grid data or times), but other requests (e.g. for
|
||||
* available parameters) don't validate the number of params set, so
|
||||
* support any number
|
||||
*/
|
||||
String[] params = request.getParameters();
|
||||
if (params.length > 0) {
|
||||
RequestConstraint paramConstraint = new RequestConstraint(params);
|
||||
map.put(SOURCE_NAME, paramConstraint);
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an identifier value that must be provided as an instance of the given
|
||||
* valueType (or may not be provided at all)
|
||||
*
|
||||
* @param request
|
||||
* @param key
|
||||
* @param valueType
|
||||
* @return the identifier value (may be null)
|
||||
*/
|
||||
private <T> T extractIdentifierValue(IDataRequest request, String key,
|
||||
Class<T> valueType) {
|
||||
Object value = request.getIdentifiers().get(key);
|
||||
if (value == null) {
|
||||
return null;
|
||||
} else if (valueType.isInstance(value)) {
|
||||
return valueType.cast(value);
|
||||
} else {
|
||||
throw new IncompatibleRequestException(
|
||||
"Only " + valueType.getSimpleName()
|
||||
+ " identifier values are valid for '" + key + "'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of site keys that satisfy the identifier constraints on the
|
||||
* given request
|
||||
*
|
||||
* @param request
|
||||
* @param key
|
||||
* @return the list of site keys
|
||||
*/
|
||||
private String[] getSiteKeyValues(IDataRequest request) {
|
||||
Object idConstraint = request.getIdentifiers().get(SITE_KEY);
|
||||
if (idConstraint instanceof String) {
|
||||
// If directly provided as a string, just return it
|
||||
return new String[] { (String) idConstraint };
|
||||
} else if (idConstraint instanceof RequestConstraint) {
|
||||
// Automatically excludes values that don't satisfy identifiers
|
||||
return getAvailableValues(request, SITE_KEY, String.class);
|
||||
} else {
|
||||
throw new IncompatibleRequestException(
|
||||
"Only string and RequestConstraint identifier values are valid for '"
|
||||
+ SITE_KEY + "'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the IGeometryData objects.
|
||||
*
|
||||
* @param sourceName
|
||||
* @param request
|
||||
* @param start
|
||||
* @param end
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private Map<Long, DefaultGeometryData> makeGeometryData(String siteKey,
|
||||
Set<String> dataKeys, String sourceName, IDataRequest request,
|
||||
Date start, Date end) throws Exception {
|
||||
|
||||
Map<Long, DefaultGeometryData> result = new HashMap<>();
|
||||
|
||||
String cwa = extractIdentifierValue(request, WFO, String.class);
|
||||
String huc = extractIdentifierValue(request, HUC, String.class);
|
||||
|
||||
FFMPDataCache cache = getCache(cwa);
|
||||
|
||||
FFMPGuidanceInterpolation interpolation = null;
|
||||
FFMPBasinData basinData = null;
|
||||
SourceXML source = FFMPSourceConfigurationManager.getInstance()
|
||||
.getSource(sourceName);
|
||||
if (isGuidance(source)) {
|
||||
Number accumulationTime = extractIdentifierValue(request, ACCUM_HRS,
|
||||
Number.class);
|
||||
basinData = cache.getSourceData(siteKey, source.getDisplayName())
|
||||
.getRecord().getBasinData();
|
||||
interpolation = getGuidanceInterpolation(accumulationTime,
|
||||
sourceName, cwa, siteKey);
|
||||
} else {
|
||||
basinData = cache.getSourceData(siteKey, sourceName).getRecord()
|
||||
.getBasinData();
|
||||
}
|
||||
|
||||
Map<Long, FFMPBasin> basinDataMap = basinData.getBasins();
|
||||
|
||||
String rateOrAccum = null;
|
||||
if (source.getSourceType().equals(SOURCE_TYPE.QPE.getSourceType())) {
|
||||
rateOrAccum = source.getRateOrAccum(siteKey);
|
||||
}
|
||||
|
||||
boolean isRate = true;
|
||||
/**
|
||||
* This is a misnomer that has caused loads of confusion. In actuality
|
||||
* when the FFMPBasin accumulates it checks that the Type is NOT a rate
|
||||
* and in fact should be accumulating. RATE == false. So in effect,
|
||||
* values that FFMP stores as RATE==true are actually NOT rates when
|
||||
* accumulated. So if, it is stored as RATE, it must use FALSE when
|
||||
* processing the accumulation.
|
||||
*/
|
||||
if (rateOrAccum != null && !rateOrAccum.isEmpty()
|
||||
&& rateOrAccum.compareToIgnoreCase("RATE") == 0) {
|
||||
isRate = false;
|
||||
}
|
||||
DefaultGeometryData data = null;
|
||||
|
||||
HucLevelGeometriesFactory geomFactory = HucLevelGeometriesFactory
|
||||
.getInstance();
|
||||
|
||||
Map<Long, Geometry> geomMap = geomFactory
|
||||
.getGeometries(cache.getTemplates(siteKey), siteKey, cwa, huc);
|
||||
|
||||
List<Long> pfafList = getAvailableLocationPfafs(request);
|
||||
|
||||
for (Entry<Long, Geometry> entry : geomMap.entrySet()) {
|
||||
Long pfaf = entry.getKey();
|
||||
if (pfafList == null || pfafList.contains(pfaf)) {
|
||||
if (result.containsKey(pfaf)) {
|
||||
data = result.get(pfaf);
|
||||
} else {
|
||||
data = new DefaultGeometryData();
|
||||
Map<String, Object> attrs = new HashMap<>();
|
||||
attrs.put(DATA_KEY, buildDataKeysString(dataKeys));
|
||||
attrs.put(SITE_KEY, siteKey);
|
||||
attrs.put(WFO, cwa);
|
||||
attrs.put(HUC, huc);
|
||||
data.setAttributes(attrs);
|
||||
data.setLocationName(String.valueOf(pfaf));
|
||||
data.setGeometry(entry.getValue());
|
||||
data.setDataTime(new DataTime(start.getTime(),
|
||||
new TimeRange(start, end)));
|
||||
result.put(pfaf, data);
|
||||
}
|
||||
|
||||
FFMPBasin basin = basinDataMap.get(pfaf);
|
||||
Float value = null;
|
||||
|
||||
if (basin == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Guidance Basins will use interpolation, need this to
|
||||
* perfectly match FFMP table.
|
||||
*/
|
||||
if (basin instanceof FFMPGuidanceBasin) {
|
||||
|
||||
if (interpolation.isInterpolate()) {
|
||||
// Interpolating between sources
|
||||
value = ((FFMPGuidanceBasin) basin)
|
||||
.getInterpolatedValue(interpolation,
|
||||
source.getExpirationMinutes(siteKey)
|
||||
* TimeUtil.MILLIS_PER_MINUTE);
|
||||
} else {
|
||||
value = ((FFMPGuidanceBasin) basin).getValue(
|
||||
interpolation.getStandardSource(),
|
||||
interpolation,
|
||||
source.getExpirationMinutes(siteKey)
|
||||
* TimeUtil.MILLIS_PER_MINUTE);
|
||||
}
|
||||
|
||||
// Will allow for any forcing to take precedence
|
||||
FFFGDataMgr dman = FFFGDataMgr.getInstance();
|
||||
if (!dman.isExpired()) {
|
||||
value = dman.adjustValue(value, sourceName,
|
||||
basin.getPfaf(),
|
||||
((FFMPGuidanceBasin) basin).getCountyFips());
|
||||
}
|
||||
|
||||
} else {
|
||||
value = basin
|
||||
.getAccumValue(start, end,
|
||||
source.getExpirationMinutes(siteKey)
|
||||
* TimeUtil.MILLIS_PER_MINUTE,
|
||||
isRate);
|
||||
}
|
||||
String parameter = sourceName;
|
||||
String unitStr = source.getUnit();
|
||||
|
||||
Unit<?> unit = null;
|
||||
if (unitStr.equals(SourceXML.UNIT_TXT)) {
|
||||
unit = Unit.valueOf("in");
|
||||
}
|
||||
|
||||
if (unit != null) {
|
||||
data.addData(parameter, value, unit);
|
||||
} else {
|
||||
data.addData(parameter, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataTime[] getAvailableTimes(IDataRequest request,
|
||||
boolean refTimeOnly) throws TimeAgnosticDataException {
|
||||
validateRequest(request);
|
||||
return super.getAvailableTimes(request, refTimeOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataTime[] getAvailableTimes(IDataRequest request,
|
||||
BinOffset binOffset) throws TimeAgnosticDataException {
|
||||
validateRequest(request);
|
||||
return super.getAvailableTimes(request, binOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String[] getAvailableLocationNames(IDataRequest request) {
|
||||
// Requires most of required ids to get location pfafs
|
||||
validateRequest(request, false);
|
||||
// Changed this to query the active Templates, not the DB.
|
||||
List<Long> pfafs = getAvailableLocationPfafs(request);
|
||||
|
||||
List<String> pfafList = new ArrayList<>(pfafs.size());
|
||||
for (Long pfaf : pfafs) {
|
||||
pfafList.add(String.valueOf(pfaf));
|
||||
}
|
||||
|
||||
return pfafList.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the available location Pfafs. Note that the request must have been
|
||||
* validated to contain all required identifiers before calling this method.
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
private List<Long> getAvailableLocationPfafs(IDataRequest request) {
|
||||
String wfo = extractIdentifierValue(request, WFO, String.class);
|
||||
String huc = extractIdentifierValue(request, HUC, String.class);
|
||||
String[] siteKeys = getSiteKeyValues(request);
|
||||
|
||||
Set<Long> pfafs = new HashSet<>();
|
||||
|
||||
FFMPDataCache cache = getCache(wfo);
|
||||
for (String siteKey : siteKeys) {
|
||||
FFMPTemplates templates = cache.getTemplates(siteKey);
|
||||
List<DomainXML> domains = templates.getDomains();
|
||||
pfafs.addAll(templates.getHucKeyList(siteKey, huc, domains));
|
||||
}
|
||||
|
||||
return new ArrayList<>(pfafs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void validateParameters(IDataRequest request)
|
||||
throws IncompatibleRequestException {
|
||||
// Exactly 1 parameter must be set
|
||||
String[] params = request.getParameters();
|
||||
if (params == null || params.length != 1) {
|
||||
throw new IncompatibleRequestException("Requests of "
|
||||
+ request.getDatatype()
|
||||
+ " data must have exactly one parameter specified");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAvailableParameters(IDataRequest request) {
|
||||
return this.getAvailableValues(request, SOURCE_NAME, String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Level[] getAvailableLevels(IDataRequest request) {
|
||||
throw new IncompatibleRequestException(request.getDatatype()
|
||||
+ " data does not support the concept of levels");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getRequiredIdentifiers(IDataRequest request) {
|
||||
return new String[] { SITE_KEY, WFO, HUC };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getOptionalIdentifiers(IDataRequest request) {
|
||||
return new String[] { DATA_KEY, ACCUM_HRS };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getIdentifierValues(IDataRequest request,
|
||||
String identifierKey) {
|
||||
if (!Arrays.asList(getRequiredIdentifiers(request))
|
||||
.contains(identifierKey)
|
||||
&& !Arrays.asList(getOptionalIdentifiers(request))
|
||||
.contains(identifierKey)) {
|
||||
throw new InvalidIdentifiersException(request.getDatatype(), null,
|
||||
Arrays.asList(identifierKey));
|
||||
}
|
||||
if (identifierKey.equals(HUC)) {
|
||||
try {
|
||||
FFMPTemplateConfigurationManager templateConfig = FFMPTemplateConfigurationManager
|
||||
.getInstance();
|
||||
templateConfig.readConfigXml();
|
||||
return templateConfig.getHucLevelsInArray();
|
||||
} catch (Exception e) {
|
||||
throw new DataRetrievalException(
|
||||
"Failed to read available HUC levels from configuration file",
|
||||
e);
|
||||
}
|
||||
} else if (identifierKey.equals(ACCUM_HRS)) {
|
||||
return getAccumHrsIdentifierValues(request);
|
||||
} else {
|
||||
return getAvailableValues(request, identifierKey, String.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the FFG Object need to interpolate between sources
|
||||
*
|
||||
* @param accumulationTime
|
||||
* if null, default value for given sourceName is retrieved from
|
||||
* the interpolator
|
||||
* @param sourceName
|
||||
* @param wfo
|
||||
* @param siteKey
|
||||
* @return
|
||||
*/
|
||||
private FFMPGuidanceInterpolation getGuidanceInterpolation(
|
||||
Number accumulationTime, String sourceName, String wfo,
|
||||
String siteKey) {
|
||||
|
||||
FFMPSourceConfigurationManager sourceConfig = FFMPSourceConfigurationManager
|
||||
.getInstance();
|
||||
SourceXML source = sourceConfig.getSource(sourceName);
|
||||
String primarySourceName = sourceConfig.getPrimarySource(source);
|
||||
ProductXML product = sourceConfig.getProduct(primarySourceName);
|
||||
ProductRunXML productRun = FFMPRunConfigurationManager.getInstance()
|
||||
.getRunner(wfo).getProduct(siteKey);
|
||||
|
||||
FFMPGuidanceInterpolation interpolator = new FFMPGuidanceInterpolation(
|
||||
sourceConfig, product, productRun, primarySourceName,
|
||||
source.getDisplayName(), siteKey);
|
||||
|
||||
double time;
|
||||
if (accumulationTime != null) {
|
||||
// Use user-specified value if given
|
||||
time = accumulationTime.doubleValue();
|
||||
} else {
|
||||
/*
|
||||
* Otherwise get default accum hours from interpolator (e.g.
|
||||
* ARI6H2YR defaults to 6, ARI12H2YR to 12, etc.)
|
||||
*/
|
||||
time = interpolator.getHour(sourceName);
|
||||
}
|
||||
interpolator.setInterpolationSources(time);
|
||||
|
||||
return interpolator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the available accumHrs identifier values
|
||||
*
|
||||
* @param request
|
||||
* @return the available accumHrs values
|
||||
*/
|
||||
private String[] getAccumHrsIdentifierValues(IDataRequest request) {
|
||||
// Need parameter and required ids to get accumHrs values
|
||||
validateRequest(request);
|
||||
String sourceName = request.getParameters()[0];
|
||||
String wfo = extractIdentifierValue(request, WFO, String.class);
|
||||
String[] siteKeys = getSiteKeyValues(request);
|
||||
|
||||
FFMPSourceConfigurationManager sourceConfig = FFMPSourceConfigurationManager
|
||||
.getInstance();
|
||||
SourceXML source = sourceConfig.getSource(sourceName);
|
||||
if (source == null || !isGuidance(source)) {
|
||||
// accumHrs id is only used for guidance sources
|
||||
return new String[0];
|
||||
}
|
||||
String primarySourceName = sourceConfig.getPrimarySource(source);
|
||||
ProductXML product = sourceConfig.getProduct(primarySourceName);
|
||||
FFMPRunXML runner = FFMPRunConfigurationManager.getInstance()
|
||||
.getRunner(wfo);
|
||||
|
||||
/*
|
||||
* Available accumHrs values are all numbers between 0 and the largest
|
||||
* number of hours listed by interpolator for the given source, since
|
||||
* any number of hours <= max can be interpolated
|
||||
*/
|
||||
Double maxHrs = -1.0;
|
||||
for (String siteKey : siteKeys) {
|
||||
ProductRunXML productRun = runner.getProduct(siteKey);
|
||||
FFMPGuidanceInterpolation interpolator = new FFMPGuidanceInterpolation(
|
||||
sourceConfig, product, productRun, primarySourceName,
|
||||
source.getDisplayName(), siteKey);
|
||||
|
||||
List<Double> hrs = interpolator.orderedHours;
|
||||
if (hrs != null && !hrs.isEmpty()) {
|
||||
// Listed in increasing order, so last is max
|
||||
double currMaxHrs = hrs.get(hrs.size() - 1);
|
||||
maxHrs = Math.max(maxHrs, currMaxHrs);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxHrs < 0) {
|
||||
// No hours found
|
||||
return new String[0];
|
||||
} else {
|
||||
String hrsRange = 0 + "-" + maxHrs;
|
||||
return new String[] {
|
||||
"**any number of hours in range " + hrsRange };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The soft reference wrapped cache, if no longer needed, It will just fade
|
||||
* away.
|
||||
*/
|
||||
private FFMPDataCache getCache(String wfo) {
|
||||
|
||||
return FFMPDataCache.getInstance(wfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given source is a guidance source
|
||||
*
|
||||
* @param source
|
||||
* @return true if the source is guidance, otherwise false
|
||||
*/
|
||||
private boolean isGuidance(SourceXML source) {
|
||||
return source.getSourceType()
|
||||
.equals(SOURCE_TYPE.GUIDANCE.getSourceType());
|
||||
}
|
||||
|
||||
private static String buildDataKeysString(Set<String> dataKeys) {
|
||||
// Comma-separate the dataKeys
|
||||
StringBuilder dataKeysString = new StringBuilder();
|
||||
Iterator<String> itr = dataKeys.iterator();
|
||||
while (itr.hasNext()) {
|
||||
dataKeysString.append(itr.next());
|
||||
if (itr.hasNext()) {
|
||||
dataKeysString.append(",");
|
||||
}
|
||||
}
|
||||
return dataKeysString.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,299 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<colorMap>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<!-- 7 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 6 -->
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<!-- 5 -->
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<!-- 4 -->
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 3 -->
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69607844" b="0.0" a="1.0"/>
|
||||
<!-- 2 -->
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<!-- 1 -->
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 0 -->
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
|
||||
<!-- -1 -->
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<!-- -2 -->
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- -3 -->
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- -4 -->
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<!-- -5 -->
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<!-- -6 -->
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<!-- -7 -->
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -0,0 +1,298 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<colorMap>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<!-- 0.0 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.1 -->
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<!-- 0.2 -->
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.4 -->
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 0.6 -->
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<!-- 0.8 -->
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<!-- 1.0 -->
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 1.25 -->
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<!-- 1.5 -->
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<!-- 1.75 -->
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 2.0 -->
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 2.5 -->
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<!-- 3.0 -->
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<!-- 4.0 -->
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<!-- 5.0 -->
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -0,0 +1,298 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<colorMap>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<!-- 0.0 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.3 -->
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<!-- 0.6 -->
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<!-- 1.0 -->
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 1.5 -->
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<!-- 2.0 -->
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<!-- 2.5 -->
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 3.0 -->
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<!-- 4.0 -->
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<!-- 5.0 -->
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 6.0 -->
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 8.0 -->
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<!-- 10.0 -->
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<!-- 12.0 -->
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<!-- 15 -->
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -0,0 +1,298 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<colorMap>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<!-- 0.0 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.1 -->
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<!-- 0.25 -->
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.5 -->
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 0.75 -->
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<!-- 1.0 -->
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<!-- 1.25 -->
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 1.75 -->
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<!-- 2.0 -->
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<!-- 2.5 -->
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 3.0 -->
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 4.0 -->
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<!-- 6.0 -->
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<!-- 8.0 -->
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<!-- 10.0 -->
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -0,0 +1,298 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<colorMap>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<!-- 0.0 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.1 -->
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<!-- 0.2 -->
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.4 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 0.6 -->
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<!-- 0.8 -->
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<!-- 1.0 -->
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 1.25 -->
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<!-- 1.5 -->
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<!-- 1.75 -->
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 2.0 -->
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 3.0 -->
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<!-- 4.0 -->
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<!-- 5.0 -->
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<!-- 6.0 -->
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -0,0 +1,298 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<colorMap>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<!-- 0.0 -->
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<!-- 10 -->
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.7490196" b="1.0" a="1.0"/>
|
||||
<!-- 20 -->
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<color r="0.0" g="0.0" b="1.0" a="1.0"/>
|
||||
<!-- 30 -->
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 40 -->
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.69215687" b="0.0" a="1.0"/>
|
||||
<!-- 50 -->
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<color r="0.0" g="0.39215687" b="0.0" a="1.0"/>
|
||||
<!-- 60 -->
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="0.0" a="1.0"/>
|
||||
<!-- 70 -->
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.74705884" b="0.0" a="1.0"/>
|
||||
<!-- 75 -->
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.54901963" b="0.0" a="1.0"/>
|
||||
<!-- 80 -->
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="1.0" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 85 -->
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<color r="0.79803923" g="0.0" b="0.0" a="1.0"/>
|
||||
<!-- 90 -->
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<color r="0.64705884" g="0.19607843" b="0.19607843" a="1.0"/>
|
||||
<!-- 95 -->
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<color r="1.0" g="0.078431375" b="0.5764706" a="1.0"/>
|
||||
<!-- 100 -->
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<color r="0.5176471" g="0.4392157" b="1.0" a="1.0"/>
|
||||
<!-- 200 -->
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<statisticsConfig>
|
||||
<!-- Event Type should be fully qualified name of stat event -->
|
||||
<statisticsEvent type="com.raytheon.uf.common.stats.LoadEvent" displayName="Load Time" category="FFMP Load Times"
|
||||
rawOfflineRetentionDays="90" aggregateOfflineRetentionDays="90">
|
||||
<statisticsGroup name="type" displayName="Type" />
|
||||
<!-- Processing time available display units:
|
||||
ms, Seconds, Minutes, Hours -->
|
||||
<statisticsAggregate field="loadTime" displayName="Loading Time" displayUnit="ms" />
|
||||
</statisticsEvent>
|
||||
</statisticsConfig>
|
|
@ -0,0 +1,638 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an incremental override file, indicating that the files
|
||||
at different localization levels will be combined.
|
||||
-->
|
||||
<!--
|
||||
ADDING NEW QPE COLOR MAPS:
|
||||
When adding an additional qpe style rules to use custom color maps, the name of the color map
|
||||
and the style rule parameter and defaultColormap tags must match the color map name.
|
||||
|
||||
Parsing is used and naming the color map files require certain rules to be followed.
|
||||
|
||||
Rule #1: The color map should have qpe plus the time at which the color map should be used.
|
||||
Rule #2: If the time is a zero decimal then only the whole number is used:
|
||||
Example: if the hour is 6 then the name should be qpe6 NOT qpe6.0
|
||||
|
||||
VALID COLOR MAP NAMES:
|
||||
qpe.cmap
|
||||
qpe4.cmap
|
||||
qpe4.5.cmap
|
||||
qpe6.cmap
|
||||
qpe12.cmap
|
||||
|
||||
*** INVALID COLOR MAP NAMES: ***
|
||||
qpe_4_5.cmap
|
||||
qpe.4.5.cmap
|
||||
qpe4.0.cmap
|
||||
|
||||
Here are relationship example between the style rules and color maps:
|
||||
|
||||
<parameter> <defaultColormap> colormap comment
|
||||
=======================================================================================
|
||||
qpe ffmp/qpe qpe.cmap Color map used for times >= 0.0
|
||||
qpe6 ffmp/qpe6 qpe6.cmap Color map used for times >= 6.0
|
||||
qpe12 ffmp/qpe12 qpe12.cmap Color map used for times >= 12.0
|
||||
|
||||
Adding a new color map to be used for hour 4.5 would have the following:
|
||||
|
||||
qpe4.5 ffmp/qpe4.5 qpe4.5.cmap Color map used for times >= 4.50
|
||||
|
||||
Adding a new color map to be used for hour 4.00 would have the following:
|
||||
|
||||
qpe4 ffmp/qpe4 qpe4.cmap Color map used for times >= 4.00
|
||||
|
||||
Here is an example style rule for 4.5 hours. Note the changes to the <parameter>
|
||||
and <defaultColormap> tags. This entry will map to a qpe4.5.cmap that needs to
|
||||
be put in localization.
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>qpe4.5</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>ffmp/qpe4.5</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-9999.0' pixelValue='0' label='' />
|
||||
<entry displayValue='0.0' pixelValue='15'/>
|
||||
<entry displayValue='0.1' pixelValue='31'/>
|
||||
<entry displayValue='0.25' pixelValue='47'/>
|
||||
<entry displayValue='0.5' pixelValue='63'/>
|
||||
<entry displayValue='0.75' pixelValue='79'/>
|
||||
<entry displayValue='1.0' pixelValue='95'/>
|
||||
<entry displayValue='1.25' pixelValue='111'/>
|
||||
<entry displayValue='1.75' pixelValue='127'/>
|
||||
<entry displayValue='2.0' pixelValue='143'/>
|
||||
<entry displayValue='2.5' pixelValue='159'/>
|
||||
<entry displayValue='3.0' pixelValue='175'/>
|
||||
<entry displayValue='4.0' pixelValue='191'/>
|
||||
<entry displayValue='6.0' pixelValue='207'/>
|
||||
<entry displayValue='8.0' pixelValue='223'/>
|
||||
<entry displayValue='10.0' pixelValue='240'/>
|
||||
<entry displayValue='9999.0' pixelValue='255' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
-->
|
||||
<!--
|
||||
ADDING NEW Guidance styleRules:
|
||||
When adding an additional Guidance source to FFMP. You should also add a custom style rule for it.
|
||||
|
||||
The way it works is the SourceConfigXML display name for the type is appended to the type.
|
||||
So the TYpe for GUIDANCE is guidance. So, it you have a hypothetical source display name of
|
||||
ARIFFG100, then the style rule parameter tag will look like this example....
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG100</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='50.0' pixelValue='0'/>
|
||||
<entry displayValue='55.0' pixelValue='17'/>
|
||||
<entry displayValue='60.0' pixelValue='35'/>
|
||||
<entry displayValue='65.0' pixelValue='52'/>
|
||||
<entry displayValue='70.0' pixelValue='69'/>
|
||||
<entry displayValue='75.0' pixelValue='86'/>
|
||||
<entry displayValue='80.0' pixelValue='102'/>
|
||||
<entry displayValue='85.0' pixelValue='119'/>
|
||||
<entry displayValue='90.0' pixelValue='136'/>
|
||||
<entry displayValue='95.0' pixelValue='153'/>
|
||||
<entry displayValue='100.0' pixelValue='169'/>
|
||||
<entry displayValue='105.0' pixelValue='186'/>
|
||||
<entry displayValue='110.0' pixelValue='204'/>
|
||||
<entry displayValue='115.0' pixelValue='220'/>
|
||||
<entry displayValue='120.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<styleRuleset>
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>qpe</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>ffmp/qpe</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-9999.0' pixelValue='0' label='' />
|
||||
<entry displayValue='0.0' pixelValue='16'/>
|
||||
<entry displayValue='0.1' pixelValue='32'/>
|
||||
<entry displayValue='0.2' pixelValue='48'/>
|
||||
<entry displayValue='0.4' pixelValue='64'/>
|
||||
<entry displayValue='0.6' pixelValue='80'/>
|
||||
<entry displayValue='0.8' pixelValue='96'/>
|
||||
<entry displayValue='1.0' pixelValue='112'/>
|
||||
<entry displayValue='1.25' pixelValue='128'/>
|
||||
<entry displayValue='1.5' pixelValue='144'/>
|
||||
<entry displayValue='1.75' pixelValue='160'/>
|
||||
<entry displayValue='2.0' pixelValue='176'/>
|
||||
<entry displayValue='2.5' pixelValue='192'/>
|
||||
<entry displayValue='3.0' pixelValue='208'/>
|
||||
<entry displayValue='4.0' pixelValue='224'/>
|
||||
<entry displayValue='5.0' pixelValue='240'/>
|
||||
<entry displayValue='9999.0' pixelValue='255' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>qpe6</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>ffmp/qpe6</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-9999.0' pixelValue='0' label='' />
|
||||
<entry displayValue='0.0' pixelValue='16'/>
|
||||
<entry displayValue='0.1' pixelValue='32'/>
|
||||
<entry displayValue='0.25' pixelValue='48'/>
|
||||
<entry displayValue='0.5' pixelValue='64'/>
|
||||
<entry displayValue='0.75' pixelValue='80'/>
|
||||
<entry displayValue='1.0' pixelValue='96'/>
|
||||
<entry displayValue='1.25' pixelValue='112'/>
|
||||
<entry displayValue='1.75' pixelValue='128'/>
|
||||
<entry displayValue='2.0' pixelValue='144'/>
|
||||
<entry displayValue='2.5' pixelValue='160'/>
|
||||
<entry displayValue='3.0' pixelValue='176'/>
|
||||
<entry displayValue='4.0' pixelValue='192'/>
|
||||
<entry displayValue='6.0' pixelValue='208'/>
|
||||
<entry displayValue='8.0' pixelValue='224'/>
|
||||
<entry displayValue='10.0' pixelValue='240'/>
|
||||
<entry displayValue='9999.0' pixelValue='255' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>qpe12</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>ffmp/qpe12</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-9999.0' pixelValue='0' label='' />
|
||||
<entry displayValue='0.0' pixelValue='16'/>
|
||||
<entry displayValue='0.3' pixelValue='32'/>
|
||||
<entry displayValue='0.6' pixelValue='48'/>
|
||||
<entry displayValue='1.0' pixelValue='64'/>
|
||||
<entry displayValue='1.5' pixelValue='80'/>
|
||||
<entry displayValue='2.0' pixelValue='96'/>
|
||||
<entry displayValue='2.5' pixelValue='112'/>
|
||||
<entry displayValue='3.0' pixelValue='128'/>
|
||||
<entry displayValue='4.0' pixelValue='144'/>
|
||||
<entry displayValue='5.0' pixelValue='160'/>
|
||||
<entry displayValue='6.0' pixelValue='176'/>
|
||||
<entry displayValue='8.0' pixelValue='192'/>
|
||||
<entry displayValue='10.0' pixelValue='208'/>
|
||||
<entry displayValue='12.0' pixelValue='224'/>
|
||||
<entry displayValue='15.0' pixelValue='240'/>
|
||||
<entry displayValue='9999.0' pixelValue='255' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>rate</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in/hr</displayUnits>
|
||||
<defaultColormap>ffmp/rate</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-9999.0' pixelValue='0' label='' />
|
||||
<entry displayValue='0.0' pixelValue='16'/>
|
||||
<entry displayValue='0.1' pixelValue='32'/>
|
||||
<entry displayValue='0.2' pixelValue='48'/>
|
||||
<entry displayValue='0.4' pixelValue='64'/>
|
||||
<entry displayValue='0.6' pixelValue='80'/>
|
||||
<entry displayValue='0.8' pixelValue='96'/>
|
||||
<entry displayValue='1.0' pixelValue='112'/>
|
||||
<entry displayValue='1.25' pixelValue='128'/>
|
||||
<entry displayValue='1.5' pixelValue='144'/>
|
||||
<entry displayValue='1.75' pixelValue='160'/>
|
||||
<entry displayValue='2.0' pixelValue='176'/>
|
||||
<entry displayValue='3.0' pixelValue='192'/>
|
||||
<entry displayValue='4.0' pixelValue='208'/>
|
||||
<entry displayValue='5.0' pixelValue='223'/>
|
||||
<entry displayValue='6.0' pixelValue='240'/>
|
||||
<entry displayValue='9999.0' pixelValue='255' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>ratio</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>%</displayUnits>
|
||||
<defaultColormap>ffmp/ratio</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-9999.0' pixelValue='0' label=''/>
|
||||
<entry displayValue='0.0' pixelValue='16'/>
|
||||
<entry displayValue='10.0' pixelValue='32'/>
|
||||
<entry displayValue='20.0' pixelValue='48'/>
|
||||
<entry displayValue='30.0' pixelValue='64'/>
|
||||
<entry displayValue='40.0' pixelValue='80'/>
|
||||
<entry displayValue='50.0' pixelValue='96'/>
|
||||
<entry displayValue='60.0' pixelValue='112'/>
|
||||
<entry displayValue='70.0' pixelValue='128'/>
|
||||
<entry displayValue='75.0' pixelValue='144'/>
|
||||
<entry displayValue='80.0' pixelValue='160'/>
|
||||
<entry displayValue='85.0' pixelValue='176'/>
|
||||
<entry displayValue='90.0' pixelValue='192'/>
|
||||
<entry displayValue='95.0' pixelValue='208'/>
|
||||
<entry displayValue='100.0' pixelValue='223'/>
|
||||
<entry displayValue='200.0' pixelValue='240'/>
|
||||
<entry displayValue='9999.0' pixelValue='255' label=''/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>diff</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>ffmp/diff</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='-999' pixelValue='0' label=''/>
|
||||
<entry displayValue='-7' pixelValue='16'/>
|
||||
<entry displayValue='-6' pixelValue='32'/>
|
||||
<entry displayValue='-5' pixelValue='48'/>
|
||||
<entry displayValue='-4' pixelValue='64'/>
|
||||
<entry displayValue='-3' pixelValue='80'/>
|
||||
<entry displayValue='-2' pixelValue='96'/>
|
||||
<entry displayValue='-1' pixelValue='112'/>
|
||||
<entry displayValue='0' pixelValue='128'/>
|
||||
<entry displayValue='1' pixelValue='144'/>
|
||||
<entry displayValue='2' pixelValue='160'/>
|
||||
<entry displayValue='3' pixelValue='176'/>
|
||||
<entry displayValue='4' pixelValue='192'/>
|
||||
<entry displayValue='5' pixelValue='208'/>
|
||||
<entry displayValue='6' pixelValue='224'/>
|
||||
<entry displayValue='7' pixelValue='240'/>
|
||||
<entry displayValue='999' pixelValue='255' label=''/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceRFCFFG</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='1.0' pixelValue='17'/>
|
||||
<entry displayValue='2.0' pixelValue='35'/>
|
||||
<entry displayValue='3.0' pixelValue='52'/>
|
||||
<entry displayValue='4.0' pixelValue='69'/>
|
||||
<entry displayValue='5.0' pixelValue='86'/>
|
||||
<entry displayValue='6.0' pixelValue='102'/>
|
||||
<entry displayValue='7.0' pixelValue='119'/>
|
||||
<entry displayValue='8.0' pixelValue='136'/>
|
||||
<entry displayValue='9.0' pixelValue='153'/>
|
||||
<entry displayValue='10.0' pixelValue='169'/>
|
||||
<entry displayValue='11.0' pixelValue='186'/>
|
||||
<entry displayValue='12.0' pixelValue='204'/>
|
||||
<entry displayValue='13.0' pixelValue='220'/>
|
||||
<entry displayValue='15.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<!-- This one is the default for guidance if all else fails to load -->
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidance</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='1.0' pixelValue='17'/>
|
||||
<entry displayValue='2.0' pixelValue='35'/>
|
||||
<entry displayValue='3.0' pixelValue='52'/>
|
||||
<entry displayValue='4.0' pixelValue='69'/>
|
||||
<entry displayValue='5.0' pixelValue='86'/>
|
||||
<entry displayValue='6.0' pixelValue='102'/>
|
||||
<entry displayValue='7.0' pixelValue='119'/>
|
||||
<entry displayValue='8.0' pixelValue='136'/>
|
||||
<entry displayValue='9.0' pixelValue='153'/>
|
||||
<entry displayValue='10.0' pixelValue='169'/>
|
||||
<entry displayValue='11.0' pixelValue='186'/>
|
||||
<entry displayValue='12.0' pixelValue='204'/>
|
||||
<entry displayValue='13.0' pixelValue='220'/>
|
||||
<entry displayValue='15.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG1</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG2</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG5</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG10</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG25</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG50</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG100</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG200</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG500</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>guidanceARIFFG1000</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry displayValue='0.0' pixelValue='0'/>
|
||||
<entry displayValue='2.0' pixelValue='17'/>
|
||||
<entry displayValue='4.0' pixelValue='35'/>
|
||||
<entry displayValue='6.0' pixelValue='52'/>
|
||||
<entry displayValue='8.0' pixelValue='69'/>
|
||||
<entry displayValue='10.0' pixelValue='86'/>
|
||||
<entry displayValue='12.0' pixelValue='102'/>
|
||||
<entry displayValue='14.0' pixelValue='119'/>
|
||||
<entry displayValue='16.0' pixelValue='136'/>
|
||||
<entry displayValue='18.0' pixelValue='153'/>
|
||||
<entry displayValue='20.0' pixelValue='169'/>
|
||||
<entry displayValue='22.0' pixelValue='186'/>
|
||||
<entry displayValue='24.0' pixelValue='204'/>
|
||||
<entry displayValue='26.0' pixelValue='220'/>
|
||||
<entry displayValue='28.0' pixelValue='255'/>
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
|
||||
</styleRule>
|
||||
|
||||
</styleRuleset>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.fog/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.fog/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.fog</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,17 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Fog common Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.fog
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.fog,
|
||||
com.raytheon.uf.common.dataplugin.fog.analysis
|
||||
Require-Bundle: javax.persistence;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.monitor;bundle-version="1.11.5",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.11.13",
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.datastorage
|
|
@ -0,0 +1,5 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
utility/,\
|
||||
.
|
|
@ -0,0 +1,694 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.geotools.coverage.grid.GeneralGridEnvelope;
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.geotools.geometry.GeneralEnvelope;
|
||||
import org.hibernate.annotations.Index;
|
||||
import org.opengis.referencing.crs.ProjectedCRS;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.fog.analysis.FogRange;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* Record implementation for Fog plugin
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 12, 2009 D. Hladky Initial release
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2361 njensen Remove XML annotations
|
||||
* Jul 23, 2015 2360 rferrel Add name to unique constraint.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "fogseq")
|
||||
@Table(name = "fog", uniqueConstraints = { @UniqueConstraint(name = "uk_fog_datauri_fields", columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "fog", indexes = { @Index(name = "fog_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
public class FogRecord extends PersistablePluginDataObject implements
|
||||
IPersistable {
|
||||
|
||||
private static final long serialVersionUID = 76774564365671L;
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
private String cwa;
|
||||
|
||||
// Time of the observation to the nearest hour.
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Calendar refHour;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public int nx = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public int ny = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public float dx = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public float dy = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public double satLon = 0.0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public double satHeight = 0.0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public double lon = 0.0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public double lat = 0.0;
|
||||
|
||||
@Transient
|
||||
private int[] vis_array = null;
|
||||
|
||||
@Transient
|
||||
private int[] ir3_9_array = null;
|
||||
|
||||
@Transient
|
||||
private int[] ir10_7_array = null;
|
||||
|
||||
@Transient
|
||||
private FogRange[] vis_ranges = null;
|
||||
|
||||
@Transient
|
||||
private FogRange[] ir_ranges = null;
|
||||
|
||||
@Transient
|
||||
private IMAGE_GROUP[] groups = null;
|
||||
|
||||
@Transient
|
||||
private float[] threats = null;
|
||||
|
||||
@Transient
|
||||
private GridGeometry2D gridGeometry2D = null;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public FogRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a record from a dataURI
|
||||
*
|
||||
* @param uri
|
||||
* The dataURI
|
||||
* @param tableDef
|
||||
* The table definition associated with this class
|
||||
*/
|
||||
public FogRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the CHANNELS in Fog analysis
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum CHANNEL {
|
||||
|
||||
VIS("VIS"), IR3_9("IR3_9"), IR10_7("IR10_7");
|
||||
|
||||
private final String channel;
|
||||
|
||||
private CHANNEL(String name) {
|
||||
channel = name;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the Image Groups in Fog analysis
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum IMAGE_GROUP {
|
||||
|
||||
TWILIGHT_GROUP("TWILIGHT_GROUP"), VIS_GROUP("VIS_GROUP"), IR_GROUP(
|
||||
"IR_GROUP");
|
||||
|
||||
private final String group;
|
||||
|
||||
private IMAGE_GROUP(String name) {
|
||||
group = name;
|
||||
}
|
||||
|
||||
public String getImageGroup() {
|
||||
return group;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the possible outcomes in Fog analysis
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum FOG_THREAT {
|
||||
|
||||
BLACK("BLACK"), GRAY("GRAY"), GREEN("GREEN"), YELLOW("YELLOW"), RED(
|
||||
"RED");
|
||||
|
||||
private final String threat;
|
||||
|
||||
private FOG_THREAT(String name) {
|
||||
threat = name;
|
||||
}
|
||||
|
||||
public String getThreat() {
|
||||
return threat;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the cwa
|
||||
*
|
||||
* @param cwa
|
||||
*/
|
||||
public void setCwa(String cwa) {
|
||||
this.cwa = cwa;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cwa
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCwa() {
|
||||
return cwa;
|
||||
}
|
||||
|
||||
/**
|
||||
* set NX
|
||||
*
|
||||
* @param nx
|
||||
*/
|
||||
public void setNx(Integer nx) {
|
||||
this.nx = nx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get nx
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getNx() {
|
||||
return nx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set NY
|
||||
*
|
||||
* @param ny
|
||||
*/
|
||||
public void setNy(Integer ny) {
|
||||
this.ny = ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get NY
|
||||
*
|
||||
* @param ny
|
||||
*/
|
||||
public Integer getNy() {
|
||||
return ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* set DX in meters
|
||||
*
|
||||
* @param f
|
||||
*/
|
||||
public void setDx(float dx) {
|
||||
this.dx = dx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DX in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public float getDx() {
|
||||
return dx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the DY, in meters
|
||||
*
|
||||
* @param dy
|
||||
*/
|
||||
public void setDy(float dy) {
|
||||
this.dy = dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the DY, in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public float getDy() {
|
||||
return dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* satLon in degrees
|
||||
*
|
||||
* @param dy
|
||||
*/
|
||||
public void setSatLon(double satLon) {
|
||||
this.satLon = satLon;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the satLon in degrees
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getSatLon() {
|
||||
return satLon;
|
||||
}
|
||||
|
||||
/**
|
||||
* satHeight in km
|
||||
*
|
||||
* @param dy
|
||||
*/
|
||||
public void setSatHeight(double satHeight) {
|
||||
this.satHeight = satHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the satHeight in km
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getSatHeight() {
|
||||
return satHeight;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the VIS pixel array
|
||||
*
|
||||
* @param vis_array
|
||||
*/
|
||||
public void setVisArray(int[] vis_array) {
|
||||
this.vis_array = vis_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the VIS pixel array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public int[] getVisArray() {
|
||||
return vis_array;
|
||||
}
|
||||
|
||||
public GridGeometry2D getGridGeometry2D() {
|
||||
return gridGeometry2D;
|
||||
}
|
||||
|
||||
public void setGridGeometry2D(GridGeometry2D gridGeometry2D) {
|
||||
this.gridGeometry2D = gridGeometry2D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the VIS pixel array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public void setIR_3_9Array(int[] ir3_9_array) {
|
||||
this.ir3_9_array = ir3_9_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the VIS pixel array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public int[] getIR_3_9Array() {
|
||||
return ir3_9_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the VIS data array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public void setIR_10_7Array(int[] ir10_7_array) {
|
||||
this.ir10_7_array = ir10_7_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the VIS data array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public int[] getIR_10_7Array() {
|
||||
return ir10_7_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the threat array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public void setThreats(float[] threats) {
|
||||
this.threats = threats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the threat array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public float[] getThreats() {
|
||||
return threats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the projected CRS
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ProjectedCRS getCRS() {
|
||||
return MapUtil.constructStereographic(MapUtil.AWIPS_EARTH_RADIUS,
|
||||
MapUtil.AWIPS_EARTH_RADIUS, getLat(), getLon());
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a 2D GridGeometry to use for display
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public GridGeometry2D getGridGeometry() {
|
||||
if (gridGeometry2D == null) {
|
||||
|
||||
ProjectedCRS crs = this.getCRS();
|
||||
|
||||
GeneralEnvelope generalEnvelope = new GeneralEnvelope(2);
|
||||
generalEnvelope.setCoordinateReferenceSystem(crs);
|
||||
|
||||
double maxExtentX = (this.getDx() * (this.getNx() / 2));
|
||||
double maxExtentY = (this.getDy() * (this.getNy() / 2));
|
||||
|
||||
generalEnvelope.setRange(0, -maxExtentX, maxExtentX);
|
||||
generalEnvelope.setRange(1, -maxExtentY, maxExtentY);
|
||||
|
||||
gridGeometry2D = new GridGeometry2D(new GeneralGridEnvelope(
|
||||
new int[] { 0, 0 },
|
||||
new int[] { this.getNx(), this.getNy() }, false),
|
||||
generalEnvelope);
|
||||
}
|
||||
|
||||
return gridGeometry2D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data array from the store.
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
public void retrieveFromDataStore(IDataStore dataStore) {
|
||||
|
||||
try {
|
||||
for (CHANNEL channel : CHANNEL.values()) {
|
||||
IntegerDataRecord dataRec = (IntegerDataRecord) dataStore
|
||||
.retrieve(getDataURI(), channel.getChannel(),
|
||||
Request.ALL);
|
||||
if (dataRec.getIntData().length > 0) {
|
||||
if (channel == CHANNEL.VIS) {
|
||||
setVisArray(dataRec.getIntData());
|
||||
} else if (channel == CHANNEL.IR3_9) {
|
||||
setIR_3_9Array(dataRec.getIntData());
|
||||
} else if (channel == CHANNEL.IR10_7) {
|
||||
setIR_10_7Array(dataRec.getIntData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception se) {
|
||||
se.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for debugging.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("\n dataURI: " + getDataURI() + "\n");
|
||||
sb.append("WFO: " + getCwa() + "\n");
|
||||
sb.append("dataTime: "
|
||||
+ getDataTime().getValidTime().getTime().toString() + "\n");
|
||||
// sb.append("PersistanceTime: " + getPersistenceTime().toString() +
|
||||
// "\n");
|
||||
sb.append("Nx: " + getNx() + "\n");
|
||||
sb.append("Ny: " + getNy() + "\n");
|
||||
sb.append("Dx: " + getDx() + "\n");
|
||||
sb.append("Dy: " + getDy() + "\n");
|
||||
sb.append("lat: " + getLat() + "\n");
|
||||
sb.append("lon: " + getLon() + "\n");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public IMAGE_GROUP getRangeType(int j) {
|
||||
return getGroups()[j];
|
||||
}
|
||||
|
||||
public void setRangeType(IMAGE_GROUP group, int j) {
|
||||
getGroups()[j] = group;
|
||||
}
|
||||
|
||||
public FogRange getVisRange(int j) {
|
||||
return getVisRanges()[j];
|
||||
}
|
||||
|
||||
public void setVisRange(FogRange range, int j) {
|
||||
getVisRanges()[j] = range;
|
||||
}
|
||||
|
||||
public FogRange getIRRange(int j) {
|
||||
return getIRRanges()[j];
|
||||
}
|
||||
|
||||
public void setIRRange(FogRange range, int j) {
|
||||
getIRRanges()[j] = range;
|
||||
}
|
||||
|
||||
private IMAGE_GROUP[] getGroups() {
|
||||
if (groups == null) {
|
||||
groups = new IMAGE_GROUP[getNy()];
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
private FogRange[] getIRRanges() {
|
||||
if (ir_ranges == null) {
|
||||
ir_ranges = new FogRange[getNy()];
|
||||
}
|
||||
return ir_ranges;
|
||||
}
|
||||
|
||||
private FogRange[] getVisRanges() {
|
||||
if (vis_ranges == null) {
|
||||
vis_ranges = new FogRange[getNy()];
|
||||
}
|
||||
return vis_ranges;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Name: FindGroup
|
||||
// Type: public member function
|
||||
//
|
||||
// Description:
|
||||
// Given a point with i and j, the function finds out whether the point
|
||||
// is in daylight area, nighttime area or twilight area.
|
||||
// Input Argument:
|
||||
// i: row number
|
||||
// j: col number
|
||||
// Output Argument:
|
||||
// Return the ImageGroup the point belonging to.
|
||||
// History:
|
||||
// March 2004 ------ Qin Zeng(GDMB/MDL) created
|
||||
// Dec 2009 D Hladky ported to JAVA
|
||||
// ---------------------------------------------------------------------------
|
||||
public IMAGE_GROUP findGroup(int i, int j) {
|
||||
// Explain the _rangeType[i] here:
|
||||
|
||||
// (1) If rangType[i] == TWILIGHT_GROUP
|
||||
// then means vis_range[i] stores range of vis and
|
||||
// ir_range[i] stores range of ir
|
||||
// (2) if rangType[i] == IR_GROUP
|
||||
// then means both vis_range and ir_range store range of ir
|
||||
//
|
||||
// (3) if rangType[i] == VIS_GROUP
|
||||
// then means both vis_range and ir_range store range of vis
|
||||
|
||||
if (getRangeType(j) == IMAGE_GROUP.TWILIGHT_GROUP) {
|
||||
if ((i <= getVisRange(j).getEnd())
|
||||
&& (i >= getVisRange(j).getStart())) {
|
||||
return IMAGE_GROUP.VIS_GROUP;
|
||||
}
|
||||
|
||||
else if ((i <= getIRRange(j).getEnd())
|
||||
&& (i >= getIRRange(j).getStart())) {
|
||||
return IMAGE_GROUP.IR_GROUP;
|
||||
} else {
|
||||
return IMAGE_GROUP.TWILIGHT_GROUP;
|
||||
}
|
||||
} else if (getRangeType(j) == IMAGE_GROUP.VIS_GROUP) {
|
||||
if (((i <= getVisRange(j).getEnd()) && (i >= getVisRange(j)
|
||||
.getStart()))
|
||||
|| ((i <= getIRRange(j).getEnd()) && (i >= getIRRange(j)
|
||||
.getStart()))) {
|
||||
return IMAGE_GROUP.VIS_GROUP;
|
||||
} else {
|
||||
return IMAGE_GROUP.TWILIGHT_GROUP;
|
||||
}
|
||||
} else {
|
||||
if (((i <= getVisRange(j).getEnd()) && (i >= getVisRange(j)
|
||||
.getStart()))
|
||||
|| ((i <= getIRRange(j).getEnd()) && (i >= getIRRange(j)
|
||||
.getStart()))) {
|
||||
return IMAGE_GROUP.IR_GROUP;
|
||||
} else {
|
||||
return IMAGE_GROUP.TWILIGHT_GROUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* name for the lower right corner display
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return "Fog " + getCwa() + " Threat Level";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param refHour
|
||||
* the refHour to set
|
||||
*/
|
||||
public void setRefHour(Calendar refHour) {
|
||||
this.refHour = refHour;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the refHour
|
||||
*/
|
||||
public Calendar getRefHour() {
|
||||
return refHour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "fog";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,178 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog.analysis;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.opengis.referencing.FactoryException;
|
||||
import org.opengis.referencing.datum.PixelInCell;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord;
|
||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
public class FogCell {
|
||||
|
||||
public int left;
|
||||
public int right;
|
||||
public int top;
|
||||
public int bottom;
|
||||
|
||||
public int startX = 0;
|
||||
public int startY = 0;
|
||||
public int endX = 0;
|
||||
public int endY = 0;
|
||||
public int nx = 0;
|
||||
public int ny = 0;
|
||||
|
||||
/** Threat Grid Coordinate of this CELL **/
|
||||
public Coordinate threatCoor = null;
|
||||
|
||||
public ArrayList<Point> points = null;
|
||||
|
||||
public FOG_THREAT cellThreat = null;
|
||||
|
||||
public FogRecord.IMAGE_GROUP group = null;
|
||||
|
||||
/**
|
||||
* serialization
|
||||
*/
|
||||
public FogCell() {
|
||||
|
||||
}
|
||||
|
||||
public FogCell(Coordinate threatCoor, GridGeometry2D threatGrid,
|
||||
GridGeometry2D pixelGrid) throws TransformException, FactoryException {
|
||||
|
||||
this.threatCoor = threatCoor;
|
||||
// find the corner points in pixel land
|
||||
// threat grid i and j
|
||||
ReferencedCoordinate rc = new ReferencedCoordinate(threatCoor);
|
||||
Coordinate leftc = rc.asGridCell(pixelGrid, PixelInCell.CELL_CORNER);
|
||||
ReferencedCoordinate rc2 = new ReferencedCoordinate(threatCoor);
|
||||
Coordinate center = rc2.asGridCell(pixelGrid, PixelInCell.CELL_CENTER);
|
||||
|
||||
top = (int) leftc.y;
|
||||
bottom = (int) (leftc.y + ((leftc.y - center.y) * 2));
|
||||
left = (int) leftc.x;
|
||||
right = (int) (leftc.x + ((center.x - leftc.x) * 2));
|
||||
ny = (bottom - top);
|
||||
nx = (right - left);
|
||||
startX = left;
|
||||
endX = right;
|
||||
startY = top;
|
||||
endY = bottom;
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Name: Domain
|
||||
// Type: Public member function
|
||||
//
|
||||
// Description:
|
||||
// To get he minimum rectangle which encloses the fog cell area.
|
||||
// hereafter it is called DOMAIN.
|
||||
// Input Argument:
|
||||
// left: left bound of the DOMAIN.
|
||||
// right: right bound of the DOMAIN.
|
||||
// top: top bound of the DOMAIN.
|
||||
// bottom: bottom bound of the DOMAIN.
|
||||
// Output Argument:
|
||||
// Pass the references of the two points into the function.
|
||||
// History:
|
||||
// March 2004 ------ Qin Zeng(GDMB/MDL) created
|
||||
// Dec 22, 2009 D Hladky ported to JAVA for AWIPS II
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
public FogCell(ArrayList<Point> points, FOG_THREAT cellThreat, FogRecord.IMAGE_GROUP group) {
|
||||
|
||||
this.points = points;
|
||||
this.cellThreat = cellThreat;
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public void setCellThreat(FOG_THREAT threat) {
|
||||
this.cellThreat = threat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the consensus threat for this cell
|
||||
* @return
|
||||
*/
|
||||
public FOG_THREAT getCellThreat() {
|
||||
return cellThreat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the image grouping for this cell
|
||||
* @return
|
||||
*/
|
||||
public FogRecord.IMAGE_GROUP getImageGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the pixels included in this cell
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<Point> getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets you the area in "Pixels" so to speak
|
||||
* @return
|
||||
*/
|
||||
public float getArea() {
|
||||
return nx*ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pixel relative value for this x/y into the VIS/IR arrays
|
||||
* @param x
|
||||
* @param y
|
||||
* @return
|
||||
*/
|
||||
public Coordinate getPixelRelativeCoordinate(int i) {
|
||||
Coordinate pixelCoor = getPixelCoordinate(i);
|
||||
return new Coordinate(startX+pixelCoor.x, startY+pixelCoor.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the pixel coordinate relative to the cell
|
||||
* @param total
|
||||
* @return
|
||||
*/
|
||||
public Coordinate getPixelCoordinate(int total) {
|
||||
return new Coordinate(total/(total/nx), total/(total/ny));
|
||||
}
|
||||
|
||||
/**
|
||||
* clear this cell to default
|
||||
*/
|
||||
public void clear() {
|
||||
cellThreat = FOG_THREAT.GRAY;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,515 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog.analysis;
|
||||
|
||||
import org.opengis.referencing.FactoryException;
|
||||
import org.opengis.referencing.datum.PixelInCell;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord;
|
||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* This class essentially sets the Image Type grouping for Day(VIS), Night(IR), or Twilight(combo)
|
||||
*
|
||||
* @author dhladky
|
||||
*
|
||||
*/
|
||||
public class FogDataCorrector {
|
||||
|
||||
public int grid_space = 1;
|
||||
|
||||
public int satHeight = 0;
|
||||
|
||||
public double twilight_angle_offset = 0;
|
||||
|
||||
public FogSolarCalculator solarCal = null;
|
||||
|
||||
public FogSatCalculator satCal = null;
|
||||
|
||||
private final FogRecord rec;
|
||||
|
||||
public FogDataCorrector(FogRecord rec, double twilight_angle_offset) {
|
||||
this.rec = rec;
|
||||
this.twilight_angle_offset = twilight_angle_offset;
|
||||
}
|
||||
|
||||
// -Public---------------------------------------------------------------------
|
||||
// NAME: Execute()
|
||||
//
|
||||
// TYPE: Public Member function
|
||||
//
|
||||
// Description:
|
||||
// Execute the data correction.
|
||||
// Currently only VIS data is normalized, because the VIS data is
|
||||
// strongly affected by some factors like solar elevation angle,
|
||||
// Considering the computation time, the normalization is not done pixel
|
||||
// by pixel. Use a lower resolution grid to cover the original grid
|
||||
// Correction at original grid point uses the correction at
|
||||
// the nearest grid point in the lower resolution grid.
|
||||
// _grid_space denotes the span between the lower resolution grid.
|
||||
// Besides data correction, Fog_DataCorrector also build up
|
||||
// the ranges of the valid VIS data and IR data at each row.
|
||||
//
|
||||
// Note: the correction is based on the paper by albers from FSL.
|
||||
// 1992: Photometric correction of GOES visible satellite image
|
||||
// 6th conference on satellite meteorology and oceanography
|
||||
// Arguments: None
|
||||
//
|
||||
// History:
|
||||
// March 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
// Sep. 2004 Qi Zhu (RSIS/MDL) -- Added code to set the satellite
|
||||
// height to the object of
|
||||
// Fog_SatCalculator class.
|
||||
// Sept. 2004 Bill Mattison (SAIC) -- updated interfaces to correct
|
||||
// interface with class SetupAccessor.
|
||||
// Dec 2009 D Hladky ported to JAVA
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
public FogRecord execute() {
|
||||
|
||||
// TODO: Remember in bizarro AWIPS world J is X and I is Y
|
||||
// 58 degree is a semi-empirical parameter(angle) for VIS correction
|
||||
double EMPIRICAL_REFERENCE_ANGLE = 58.0; // UNIT DEGREE
|
||||
double SIN_MINIMUM_ELEVATION = Math.sin(Math.toRadians(8.0));
|
||||
// setup solar calculator
|
||||
if (solarCal == null) {
|
||||
solarCal = new FogSolarCalculator();
|
||||
solarCal.setDataTime(rec.getDataTime());
|
||||
}
|
||||
|
||||
// setup satellite calcualtor
|
||||
if (satCal == null) {
|
||||
satCal = new FogSatCalculator();
|
||||
satCal.setLocation(new Coordinate(rec.getLon(), rec.getLat()));
|
||||
satCal.setSatLon(rec.getSatLon());
|
||||
satCal.setSatHeight((float) rec.getSatHeight());
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
double r1;
|
||||
ReferencedCoordinate tem_point;
|
||||
// SetupAccessor *_setup_accessor=
|
||||
// SetupAccessor::getInstance(_usingSAFESEAS);
|
||||
float sin_ref_angle = (float) Math.sin(Math.toRadians(EMPIRICAL_REFERENCE_ANGLE));
|
||||
float sin_twi = (float) Math.sin(Math.toRadians(twilight_angle_offset));
|
||||
float tem_sin_sunelev;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
int rso = rec.getNy();
|
||||
int cso = rec.getNx();
|
||||
float[][] sin_solar_elev;
|
||||
float[][] cos_p; // cos phase angle
|
||||
float[][] cos_e; // cos emission angle
|
||||
|
||||
// TODO write function to determine
|
||||
// if by Solar Calculator you need to do the vis correction
|
||||
if (solarCal.visNeeded) {
|
||||
// Begin the VIS correction
|
||||
// _grid_space * _grid_space data correction
|
||||
|
||||
// rso= Row Size Originally
|
||||
// cso= Column Size Orignally
|
||||
// rss= Row Size with Span
|
||||
// css= Column Size with Span
|
||||
int rss = rso / grid_space;
|
||||
int css = cso / grid_space;
|
||||
sin_solar_elev = new float[rss][css];
|
||||
cos_p = new float[rss][css];
|
||||
cos_e = new float[rss][css];
|
||||
|
||||
// clear the elevation values
|
||||
for (i = 0; i < rss; ++i) {
|
||||
for (j = 0; j < css; ++j) {
|
||||
sin_solar_elev[i][j] = -999.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// crs = Current Row with Span
|
||||
// ccs = Current Column with Span
|
||||
int crs = 0;
|
||||
int ccs = 0;
|
||||
Coordinate tem_loc = null;
|
||||
float CorrectionWeight;
|
||||
|
||||
for (i = 0; i < rso; ++i) {
|
||||
crs = (int) (i / (grid_space * 1.0) + 0.5);
|
||||
rec.setRangeType(FogRecord.IMAGE_GROUP.TWILIGHT_GROUP, i);
|
||||
|
||||
if (crs > rss - 1) {
|
||||
crs = rss - 1;
|
||||
}
|
||||
// pointI, and pointJ are the i and j
|
||||
// of the point where day and night are divided in row i
|
||||
|
||||
if (sin_solar_elev[crs][0] == -999.0) {
|
||||
tem_point = new ReferencedCoordinate(new Coordinate(0, i, 0));
|
||||
try {
|
||||
tem_point.asGridCell(rec.getGridGeometry(), PixelInCell.CELL_CENTER);
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
tem_loc = tem_point.asLatLon();
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
solarCal.setLocation(tem_loc);
|
||||
sin_solar_elev[crs][0] = solarCal.getSinSolarElevation();
|
||||
}
|
||||
|
||||
// Initialize as -1, if the pointJ.. NOT found, remain -1;
|
||||
// int pointI = i;
|
||||
int pointJ = -1;
|
||||
int pointJ_twi1 = -1;
|
||||
int pointJ_twi2 = -1;
|
||||
int twiC = 0;
|
||||
|
||||
// start j loop
|
||||
for (j = 0; j < cso; ++j) {
|
||||
|
||||
ccs = (int) (j / (grid_space * 1.0) + 0.5);
|
||||
|
||||
if (ccs > css - 1) {
|
||||
ccs = css - 1;
|
||||
}
|
||||
|
||||
if (sin_solar_elev[crs][ccs] == -999.0) { // never been
|
||||
// calculated
|
||||
// awips world remember
|
||||
tem_point = new ReferencedCoordinate(new Coordinate(j, i, 0));
|
||||
try {
|
||||
tem_point.asGridCell(rec.getGridGeometry(), PixelInCell.CELL_CENTER);
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
tem_loc = tem_point.asLatLon();
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
// ================Solar
|
||||
solarCal.setLocation(tem_loc);
|
||||
sin_solar_elev[crs][ccs] = solarCal.getSinSolarElevation();
|
||||
Coordinate tem_solarv3d = solarCal.solarV3D();
|
||||
// ================Sat
|
||||
satCal.setLocation(tem_loc);
|
||||
Coordinate tem_satv3d = satCal.satV3D();
|
||||
cos_e[crs][ccs] = FogMonitorUtils.CosZenith(tem_satv3d);
|
||||
cos_p[crs][ccs] = FogMonitorUtils.CosAngleBetween(tem_solarv3d, tem_satv3d);
|
||||
}
|
||||
// sin_twi >0 so (sin_solar_elev >sin_twi) means daytime
|
||||
// data.
|
||||
if (sin_solar_elev[crs][ccs] > sin_twi) {
|
||||
// begin the correction
|
||||
double sinSolarElevation = sin_solar_elev[crs][ccs];
|
||||
|
||||
if (sinSolarElevation < SIN_MINIMUM_ELEVATION) {
|
||||
sinSolarElevation = SIN_MINIMUM_ELEVATION;
|
||||
}
|
||||
// actual value for VIS satellite, only time it is
|
||||
// accessed here
|
||||
// (SK) r1 = rec.getVisArray()[(rec.getNy()*j)+i];
|
||||
r1 = rec.getVisArray()[rec.getNx() * i + j];
|
||||
// -------------------------------------------------------
|
||||
//
|
||||
// Fine tune applied here is to make the normalization
|
||||
// more realistic.
|
||||
// So the data used following are purely empirical.
|
||||
// ------------------------------------------------------
|
||||
if (r1 < 68 && r1 >= 30 && sin_solar_elev[crs][ccs] < SIN_MINIMUM_ELEVATION) {
|
||||
CorrectionWeight = (float) (30 + 20 * sinSolarElevation + 10 * r1 / 68.0);
|
||||
}
|
||||
// This is a mix of cloud, noise or even cloud free area
|
||||
// because the value and the elevation are too small.
|
||||
else if (r1 < 30 && sin_solar_elev[crs][ccs] < SIN_MINIMUM_ELEVATION) {
|
||||
CorrectionWeight = 30;
|
||||
}
|
||||
// This is a suspected cloud free area
|
||||
else if (r1 < 68 && sin_solar_elev[crs][ccs] > SIN_MINIMUM_ELEVATION) {
|
||||
CorrectionWeight = (float) (20 + 20 * r1 / 68);
|
||||
} else { // This is the cloudy area.
|
||||
CorrectionWeight = (float) (50 + 10 * r1 / 255.0);
|
||||
}
|
||||
|
||||
r1 = r1 - CorrectionWeight * Math.log(sinSolarElevation / sin_ref_angle);
|
||||
// float phasecorrection;
|
||||
// if cos value of the phase angle less than 0.6
|
||||
// If cos(phase angle) <0.6, the phase angle correction
|
||||
// will be less than 1, so ignore it to reduce
|
||||
// calculation
|
||||
if (cos_p[crs][ccs] >= 0.6) {
|
||||
float pCorrection = 20 * cos_p[crs][ccs] * cos_p[crs][ccs]
|
||||
* cos_p[crs][ccs] * cos_p[crs][ccs] * cos_p[crs][ccs]
|
||||
* cos_p[crs][ccs] * cos_e[crs][ccs] * sin_solar_elev[crs][ccs];
|
||||
r1 += pCorrection;
|
||||
}
|
||||
|
||||
if (r1 > 255) {
|
||||
r1 = 255; // Just in case
|
||||
}
|
||||
if (r1 < 0) {
|
||||
r1 = 0; // Just in case
|
||||
}
|
||||
|
||||
// (SK) rec.getVisArray()[rec.getNy() * j + i] = (short) r1;
|
||||
rec.getVisArray()[rec.getNx() * i + j] = (short) r1;
|
||||
} else {
|
||||
// Nighttime pixel value will be set to zero in VIS
|
||||
// array
|
||||
// (SK) rec.getVisArray()[rec.getNy() * j + i] = 0;
|
||||
rec.getVisArray()[rec.getNx() * i + j] = 0;
|
||||
}
|
||||
|
||||
// Enter twilight area and leave twilight area
|
||||
if (Math.abs(sin_solar_elev[crs][ccs]) < sin_twi && twiC == 0
|
||||
|| Math.abs(sin_solar_elev[crs][ccs]) > sin_twi && twiC == 1) {
|
||||
if (ccs == 0) {
|
||||
// first point entering twilight is the first
|
||||
// point of the row
|
||||
twiC++;
|
||||
pointJ_twi1 = 0;
|
||||
} else {
|
||||
// Because the elevation calculation uses a lower
|
||||
// resolution, so the first point entering twilight
|
||||
// must be the point between the current and the
|
||||
// last
|
||||
// lower resolution points.
|
||||
int k_end = ccs * grid_space;
|
||||
// Search each points between two low resolution
|
||||
// points
|
||||
// at high resolution(not spanned) grid.
|
||||
for (int k = (ccs - 1) * grid_space + 1; k <= k_end; ++k) {
|
||||
|
||||
tem_point = new ReferencedCoordinate(new Coordinate(k, i, 0));
|
||||
try {
|
||||
tem_point.asGridCell(rec.getGridGeometry(),
|
||||
PixelInCell.CELL_CENTER);
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
tem_loc = tem_point.asLatLon();
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
solarCal.setLocation(tem_loc);
|
||||
tem_sin_sunelev = solarCal.getSinSolarElevation();
|
||||
|
||||
if (twiC == 0) { // The first point at current
|
||||
// row
|
||||
if (Math.abs(tem_sin_sunelev) <= sin_twi) {
|
||||
pointJ_twi1 = k;
|
||||
twiC++;
|
||||
break;
|
||||
}
|
||||
} else { // The second point at current row
|
||||
if (tem_sin_sunelev >= sin_twi) {
|
||||
pointJ_twi2 = k;
|
||||
twiC++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // end of k loop
|
||||
} // end of if
|
||||
} // end of "if ------ "
|
||||
|
||||
// If the grid_span is too large, both twilight points may
|
||||
// be
|
||||
// missing(Because never enter the twilight area),
|
||||
// then scan for day and night separator point.
|
||||
// If twilight points are found then day/night separator
|
||||
// point
|
||||
// is omitted.
|
||||
if (sin_solar_elev[crs][ccs] * sin_solar_elev[crs][0] < 0 && twiC == 0) {
|
||||
int k_end = ccs * grid_space;
|
||||
for (int k = (ccs - 1) * grid_space + 1; k < k_end + 1; ++k) {
|
||||
|
||||
tem_point = new ReferencedCoordinate(new Coordinate(k, i, 0));
|
||||
try {
|
||||
tem_point
|
||||
.asGridCell(rec.getGridGeometry(), PixelInCell.CELL_CENTER);
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
tem_loc = tem_point.asLatLon();
|
||||
} catch (TransformException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (FactoryException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
solarCal.setLocation(tem_loc);
|
||||
tem_sin_sunelev = solarCal.getSinSolarElevation();
|
||||
|
||||
if (tem_sin_sunelev <= sin_twi) {
|
||||
pointJ = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end of loop j
|
||||
|
||||
// twiC ==1 but pointJ_twi2==0 means entering twilight area,
|
||||
// but never leaving it. So the last point of the row
|
||||
// is the twi2 point
|
||||
if (twiC == 1 && pointJ_twi2 == -1) {
|
||||
pointJ_twi2 = cso - 1;
|
||||
}
|
||||
|
||||
short vis_start;
|
||||
short vis_end;
|
||||
short ir_start;
|
||||
short ir_end;
|
||||
|
||||
if (sin_solar_elev[crs][0] < 0) {
|
||||
// the first point of the line is in night time area.
|
||||
if (pointJ == -1) {
|
||||
if (pointJ_twi1 == -1) { // Only night time area
|
||||
ir_start = 0;
|
||||
ir_end = (short) (cso - 1);
|
||||
vis_start = (short) cso;
|
||||
vis_end = (short) cso;
|
||||
} else { // both day and night
|
||||
ir_start = 0;
|
||||
ir_end = (short) pointJ_twi1;
|
||||
vis_start = (short) pointJ_twi2;
|
||||
vis_end = (short) (cso - 1);
|
||||
|
||||
if (sin_solar_elev[crs][ccs] < 0) { // polar night
|
||||
rec.setRangeType(FogRecord.IMAGE_GROUP.IR_GROUP, i);
|
||||
}
|
||||
}
|
||||
} else { // Use day/night point, and this means no twilight
|
||||
// area
|
||||
ir_start = 0;
|
||||
ir_end = (short) pointJ;
|
||||
vis_start = (short) (pointJ + 1);
|
||||
vis_end = (short) (cso - 1);
|
||||
|
||||
if (vis_start > vis_end) {
|
||||
vis_start = vis_end;
|
||||
}
|
||||
}
|
||||
}
|
||||
// The first point of the row is in day time area.
|
||||
else if (sin_solar_elev[crs][0] > 0) {
|
||||
if (pointJ == -1) {
|
||||
if (pointJ_twi1 == -1) { // Whole day time
|
||||
vis_start = 0;
|
||||
vis_end = (short) (cso - 1);
|
||||
ir_start = 0;
|
||||
ir_end = 0;
|
||||
} else {
|
||||
vis_start = 0;
|
||||
vis_end = (short) pointJ_twi1;
|
||||
ir_start = (short) pointJ_twi2;
|
||||
ir_end = (short) (cso - 1);
|
||||
if (sin_solar_elev[crs][ccs] > 0) { // polar day
|
||||
rec.setRangeType(FogRecord.IMAGE_GROUP.VIS_GROUP, i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
vis_start = 0;
|
||||
vis_end = (short) pointJ;
|
||||
ir_start = (short) (pointJ + 1);
|
||||
ir_end = (short) (cso - 1);
|
||||
if (ir_start > ir_end) {
|
||||
ir_start = ir_end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
if (sin_solar_elev[crs][ccs] > 0) { // ccs is the last
|
||||
// spaned col
|
||||
vis_start = (short) (pointJ_twi2 + 1);
|
||||
vis_end = (short) (cso - 1);
|
||||
ir_start = 0;
|
||||
ir_end = 0;
|
||||
} else {
|
||||
vis_start = 0;
|
||||
vis_end = 0;
|
||||
ir_start = (short) (pointJ_twi2 + 1);
|
||||
ir_end = (short) (cso - 1);
|
||||
}
|
||||
}
|
||||
|
||||
FogRange vis_range = new FogRange();
|
||||
FogRange ir_range = new FogRange();
|
||||
// Assumed that _vis_range and _ir_range of
|
||||
// _fog_image have been resize to appropriate size.
|
||||
vis_range.setStart(vis_start);
|
||||
vis_range.setEnd(vis_end);
|
||||
ir_range.setStart(ir_start);
|
||||
ir_range.setEnd(ir_end);
|
||||
rec.setVisRange(vis_range, i);
|
||||
rec.setIRRange(ir_range, i);
|
||||
} // end of loop i
|
||||
} // end of if VIS_needed -----
|
||||
else {
|
||||
for (i = 0; i < rso; ++i) {
|
||||
FogRange vis_range = new FogRange();
|
||||
FogRange ir_range = new FogRange();
|
||||
|
||||
vis_range.setStart(-1);
|
||||
vis_range.setEnd(-1);
|
||||
ir_range.setStart(0);
|
||||
ir_range.setEnd(cso - 1);
|
||||
rec.setVisRange(vis_range, i);
|
||||
rec.setIRRange(ir_range, i);
|
||||
}
|
||||
}
|
||||
|
||||
return rec;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,204 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog.analysis;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
public class FogMonitorUtils {
|
||||
|
||||
//-free function---------------------------------------------------------------
|
||||
// NAME: CosAngleBetween
|
||||
//
|
||||
// TYPE: free function
|
||||
//
|
||||
// Descript:
|
||||
// Given two 3D vectors, this function calculate the COSINE value of
|
||||
// the angle between the vectors.
|
||||
//Input Arguments:
|
||||
// vector1: one of the 3D vector
|
||||
// vector2: the other 3D vector
|
||||
// isUnit : if the vector is Unit Vector ie. |vector|=1
|
||||
//Output Argutments:
|
||||
// Return:
|
||||
// float: COSINE value of the angle between the two vectors.
|
||||
// History:
|
||||
// May 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
// Dec 2009 D Hladky translated to Java
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public static float CosAngleBetween(Coordinate vector1, Coordinate vector2) {
|
||||
|
||||
float norm = 1;
|
||||
float norm1;
|
||||
float norm2;
|
||||
|
||||
norm1 = (float) Math.sqrt(vector1.x*vector1.x
|
||||
+ vector1.y*vector1.y
|
||||
+ vector1.z*vector1.z);
|
||||
norm2 = (float) Math.sqrt(vector2.x*vector2.x
|
||||
+ vector2.y*vector2.y
|
||||
+ vector2.z*vector2.z);
|
||||
norm = norm1 * norm2;
|
||||
|
||||
return (float)((vector1.x*vector2.x + vector1.y*vector2.y + vector1.z*vector2.z)/norm);
|
||||
}
|
||||
|
||||
|
||||
//-free function---------------------------------------------------------------
|
||||
// NAME: CosAzimuth
|
||||
// TYPE: free function
|
||||
//
|
||||
// Descript:
|
||||
// Given a 3D vectors, this function calculate the COSINE value of
|
||||
// the Azimuth angle of the vector .
|
||||
// Here we define Azimuth angle as the angle starting from the north
|
||||
// direction.
|
||||
// Input Arguments:
|
||||
// vector1: the 3D vector
|
||||
// Output Arguments:
|
||||
// Return:
|
||||
// float: COSINE value of the azimuth angle .
|
||||
// History:
|
||||
// May 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
//-----------------------------------------------------------------------------
|
||||
public static float CosAzimuth(Coordinate vector1) {
|
||||
|
||||
float normXY = (float) Math.sqrt(vector1.x*vector1.x + vector1.y*vector1.y);
|
||||
return (float) (vector1.y/normXY);
|
||||
}
|
||||
|
||||
|
||||
//-free function---------------------------------------------------------------
|
||||
// NAME: SinAzimuth
|
||||
// TYPE: free function
|
||||
//
|
||||
// Descript:
|
||||
// Given a 3D vectors, this function calculate the SINE value of
|
||||
// the Azimuth angle of the vector .
|
||||
// Here we define Azimuth angle as the angle starting from the north
|
||||
// direction.
|
||||
// Input Arguments:
|
||||
// vector1: the 3D vector
|
||||
// Output Arguments:
|
||||
// Return:
|
||||
// float: SINE value of the azimuth angle .
|
||||
// History:
|
||||
// May 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public static float SinAzimuth(Coordinate vector1) {
|
||||
|
||||
float normXY = (float) Math.sqrt(vector1.x*vector1.x + vector1.y*vector1.y);
|
||||
return (float) (vector1.x/normXY);
|
||||
}
|
||||
|
||||
|
||||
//-free function---------------------------------------------------------------
|
||||
// NAME: CosZentih
|
||||
// TYPE: free function
|
||||
//
|
||||
// Descript:
|
||||
// Given a 3D vectors, this function calculate the COSINE value of
|
||||
// the Zenith angle of the vector .
|
||||
// Input Arguments:
|
||||
// vector1: the 3D vector
|
||||
// isUnit : if the vector is Unit Vector ie. |vector|=1
|
||||
// Output Arguments:
|
||||
// Return:
|
||||
// float: COSINE value of the Zenith angle .
|
||||
// History:
|
||||
// May 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public static float CosZenith(Coordinate vector1) {
|
||||
|
||||
float norm = (float) Math.sqrt(vector1.x*vector1.x
|
||||
+ vector1.y*vector1.y
|
||||
+ vector1.z*vector1.z);
|
||||
vector1.z=vector1.z/norm;
|
||||
|
||||
return (float) vector1.z;
|
||||
}
|
||||
|
||||
// the same as CosZenith
|
||||
public static float SinElev(Coordinate vector1) {
|
||||
return CosZenith(vector1);
|
||||
}
|
||||
|
||||
|
||||
public static float CosElev(Coordinate vector1) {
|
||||
// Elevation angle ranges from -90 to +90
|
||||
// so CosElev is always greater than or equal to 0;
|
||||
return (float) Math.sqrt(1-SinElev(vector1)*SinElev(vector1));
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//Name: count2temp
|
||||
//Type: public member function
|
||||
//
|
||||
//Description:
|
||||
// Retrieve the temperature based on channel and brightness
|
||||
// Reference:
|
||||
// http://laps.fsl.noaa.gov/birk/awipsgoes/goesinfo.html
|
||||
// "AWIPS-GOES Data Utilization Page"
|
||||
//
|
||||
//Input Argument:
|
||||
// count_value: count value which represent brightness
|
||||
// ranging from 0 to 255
|
||||
// channel: Which channel to be calculated. (IR3_9 or IR10_7)
|
||||
//Output Argument:
|
||||
// Return the temperature according the count and channel.
|
||||
//History:
|
||||
// March 2004 ------ Qin Zeng(GDMB/MDL) created
|
||||
// Converted to Java D Hladky 12 Dec 09
|
||||
//--------------------------------------------------------------------------
|
||||
public static float count2temp(int count_value, FogRecord.CHANNEL channel)
|
||||
{
|
||||
if (count_value == 255) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (channel == FogRecord.CHANNEL.IR3_9) {
|
||||
if (count_value > 216) {
|
||||
return 0;
|
||||
}
|
||||
else if(count_value > 183) {
|
||||
return (float)421.7- count_value;
|
||||
}
|
||||
else {
|
||||
return (float)(660.4- count_value)/2;
|
||||
}
|
||||
}
|
||||
|
||||
else if (channel == FogRecord.CHANNEL.IR10_7) {
|
||||
if (count_value > 180) {
|
||||
return (float)420.0 - count_value;
|
||||
}
|
||||
else if (count_value > 0) {
|
||||
return (float) ((660.0 - count_value)/2.0);
|
||||
}
|
||||
}
|
||||
// default
|
||||
return (float) -999.0;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog.analysis;
|
||||
|
||||
public class FogRange {
|
||||
|
||||
private Integer start = 0;
|
||||
|
||||
private Integer end = 0;
|
||||
|
||||
public FogRange() {
|
||||
|
||||
}
|
||||
|
||||
public Integer getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
public void setStart(int start) {
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
public Integer getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
public void setEnd(int end) {
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog.analysis;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
public class FogSatCalculator {
|
||||
|
||||
public static double REARTH = 6356752.314;
|
||||
private double satlon = 0.0;
|
||||
private double lon = 0.0;
|
||||
private double lat = 0.0;
|
||||
public Coordinate location = new Coordinate();
|
||||
public Coordinate u_sat_vec = new Coordinate();
|
||||
public boolean calFlag = false;
|
||||
public float satHeight = 0.0f;
|
||||
|
||||
public FogSatCalculator() {
|
||||
|
||||
}
|
||||
|
||||
public void setLocation(Coordinate location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public void setSatHeight(float satHeight) {
|
||||
this.satHeight = satHeight;
|
||||
}
|
||||
|
||||
public void setSatLon(double satlon) {
|
||||
this.satlon = satlon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gest the 3D vector for the satellite to the location
|
||||
* @return
|
||||
*/
|
||||
public Coordinate satV3D()
|
||||
{
|
||||
if (!constructFlag()) {
|
||||
calculate();
|
||||
}
|
||||
return u_sat_vec;
|
||||
}
|
||||
|
||||
// Name: ConstructFlag()
|
||||
// Description:
|
||||
// Construct a flag to indicate whether the elev and azm needed to be
|
||||
// recalculated.
|
||||
// If any of the component of the flag (_lat,_lon,_satlon) changes,
|
||||
// a recalculation is neeeded.
|
||||
// Input Arguments:
|
||||
// None
|
||||
// Output Arguments:
|
||||
// return std::string: string flag to indicate what location
|
||||
// is currently used.
|
||||
// History:
|
||||
// April 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public boolean constructFlag() {
|
||||
return calFlag;
|
||||
}
|
||||
|
||||
//-private---------------------------------------------------------------------
|
||||
//
|
||||
// TYPE: private member function
|
||||
// Name: Calculate()
|
||||
// Description:
|
||||
// Calculate the azimuth and the elevation of the satellite based on
|
||||
// 3D geometry relationship between the satellite and the local point.
|
||||
// Assumptions are that Earth is a sphere and the satellite is right
|
||||
// above equator ie. latitude is 0.0 .
|
||||
// Based on the spherical geometry knowledge.
|
||||
// For more info:
|
||||
// http://mathworld.wolfram.com/topics/Spheres.html
|
||||
// Input Arguments:
|
||||
// None
|
||||
// Output Arguments:
|
||||
// None
|
||||
// History:
|
||||
// April 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
// Sep. 2004 Qi Zhu (RSIS/MDL) Replaced calling setupinfo->satelliteHeight()
|
||||
// to get satellite height with using
|
||||
// data member _satHeight.
|
||||
//-----------------------------------------------------------------------------
|
||||
public void calculate()
|
||||
{
|
||||
double longdiffr = Math.toRadians(lon-satlon);
|
||||
double latr = Math.toRadians(lat);
|
||||
|
||||
//SetupAccessor * setupinfo = SetupAccessor::getInstance();
|
||||
//float SAT_EARTH_DISTANCE = setupinfo->satelliteHeight();
|
||||
float SAT_EARTH_DISTANCE = satHeight;
|
||||
|
||||
float r1 = (float) (1+SAT_EARTH_DISTANCE/(REARTH/1000));
|
||||
double v1 = r1*Math.cos(latr)* Math.cos(longdiffr)-1;
|
||||
double v2 = r1*Math.sqrt(1-Math.cos(latr)* Math.cos(latr)* Math.cos(longdiffr)* Math.cos(longdiffr));
|
||||
u_sat_vec.z = v1/Math.sqrt(v1*v1+v2*v2);
|
||||
float cos_elev = (float) (v2/Math.sqrt(v1*v1+v2*v2));
|
||||
|
||||
if (latr == 0)
|
||||
{
|
||||
if (longdiffr > 0)
|
||||
{
|
||||
u_sat_vec.x = -cos_elev;
|
||||
u_sat_vec.y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
u_sat_vec.x = cos_elev;
|
||||
u_sat_vec.y = 0;
|
||||
}
|
||||
calFlag = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
float tan_azm = (float) (Math.tan(longdiffr)/Math.sin(latr));
|
||||
|
||||
if (latr<0) // north quadrant
|
||||
{
|
||||
if (tan_azm > 0)
|
||||
{
|
||||
float cos_azm = (float) (1/(Math.sqrt(1+tan_azm*tan_azm)));
|
||||
u_sat_vec.y = cos_elev * cos_azm;
|
||||
float sin_azm = (float) Math.sqrt(1-cos_azm*cos_azm);
|
||||
u_sat_vec.x = cos_elev * sin_azm;
|
||||
}
|
||||
else
|
||||
{
|
||||
float cos_azm =(float) (-1/(Math.sqrt(1+tan_azm*tan_azm)));
|
||||
u_sat_vec.y = cos_elev * cos_azm;
|
||||
float sin_azm = (float) Math.sqrt(1-cos_azm*cos_azm);
|
||||
u_sat_vec.x = cos_elev * sin_azm;
|
||||
}
|
||||
}
|
||||
else // either south quadrant;
|
||||
{
|
||||
if (tan_azm > 0)
|
||||
{
|
||||
float cos_azm = (float) (-1/(Math.sqrt(1+tan_azm*tan_azm)));
|
||||
u_sat_vec.y = cos_elev * cos_azm;
|
||||
float sin_azm = (float) (-1*(Math.sqrt(1-cos_azm*cos_azm)));
|
||||
u_sat_vec.x = cos_elev * sin_azm;
|
||||
}
|
||||
else
|
||||
{
|
||||
float cos_azm = (float) (1/(Math.sqrt(1+tan_azm*tan_azm)));
|
||||
u_sat_vec.y = cos_elev * cos_azm;
|
||||
float sin_azm = (float) (-1*(Math.sqrt(1-cos_azm*cos_azm)));
|
||||
u_sat_vec.x = cos_elev * sin_azm;
|
||||
}
|
||||
|
||||
}
|
||||
calFlag = true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,242 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fog.analysis;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
public class FogSolarCalculator {
|
||||
|
||||
public boolean visNeeded = true;
|
||||
public boolean calFlag = false;
|
||||
public DataTime dataTime;
|
||||
public Coordinate location;
|
||||
public float sinSolarElevation = 0;
|
||||
public float solarDeclinationAngle = 0;
|
||||
public float cos_azm = 0.0f;
|
||||
public float cos_zenith = 0.0f;
|
||||
public float sha = 0.0f;
|
||||
public Coordinate u_s_vec = new Coordinate();
|
||||
|
||||
// time realted stuff
|
||||
int minutes = 0;
|
||||
int seconds = 0;
|
||||
int hour = 0;
|
||||
int day = 0;
|
||||
int month = 0;
|
||||
int year = 0;
|
||||
int yday = 0;
|
||||
|
||||
public FogSolarCalculator() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the time related stuff
|
||||
* @param dataTime
|
||||
*/
|
||||
public void setDataTime(DataTime dataTime) {
|
||||
this.dataTime = dataTime;
|
||||
|
||||
minutes = dataTime.getRefTimeAsCalendar().get(Calendar.MINUTE);
|
||||
seconds = dataTime.getRefTimeAsCalendar().get(Calendar.SECOND);
|
||||
hour = dataTime.getRefTimeAsCalendar().get(Calendar.HOUR_OF_DAY);
|
||||
day = dataTime.getRefTimeAsCalendar().get(Calendar.DAY_OF_MONTH);
|
||||
month = dataTime.getRefTimeAsCalendar().get(Calendar.MONTH)-1;
|
||||
year = dataTime.getRefTimeAsCalendar().get(Calendar.YEAR)-1900;
|
||||
yday = dataTime.getRefTimeAsCalendar().get(Calendar.DAY_OF_YEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the location coordinate
|
||||
* @param location
|
||||
*/
|
||||
public void setLocation(Coordinate location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the vis satellite record needed
|
||||
* @return
|
||||
*/
|
||||
public boolean visNeeded() {
|
||||
return visNeeded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates a need for recalculation
|
||||
* @return
|
||||
*/
|
||||
public boolean constructFlag() {
|
||||
return calFlag;
|
||||
}
|
||||
|
||||
|
||||
//-public---------------------------------------------------------------------
|
||||
//
|
||||
// TYPE: Public member function
|
||||
// Name: float Sin_SolarElevation()
|
||||
// Description:
|
||||
// Check if a recalculation is needed.
|
||||
// If so, recalculate it.
|
||||
// Then return sin value of the solar elevation
|
||||
// Input Arguments:
|
||||
// None
|
||||
// Output Arguments:
|
||||
// return float: COSINE value of zenith
|
||||
// History:
|
||||
// April 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public float getSinSolarElevation() {
|
||||
if (!constructFlag()) {
|
||||
calculate();
|
||||
}
|
||||
|
||||
return cos_zenith;
|
||||
}
|
||||
|
||||
//-public---------------------------------------------------------------------
|
||||
//
|
||||
// TYPE: Public member function
|
||||
// Name: SolarV3D()
|
||||
// Description:
|
||||
// Check if a recalculation is needed.
|
||||
// If so, recalculate it.
|
||||
// Then return the EARTH-SUN vector from local point
|
||||
// Input Arguments:
|
||||
// None
|
||||
// Output Arguments:
|
||||
// return Vector3D:the EARTH-SUN vector from local point
|
||||
|
||||
// History:
|
||||
// April 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
// Dec 13, 2009 D Hladky converted to Java
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public Coordinate solarV3D() {
|
||||
if (!constructFlag()) {
|
||||
calculate();
|
||||
}
|
||||
|
||||
return u_s_vec;
|
||||
}
|
||||
|
||||
//-private---------------------------------------------------------------------
|
||||
//
|
||||
// TYPE: private member function
|
||||
// Name: Calculate()
|
||||
// Description:
|
||||
// Calculate the azimuth and the elevation of the Sun from the view of
|
||||
// a local point on the Earth
|
||||
// This calculation is based on a NOAA website's document. This is the
|
||||
// lower accuracy version.
|
||||
//Input: None
|
||||
//Output:None
|
||||
//
|
||||
// Note:
|
||||
// http://www.srrb.noaa.gov/hightlights/sunrise/calcdetails.html
|
||||
// So no explanation for the astronomical magic numbers.
|
||||
// History:
|
||||
// April 2004 Qin Zeng (GDMB/MDL) -- created
|
||||
// Dec 2009 D Hladky ported to Java AWIPS II
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public void calculate() {
|
||||
|
||||
float latr = (float) Math.toRadians(location.y);
|
||||
float lonr = (float) Math.toRadians(location.x);
|
||||
int time_zone;
|
||||
|
||||
if (lonr > 0) {
|
||||
time_zone = (int) ((location.x -7.5)/15 + 1);
|
||||
}
|
||||
else {
|
||||
time_zone = (int) ((location.x + 7.5) /15 - 1);
|
||||
}
|
||||
|
||||
float gamma = (float) (2 * Math.PI / 365 * (yday + (hour - 12)/24.0 ));
|
||||
// calculate equation time
|
||||
float eqtime = (float) (229.18 * (0.000075 + 0.001868* Math.cos(gamma)
|
||||
-0.032077*Math.sin(gamma) -0.014615 * Math.cos(2* gamma)
|
||||
- 0.040849*Math.sin(2*gamma)));
|
||||
|
||||
// calculate solar declination angle
|
||||
solarDeclinationAngle = (float) (0.006918 -0.399912* Math.cos(gamma) + 0.070257* Math.sin(gamma)
|
||||
- 0.006758*Math.cos(2* gamma) + 0.000907*Math.sin(2*gamma)
|
||||
-0.002697*Math.cos(3*gamma)+ 0.00148*Math.sin(3*gamma));
|
||||
|
||||
float time_offset = (float) (eqtime +4*location.x - 60 *time_zone);
|
||||
float tst = (float) (hour *60 + minutes + seconds/60.0 + time_offset);
|
||||
|
||||
sha = (float) Math.toRadians((tst/4.0)-180);
|
||||
|
||||
float sin_radlat = (float) Math.sin(latr);
|
||||
float sin_decl = (float) Math.sin(solarDeclinationAngle);
|
||||
float cos_radlat = (float) Math.cos(latr);
|
||||
float cos_decl = (float) Math.cos(solarDeclinationAngle);
|
||||
float cos_sha = (float) Math.cos(sha);
|
||||
|
||||
cos_zenith = sin_radlat* sin_decl + cos_radlat * cos_decl * cos_sha;
|
||||
|
||||
if (cos_zenith > 1) {
|
||||
cos_zenith = 1;
|
||||
}
|
||||
if (cos_zenith < -1) {
|
||||
cos_zenith = -1;
|
||||
}
|
||||
|
||||
u_s_vec.z = cos_zenith;
|
||||
|
||||
float sin_zenith = (float) Math.sqrt(1-cos_zenith * cos_zenith);
|
||||
|
||||
// Calculate azimuth of the sun
|
||||
if (sin_zenith != 0) {
|
||||
cos_azm = Math.abs((sin_radlat* cos_zenith - sin_decl)
|
||||
/ (cos_radlat * sin_zenith));
|
||||
}
|
||||
else {
|
||||
cos_azm = 0;
|
||||
}
|
||||
|
||||
if (cos_azm > 1) cos_azm = 1;
|
||||
if (cos_azm < -1) cos_azm =-1;
|
||||
|
||||
if (solarDeclinationAngle == latr) cos_azm =0;
|
||||
if (solarDeclinationAngle < latr)
|
||||
cos_azm = -cos_azm;
|
||||
|
||||
float sin_azm;
|
||||
|
||||
if ( sha > 0) {
|
||||
sin_azm = (float) -Math.sqrt(1-cos_azm*cos_azm);
|
||||
}
|
||||
else {
|
||||
sin_azm = (float) Math.sqrt(1-cos_azm*cos_azm);
|
||||
}
|
||||
|
||||
u_s_vec.x = sin_zenith * sin_azm;
|
||||
u_s_vec.y = sin_zenith * cos_azm;
|
||||
|
||||
calFlag = true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,284 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an absolute override file, indicating that a higher priority
|
||||
version of the file will completely replace a lower priority version
|
||||
of the file.
|
||||
-->
|
||||
<!-- This is a colormap file that is read via JAXB to unmarshal the ColorMap class. -->
|
||||
<colorMap>
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0" g="0" b="0" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.745098039" g="0.745098039" b="0.745098039" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.0117647058823529" g="0.996078431372549" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0.980392156862745" b="0.0117647058823529" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="0.996078431372549" g="0" b="0" a="1" />
|
||||
<color r="1" g="1" b="1" a="1" />
|
||||
</colorMap>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.fssobs</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,15 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: FSS Obs
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.fssobs
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.fssobs
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.serialization,
|
||||
org.hibernate;bundle-version="1.0.0"
|
||||
Import-Package: com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
com.raytheon.uf.common.pointdata.spatial,
|
||||
javax.persistence
|
|
@ -0,0 +1 @@
|
|||
com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord
|
|
@ -0,0 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,260 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.fssobs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* Provides a transform from PointDataContainer to FSSObsRecord.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 8, 2011 skorolev Initial creation
|
||||
* Jul 23, 2014 3410 bclement location changed to floats
|
||||
* Dec 02, 2015 3873 dhladky Added reportType, stationary
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author skorolev
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FSSObsRecordTransform {
|
||||
private static final String DATA_URI = "dataURI";
|
||||
|
||||
private static final String LONGITUDE = "longitude";
|
||||
|
||||
private static final String LATITUDE = "latitude";
|
||||
|
||||
private static final String ELEVATION = "elevation";
|
||||
|
||||
private static final String CEILING = "ceiling";
|
||||
|
||||
private static final String DEWPOINT = "dewpoint";
|
||||
|
||||
private static final String DEWPOINT_DEPR = "dewpointDepr";
|
||||
|
||||
private static final String FROSTBITE_TIME = "frostbiteTime";
|
||||
|
||||
private static final String HORIZONTAL_VIS = "horzVisibility";
|
||||
|
||||
private static final String HOURLY_PRECIP = "hourlyPrecip";
|
||||
|
||||
private static final String MAX_WIND_SPEED = "maxWindSpeed";
|
||||
|
||||
private static final String PLATFORM_ID = "platformId";
|
||||
|
||||
private static final String PRES_WEATHER = "presWeather";
|
||||
|
||||
private static final String PRESS_CHANGE3_HOUR = "pressChange3Hour";
|
||||
|
||||
private static final String PRESS_CHANGE_CHAR = "pressChangeChar";
|
||||
|
||||
private static final String PRESS_ALTIMETER = "pressureAltimeter";
|
||||
|
||||
private static final String PRI_SWELL_WV_DIR = "primarySwellWaveDir";
|
||||
|
||||
private static final String PRI_SWELL_WV_HGT = "primarySwellWaveHeight";
|
||||
|
||||
private static final String PRI_SWELL_WV_PD = "primarySwellWavePeriod";
|
||||
|
||||
private static final String RAW_MESSAGE = "rawMessage";
|
||||
|
||||
private static final String REL_HUMIDITY = "relativeHumidity";
|
||||
|
||||
private static final String SEA_LEVEL_PRESS = "seaLevelPress";
|
||||
|
||||
private static final String SEA_SFC_TEMP = "seaSurfaceTemp";
|
||||
|
||||
private static final String SEC_SWELL_WV_DIR = "secondarySwellWaveDir";
|
||||
|
||||
private static final String SEC_SWELL_WV_HGT = "secondarySwellWaveHeight";
|
||||
|
||||
private static final String SEC_SWELL_WV_PD = "secondarySwellWavePeriod";
|
||||
|
||||
private static final String SKY_COVER = "skyCover";
|
||||
|
||||
private static final String SNOW_INC_HOURLY = "snincrHourly";
|
||||
|
||||
private static final String SNOW_INC_TOTAL = "snincrTotal";
|
||||
|
||||
private static final String SNOW_DEPTH = "snowDepth";
|
||||
|
||||
private static final String STATION_NAME = "stnName";
|
||||
|
||||
private static final String TEMPERATURE = "temperature";
|
||||
|
||||
private static final String TIME_OBS = "timeObs";
|
||||
|
||||
private static final String REF_HOUR = "refHour";
|
||||
|
||||
private static final String CLOUD_AMOUNT_TOT = "totCloudAmount";
|
||||
|
||||
private static final String VISIBILITY = "visibility";
|
||||
|
||||
private static final String WAVE_HEIGHT = "highResWaveHeight";
|
||||
|
||||
private static final String WV_HGT = "waveHeight";
|
||||
|
||||
private static final String WV_PD = "wavePeriod";
|
||||
|
||||
private static final String WV_STEEPNESS = "waveSteepness";
|
||||
|
||||
private static final String WIND_DIR = "windDir";
|
||||
|
||||
private static final String WIND_GUST = "windGust";
|
||||
|
||||
private static final String WIND_SPEED = "windSpeed";
|
||||
|
||||
private static final String STATIONARY = "stationary";
|
||||
|
||||
private static final String REPORT_TYPE = "reportType";
|
||||
|
||||
public static final String[] FSSOBS_PARAMS = { DATA_URI, LONGITUDE,
|
||||
LATITUDE, ELEVATION, CEILING, DEWPOINT, DEWPOINT_DEPR,
|
||||
FROSTBITE_TIME, HORIZONTAL_VIS, HOURLY_PRECIP, MAX_WIND_SPEED,
|
||||
PLATFORM_ID, PRES_WEATHER, PRESS_CHANGE3_HOUR, PRESS_CHANGE_CHAR,
|
||||
PRESS_ALTIMETER, PRI_SWELL_WV_DIR, PRI_SWELL_WV_HGT,
|
||||
PRI_SWELL_WV_PD, RAW_MESSAGE, REL_HUMIDITY, SEA_LEVEL_PRESS,
|
||||
SEA_SFC_TEMP, SEC_SWELL_WV_DIR, SEC_SWELL_WV_HGT, SEC_SWELL_WV_PD,
|
||||
SKY_COVER, SNOW_INC_HOURLY, SNOW_INC_TOTAL, SNOW_DEPTH,
|
||||
STATION_NAME, TEMPERATURE, TIME_OBS, REF_HOUR, CLOUD_AMOUNT_TOT,
|
||||
VISIBILITY, WAVE_HEIGHT, WV_HGT, WV_PD, WV_STEEPNESS, WIND_DIR,
|
||||
WIND_GUST, WIND_SPEED, STATIONARY, REPORT_TYPE };
|
||||
|
||||
public static final String FSSOBS_PARAMS_LIST;
|
||||
|
||||
static {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
boolean first = true;
|
||||
for (String s : FSSOBS_PARAMS) {
|
||||
if (!first) {
|
||||
sb.append(", ");
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
sb.append(s);
|
||||
}
|
||||
FSSOBS_PARAMS_LIST = sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
* @return
|
||||
*/
|
||||
public static FSSObsRecord[] toFSSObsRecords(PointDataContainer container) {
|
||||
List<FSSObsRecord> records = new ArrayList<FSSObsRecord>();
|
||||
if (container != null) {
|
||||
container.setAllocatedSz(container.getAllocatedSz());
|
||||
for (int i = 0; i < container.getCurrentSz(); i++) {
|
||||
PointDataView pdv = container.readRandom(i);
|
||||
FSSObsRecord obs = toFSSObsRecord(pdv);
|
||||
if (obs != null) {
|
||||
records.add(obs);
|
||||
}
|
||||
}
|
||||
}
|
||||
return records.toArray(new FSSObsRecord[records.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reconstitutes an FSSObsRecord from the pointData view.
|
||||
* @param pdv
|
||||
* @return
|
||||
*/
|
||||
private static FSSObsRecord toFSSObsRecord(PointDataView pdv) {
|
||||
FSSObsRecord obs = null;
|
||||
if (pdv != null) {
|
||||
|
||||
obs = new FSSObsRecord();
|
||||
obs.setDataURI(pdv.getString(DATA_URI));
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation(
|
||||
pdv.getString(PLATFORM_ID));
|
||||
float lat = pdv.getNumber(LATITUDE).floatValue();
|
||||
float lon = pdv.getNumber(LONGITUDE).floatValue();
|
||||
loc.assignLocation(lat, lon);
|
||||
loc.setElevation(pdv.getNumber(ELEVATION).intValue());
|
||||
obs.setLocation(loc);
|
||||
obs.setStationary(Boolean.parseBoolean(pdv.getString(STATIONARY)));
|
||||
obs.setReportType(pdv.getString(REPORT_TYPE));
|
||||
obs.setCeiling(pdv.getFloat(CEILING));
|
||||
obs.setDewpoint(pdv.getNumber(DEWPOINT).floatValue());
|
||||
obs.setDewpointDepr(pdv.getFloat(DEWPOINT_DEPR));
|
||||
obs.setFrostbiteTime(pdv.getFloat(FROSTBITE_TIME));
|
||||
obs.setHorzVisibility(pdv.getFloat(HORIZONTAL_VIS));
|
||||
obs.setHourlyPrecip(pdv.getFloat(HOURLY_PRECIP));
|
||||
obs.setMaxWindSpeed(pdv.getFloat(MAX_WIND_SPEED));
|
||||
obs.setPlatformId(pdv.getString(PLATFORM_ID));
|
||||
obs.setPresWeather(pdv.getStringAllLevels(PRES_WEATHER));
|
||||
obs.setPressChange3Hour(pdv.getNumber(PRESS_CHANGE3_HOUR)
|
||||
.floatValue());
|
||||
obs.setPressChangeChar(pdv.getString(PRESS_CHANGE_CHAR));
|
||||
obs.setPressureAltimeter(pdv.getFloat(PRESS_ALTIMETER));
|
||||
obs.setPrimarySwellWaveDir(pdv.getNumber(PRI_SWELL_WV_DIR)
|
||||
.doubleValue());
|
||||
obs.setPrimarySwellWaveHeight(pdv.getNumber(PRI_SWELL_WV_HGT)
|
||||
.doubleValue());
|
||||
obs.setPrimarySwellWavePeriod(pdv.getNumber(PRI_SWELL_WV_PD)
|
||||
.intValue());
|
||||
obs.setRawMessage(pdv.getString(RAW_MESSAGE));
|
||||
obs.setRelativeHumidity(pdv.getFloat(REL_HUMIDITY));
|
||||
obs.setSeaLevelPress(pdv.getFloat(SEA_LEVEL_PRESS));
|
||||
obs.setSeaSurfaceTemp(pdv.getFloat(SEA_SFC_TEMP));
|
||||
obs.setSecondarySwellWaveDir(pdv.getNumber(SEC_SWELL_WV_DIR)
|
||||
.doubleValue());
|
||||
obs.setSecondarySwellWaveHeight(pdv.getNumber(SEC_SWELL_WV_HGT)
|
||||
.doubleValue());
|
||||
obs.setSecondarySwellWavePeriod(pdv.getNumber(SEC_SWELL_WV_PD)
|
||||
.intValue());
|
||||
obs.setSkyCover(pdv.getStringAllLevels(SKY_COVER));
|
||||
obs.setSnincrHourly(pdv.getFloat(SNOW_INC_HOURLY));
|
||||
obs.setSnincrTotal(pdv.getFloat(SNOW_INC_TOTAL));
|
||||
obs.setSnowDepth(pdv.getFloat(SNOW_DEPTH));
|
||||
obs.setStnName(pdv.getString(STATION_NAME));
|
||||
obs.setTemperature(pdv.getFloat(TEMPERATURE));
|
||||
long to = pdv.getLong(TIME_OBS);
|
||||
obs.setTimeObs(TimeUtil.newGmtCalendar(new Date(to)));
|
||||
long rh = pdv.getLong(REF_HOUR);
|
||||
obs.setRefHour(TimeUtil.newGmtCalendar(new Date(rh)));
|
||||
obs.setTotCloudAmount(pdv.getNumber(CLOUD_AMOUNT_TOT).intValue());
|
||||
obs.setVisibility(pdv.getNumber(VISIBILITY).floatValue());
|
||||
obs.setHighResWaveHeight(pdv.getFloat(WAVE_HEIGHT));
|
||||
obs.setWaveHeight(pdv.getNumber(WV_HGT).doubleValue());
|
||||
obs.setWavePeriod(pdv.getNumber(WV_PD).intValue());
|
||||
obs.setWindDir(pdv.getNumber(WIND_DIR).floatValue());
|
||||
obs.setWindGust(pdv.getNumber(WIND_GUST).floatValue());
|
||||
obs.setWindSpeed(pdv.getNumber(WIND_SPEED).floatValue());
|
||||
|
||||
}
|
||||
return obs;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.madis/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.madis/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.madis</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,16 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Madis
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.madis
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.madis
|
||||
Require-Bundle: javax.persistence;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
|
@ -0,0 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.preciprate</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,19 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Perciprate Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.preciprate
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: javax.persistence;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization,
|
||||
org.geotools;bundle-version="2.5.2",
|
||||
com.raytheon.uf.common.monitor;bundle-version="1.11.5",
|
||||
com.raytheon.uf.common.dataplugin.radar,
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.datastorage
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.preciprate
|
||||
Import-Package: com.raytheon.uf.common.status
|
|
@ -0,0 +1,5 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
utility/,\
|
||||
.
|
|
@ -0,0 +1,590 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.preciprate;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.PrimaryKeyJoinColumn;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.geotools.coverage.grid.GeneralGridEnvelope;
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.geotools.geometry.GeneralEnvelope;
|
||||
import org.hibernate.annotations.Index;
|
||||
import org.opengis.referencing.crs.ProjectedCRS;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants.DHRValues;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.StorageException;
|
||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.monitor.processing.IMonitorProcessing;
|
||||
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
|
||||
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* Record implementation for Precipitation Rate plugin
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 25, 2010 3796 D. Hladky Initial release
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 06, 2013 2228 njensen Use deserialize(byte[])
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "preciprateseq")
|
||||
@Table(name = "preciprate", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "preciprate", indexes = { @Index(name = "preciprate_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
public class PrecipRateRecord extends PersistablePluginDataObject implements
|
||||
IMonitorProcessing {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(PrecipRateRecord.class);
|
||||
|
||||
private static final long serialVersionUID = 76774564365671L;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Integer gateResolution;
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
private String icao;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Float latitude;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Float longitude;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Integer numRadials;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Integer numBins;
|
||||
|
||||
@Column(length = 7)
|
||||
@DynamicSerializeElement
|
||||
private String mnemonic;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Integer volumeCoveragePattern;
|
||||
|
||||
@ManyToOne
|
||||
@PrimaryKeyJoinColumn
|
||||
@DynamicSerializeElement
|
||||
private RadarStation location;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Double coefficent = 0.0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Double acoefficent = 0.0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Double hailcap = 0.0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private Double bias = 0.0;
|
||||
|
||||
@Transient
|
||||
private Map<DHRValues, Double> dhrMap;
|
||||
|
||||
@Transient
|
||||
protected byte[] rawData;
|
||||
|
||||
@Transient
|
||||
@DynamicSerializeElement
|
||||
protected float[] angleData;
|
||||
|
||||
@Transient
|
||||
protected transient ProjectedCRS crs;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public PrecipRateRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get NX
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer getNx() {
|
||||
return getNumBins();
|
||||
}
|
||||
|
||||
/**
|
||||
* get the NY
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer getNy() {
|
||||
return getNumRadials();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DX in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getDx() {
|
||||
return getGateResolution();
|
||||
}
|
||||
|
||||
/**
|
||||
* get the DY, in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getDy() {
|
||||
return getGateResolution();
|
||||
}
|
||||
|
||||
/**
|
||||
* power value of the ZR equation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Double getCoefficent() {
|
||||
return coefficent;
|
||||
}
|
||||
|
||||
public void setCoefficent(Double coefficent) {
|
||||
this.coefficent = coefficent;
|
||||
}
|
||||
|
||||
/**
|
||||
* multiplier factor of the ZR equation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Double getAcoefficent() {
|
||||
return acoefficent;
|
||||
}
|
||||
|
||||
public void setAcoefficent(Double acoefficent) {
|
||||
this.acoefficent = acoefficent;
|
||||
}
|
||||
|
||||
/**
|
||||
* max hail size in MM
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Double getHailcap() {
|
||||
return hailcap;
|
||||
}
|
||||
|
||||
public void setHailcap(Double hailcap) {
|
||||
this.hailcap = hailcap;
|
||||
}
|
||||
|
||||
/**
|
||||
* bias value of the ZR equation
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Double getBias() {
|
||||
return bias;
|
||||
}
|
||||
|
||||
public void setBias(Double bias) {
|
||||
this.bias = bias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a 2D GridGeometry to use for display
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public GridGeometry2D getGridGeometry() {
|
||||
ProjectedCRS crs = getCrs();
|
||||
|
||||
GridGeometry2D gridGeometry2D = null;
|
||||
|
||||
GeneralEnvelope generalEnvelope = new GeneralEnvelope(2);
|
||||
generalEnvelope.setCoordinateReferenceSystem(crs);
|
||||
|
||||
double maxExtent = (this.getDx() * (this.getNx() / 2));
|
||||
|
||||
generalEnvelope.setRange(0, -maxExtent, maxExtent);
|
||||
generalEnvelope.setRange(1, -maxExtent, maxExtent);
|
||||
|
||||
gridGeometry2D = new GridGeometry2D(new GeneralGridEnvelope(new int[] {
|
||||
0, 0 }, new int[] { this.getNx(), this.getNy() }, false),
|
||||
generalEnvelope);
|
||||
|
||||
return gridGeometry2D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data array from the store.
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void retrieveFromDataStore(IDataStore dataStore) {
|
||||
IDataRecord[] dataRec = null;
|
||||
try {
|
||||
dataRec = dataStore.retrieve(getDataURI());
|
||||
} catch (FileNotFoundException e1) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
||||
} catch (StorageException e1) {
|
||||
e1.printStackTrace();
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
||||
|
||||
}
|
||||
if (dataRec != null) {
|
||||
for (IDataRecord element : dataRec) {
|
||||
if (element.getName().equals("Data")) {
|
||||
setRawData(((ByteDataRecord) element).getByteData());
|
||||
} else if (element.getName().equals("Angles")) {
|
||||
setAngleData(((FloatDataRecord) element).getFloatData());
|
||||
} else if (element.getName().equals("DHRMap")) {
|
||||
try {
|
||||
ByteDataRecord byteData = (ByteDataRecord) element;
|
||||
Object o = DynamicSerializationManager.getManager(
|
||||
SerializationType.Thrift).deserialize(
|
||||
byteData.getByteData());
|
||||
setDhrMap((Map<DHRValues, Double>) o);
|
||||
} catch (SerializationException e) {
|
||||
e.printStackTrace();
|
||||
setDhrMap(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for debugging.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("Icao: " + getIcao() + "\n");
|
||||
sb.append("Field: " + getParameterName() + "\n");
|
||||
sb.append("Unit: " + getParameterUnit() + "\n");
|
||||
sb.append("dataTime: "
|
||||
+ getDataTime().getValidTime().getTime().toString() + "\n");
|
||||
sb.append("Nx: " + getNx() + "\n");
|
||||
sb.append("Ny: " + getNy() + "\n");
|
||||
sb.append("Dx: " + getDx() + "\n");
|
||||
sb.append("Dy: " + getDy() + "\n");
|
||||
sb.append("lat: " + getLatitude() + "\n");
|
||||
sb.append("lon: " + getLongitude() + "\n");
|
||||
sb.append("CRS: " + getCrs().toWKT() + "\n");
|
||||
sb.append("WFO: " + getLocation().getWfoId() + "\n");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the actual string text for the name
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getParameterName() {
|
||||
return "preciprate";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the actual string text for the unit
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getParameterUnit() {
|
||||
return "in/hr";
|
||||
}
|
||||
|
||||
public Map<DHRValues, Double> getDhrMap() {
|
||||
return dhrMap;
|
||||
}
|
||||
|
||||
public void setDhrMap(Map<DHRValues, Double> dhrMap) {
|
||||
this.dhrMap = dhrMap;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.common.monitor.processing.IMonitorProcessing#getDataArray
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public float[] getDataArray() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the gateResolution
|
||||
*/
|
||||
public Integer getGateResolution() {
|
||||
return gateResolution;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param gateResolution
|
||||
* the gateResolution to set
|
||||
*/
|
||||
public void setGateResolution(Integer gateResolution) {
|
||||
this.gateResolution = gateResolution;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the icao
|
||||
*/
|
||||
public String getIcao() {
|
||||
return icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param icao
|
||||
* the icao to set
|
||||
*/
|
||||
public void setIcao(String icao) {
|
||||
this.icao = icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the latitude
|
||||
*/
|
||||
public Float getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param latitude
|
||||
* the latitude to set
|
||||
*/
|
||||
public void setLatitude(Float latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the longitude
|
||||
*/
|
||||
public Float getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param longitude
|
||||
* the longitude to set
|
||||
*/
|
||||
public void setLongitude(Float longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the numRadials
|
||||
*/
|
||||
public Integer getNumRadials() {
|
||||
return numRadials;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numRadials
|
||||
* the numRadials to set
|
||||
*/
|
||||
public void setNumRadials(Integer numRadials) {
|
||||
this.numRadials = numRadials;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the numBins
|
||||
*/
|
||||
public Integer getNumBins() {
|
||||
return numBins;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numBins
|
||||
* the numBins to set
|
||||
*/
|
||||
public void setNumBins(Integer numBins) {
|
||||
this.numBins = numBins;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the mnemonic
|
||||
*/
|
||||
public String getMnemonic() {
|
||||
return mnemonic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mnemonic
|
||||
* the mnemonic to set
|
||||
*/
|
||||
public void setMnemonic(String mnemonic) {
|
||||
this.mnemonic = mnemonic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the volumeCoveragePattern
|
||||
*/
|
||||
public Integer getVolumeCoveragePattern() {
|
||||
return volumeCoveragePattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param volumeCoveragePattern
|
||||
* the volumeCoveragePattern to set
|
||||
*/
|
||||
public void setVolumeCoveragePattern(Integer volumeCoveragePattern) {
|
||||
this.volumeCoveragePattern = volumeCoveragePattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the location
|
||||
*/
|
||||
public RadarStation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param location
|
||||
* the location to set
|
||||
*/
|
||||
public void setLocation(RadarStation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rawData
|
||||
*/
|
||||
public byte[] getRawData() {
|
||||
return rawData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rawData
|
||||
* the rawData to set
|
||||
*/
|
||||
public void setRawData(byte[] rawData) {
|
||||
this.rawData = rawData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the angleData
|
||||
*/
|
||||
public float[] getAngleData() {
|
||||
return angleData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param angleData
|
||||
* the angleData to set
|
||||
*/
|
||||
public void setAngleData(float[] angleData) {
|
||||
this.angleData = angleData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the crs
|
||||
*/
|
||||
public ProjectedCRS getCrs() {
|
||||
return MapUtil.constructStereographic(MapUtil.AWIPS_EARTH_RADIUS,
|
||||
MapUtil.AWIPS_EARTH_RADIUS, getLatitude(), getLongitude());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param crs
|
||||
* the crs to set
|
||||
*/
|
||||
public void setCrs(ProjectedCRS crs) {
|
||||
this.crs = crs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "preciprate";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an incremental override file, indicating that the files
|
||||
at different localization levels will be combined.
|
||||
-->
|
||||
<styleRuleset>
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>preciprate</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>in/hr</displayUnits>
|
||||
<defaultColormap>Radar/OSF/16 Level Reflectivity</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry sample='NO DATA' pixelValue="0" label='' />
|
||||
<entry displayValue="0.0" pixelValue="16" label='0.0' />
|
||||
<entry displayValue='0.1' pixelValue='32' />
|
||||
<entry displayValue='0.2' pixelValue='48' />
|
||||
<entry displayValue='0.4' pixelValue='64' />
|
||||
<entry displayValue='0.6' pixelValue='80' />
|
||||
<entry displayValue='0.8' pixelValue='96' />
|
||||
<entry displayValue='1.0' pixelValue='112' />
|
||||
<entry displayValue='1.25' pixelValue='118' />
|
||||
<entry displayValue='1.5' pixelValue='144' />
|
||||
<entry displayValue='1.75' pixelValue='160' />
|
||||
<entry displayValue='2.0' pixelValue='176' />
|
||||
<entry displayValue='3.0' pixelValue='192' />
|
||||
<entry displayValue='4.0' pixelValue='208' />
|
||||
<entry displayValue='5.0' pixelValue='223' />
|
||||
<entry displayValue='6.0' pixelValue='240' />
|
||||
<entry displayValue='9999.0' pixelValue='255' label='' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
</styleRuleset>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.qpf/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.qpf/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.qpf</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,15 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: QPF common Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.qpf
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.qpf
|
||||
Require-Bundle: javax.persistence;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.monitor;bundle-version="1.11.5",
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.datastorage
|
|
@ -0,0 +1,5 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
utility/,\
|
||||
.
|
|
@ -0,0 +1,570 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.qpf;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.PrimaryKeyJoinColumn;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.geotools.coverage.grid.GeneralGridEnvelope;
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.geotools.geometry.GeneralEnvelope;
|
||||
import org.hibernate.annotations.Index;
|
||||
import org.opengis.referencing.crs.ProjectedCRS;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialEnabled;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialObject;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.monitor.processing.IMonitorProcessing;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* Record implementation for QPF plugin
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 24, 2009 2027 D. Hladky Initial release
|
||||
* Apr 27, 2012 562 dgilling Rename getters/setters to match Java
|
||||
* conventions.
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "qpfseq")
|
||||
@Table(name = "qpf", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "qpf", indexes = { @Index(name = "qpf_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
public class QPFRecord extends PersistablePluginDataObject implements
|
||||
ISpatialEnabled, IMonitorProcessing {
|
||||
|
||||
private static final long serialVersionUID = 767763365671L;
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
private String icao;
|
||||
|
||||
@Column(length = 30)
|
||||
@DataURI(position = 2)
|
||||
@DynamicSerializeElement
|
||||
private String fieldName;
|
||||
|
||||
@ManyToOne
|
||||
@PrimaryKeyJoinColumn
|
||||
@DynamicSerializeElement
|
||||
private RadarStation spatialInfo;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer nx = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer ny = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer dx = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Integer dy = 0;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Float nsvelocity = 0.0f;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Float ewvelocity = 0.0f;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Float avgdir = 0.0f;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Float avgspd = 0.0f;
|
||||
|
||||
@Transient
|
||||
private float[] data_array = null;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public QPFRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a record from a dataURI
|
||||
*
|
||||
* @param uri
|
||||
* The dataURI
|
||||
* @param tableDef
|
||||
* The table definition associated with this class
|
||||
*/
|
||||
public QPFRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the fieldNames for QPF
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 20, 2009 dhladky Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum DATA_TYPE {
|
||||
P10("QPF .10 1hr probability"), P25("QPF .25 1hr probability"), P50(
|
||||
"QPF .50 1hr probability"), P75("QPF .75 1hr probability"), PRECIP_AMT(
|
||||
"QPF 1hr categorical rain fcst."), AV_VIL(
|
||||
"SCAN 1hr average VIL");
|
||||
|
||||
private final String fieldName;
|
||||
|
||||
private DATA_TYPE(String name) {
|
||||
fieldName = name;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Enumeration of the fieldUNits for QPF
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 20, 2009 dhladky Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum UNIT_TYPE {
|
||||
P10("%"), P25("%"), P50("%"), P75("%"), PRECIP_AMT("in"), AV_VIL("");
|
||||
|
||||
private final String fieldUnit;
|
||||
|
||||
private UNIT_TYPE(String unit) {
|
||||
fieldUnit = unit;
|
||||
}
|
||||
|
||||
public String getFieldUnit() {
|
||||
return fieldUnit;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the icao
|
||||
*
|
||||
* @param icao
|
||||
*/
|
||||
public void setIcao(String icao) {
|
||||
this.icao = icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the icao
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getIcao() {
|
||||
return icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fieldName
|
||||
*
|
||||
* @param fieldName
|
||||
*/
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the fieldName
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* set NX
|
||||
*
|
||||
* @param nx
|
||||
*/
|
||||
public void setNx(Integer nx) {
|
||||
this.nx = nx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get NX
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer getNx() {
|
||||
return nx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the NY
|
||||
*
|
||||
* @param ny
|
||||
*/
|
||||
public void setNy(Integer ny) {
|
||||
this.ny = ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the NY
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer getNy() {
|
||||
return ny;
|
||||
}
|
||||
|
||||
/**
|
||||
* set DX in meters
|
||||
*
|
||||
* @param dx
|
||||
*/
|
||||
public void setDx(Integer dx) {
|
||||
this.dx = dx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DX in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getDx() {
|
||||
return dx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the DY, in meters
|
||||
*
|
||||
* @param dy
|
||||
*/
|
||||
public void setDy(Integer dy) {
|
||||
this.dy = dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the DY, in meters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getDy() {
|
||||
return dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the East West velocity, m/s (U)
|
||||
*
|
||||
* @param ew_velocity
|
||||
*/
|
||||
public void setEwvelocity(Float ewvelocity) {
|
||||
this.ewvelocity = ewvelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the EW velocity, in m/s (U)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Float getEwvelocity() {
|
||||
return ewvelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the North South velocity, m/s (V)
|
||||
*
|
||||
* @param ns_velocity
|
||||
*/
|
||||
public void setNsvelocity(Float nsvelocity) {
|
||||
this.nsvelocity = nsvelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the NS velocity, in m/s (V)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Float getNsvelocity() {
|
||||
return nsvelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the avg_spd, m/s
|
||||
*
|
||||
* @param avg_spd
|
||||
*/
|
||||
public void setAvgspd(Float avgspd) {
|
||||
this.avgspd = avgspd;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the avg_spd, in m/s
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Float getAvgspd() {
|
||||
return avgspd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the avg_dir, degrees
|
||||
*
|
||||
* @param avg_dir
|
||||
*/
|
||||
public void setAvgdir(Float avgdir) {
|
||||
this.avgdir = avgdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the avg_dir, in degrees
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Float getAvgdir() {
|
||||
return avgdir;
|
||||
}
|
||||
|
||||
public RadarStation getSpatialInfo() {
|
||||
return spatialInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set that spatial info object.
|
||||
*
|
||||
* @param spatialInfo
|
||||
*/
|
||||
public void setSpatialInfo(RadarStation spatialInfo) {
|
||||
this.spatialInfo = spatialInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
public void setDataArray(float[] data_array) {
|
||||
this.data_array = data_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data array
|
||||
*
|
||||
* @param data_array
|
||||
*/
|
||||
@Override
|
||||
public float[] getDataArray() {
|
||||
return data_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the projected CRS
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ProjectedCRS getCRS() {
|
||||
return MapUtil.constructStereographic(MapUtil.AWIPS_EARTH_RADIUS,
|
||||
MapUtil.AWIPS_EARTH_RADIUS, getSpatialInfo().getLat(),
|
||||
getSpatialInfo().getLon());
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a 2D GridGeometry to use for display
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public GridGeometry2D getGridGeometry() {
|
||||
ProjectedCRS crs = this.getCRS();
|
||||
|
||||
GridGeometry2D gridGeometry2D = null;
|
||||
|
||||
GeneralEnvelope generalEnvelope = new GeneralEnvelope(2);
|
||||
generalEnvelope.setCoordinateReferenceSystem(crs);
|
||||
|
||||
double maxExtent = (this.getDx() * (this.getNx() / 2));
|
||||
|
||||
generalEnvelope.setRange(0, -maxExtent, maxExtent);
|
||||
generalEnvelope.setRange(1, -maxExtent, maxExtent);
|
||||
|
||||
gridGeometry2D = new GridGeometry2D(new GeneralGridEnvelope(new int[] {
|
||||
0, 0 }, new int[] { this.getNx(), this.getNy() }, false),
|
||||
generalEnvelope);
|
||||
|
||||
return gridGeometry2D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data array from the store.
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
@Override
|
||||
public void retrieveFromDataStore(IDataStore dataStore) {
|
||||
|
||||
try {
|
||||
IDataRecord[] dataRec = dataStore.retrieve(getDataURI());
|
||||
for (IDataRecord element : dataRec) {
|
||||
if (element instanceof FloatDataRecord) {
|
||||
setDataArray(((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
}
|
||||
} catch (Exception se) {
|
||||
se.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for debugging.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("\n dataURI: " + getDataURI() + "\n");
|
||||
sb.append("data_array: " + getDataArray().length + "\n");
|
||||
sb.append("Icao: " + getIcao() + "\n");
|
||||
sb.append("Field: " + getParameterName() + "\n");
|
||||
sb.append("Unit: " + getParameterUnit() + "\n");
|
||||
sb.append("dataTime: "
|
||||
+ getDataTime().getValidTime().getTime().toString() + "\n");
|
||||
sb.append("PersistanceTime: " + getPersistenceTime().toString() + "\n");
|
||||
sb.append("Nx: " + getNx() + "\n");
|
||||
sb.append("Ny: " + getNy() + "\n");
|
||||
sb.append("Dx: " + getDx() + "\n");
|
||||
sb.append("Dy: " + getDy() + "\n");
|
||||
sb.append("lat: " + getSpatialInfo().getLat() + "\n");
|
||||
sb.append("lon: " + getSpatialInfo().getLon() + "\n");
|
||||
sb.append("CRS: " + getCRS().toWKT() + "\n");
|
||||
sb.append("WFO: " + getSpatialInfo().getWfoId() + "\n");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the actual string text for the name
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getParameterName() {
|
||||
String paramName = null;
|
||||
for (DATA_TYPE name : DATA_TYPE.values()) {
|
||||
if (getFieldName().equals(name.name())) {
|
||||
paramName = name.getFieldName();
|
||||
}
|
||||
}
|
||||
return paramName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the actual string text for the unit
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getParameterUnit() {
|
||||
String paramUnit = null;
|
||||
for (UNIT_TYPE name : UNIT_TYPE.values()) {
|
||||
if (getFieldName().equals(name.name())) {
|
||||
paramUnit = name.getFieldUnit();
|
||||
}
|
||||
}
|
||||
return paramUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpatialObject getSpatialObject() {
|
||||
return getSpatialInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "qpf";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,710 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.qpf;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.qpf.QPFRecord.DATA_TYPE;
|
||||
import com.raytheon.uf.common.monitor.scan.ScanUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* QPF Utilities, mostly static methods.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 02/11/2009 1981 dhladky Initial Creation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class QPFUtils {
|
||||
|
||||
public static int INS = 116; // Number of north-south grid points
|
||||
|
||||
public static int IWE = 116; // Number of east-west grid points
|
||||
|
||||
public static float GRDMAX = 80.0f;
|
||||
|
||||
public static float GRDMIN = 15.0f; // GRDMIN,GRDMAX: Min and max values of
|
||||
|
||||
// reflectivity taken to represent valid
|
||||
// precip echoes (15 & 80 dBZ)
|
||||
public static int JMIN = 11; // Minimum north-south coordinate to be used.
|
||||
|
||||
public static int JMAX = 103; // Maximum north-south coordinate to be used.
|
||||
|
||||
public static int IMIN = 11; // Minimum east-west coordinate to be used.
|
||||
|
||||
public static int IMAX = 103; // Maximum east-west coordinate to be used.
|
||||
|
||||
public static int JDISP1 = -10; // J-axis initial displacement
|
||||
|
||||
public static int JDISP2 = 10; // J-axis final displacement
|
||||
|
||||
public static int IDISP1 = -10; // I-axis initial displacement
|
||||
|
||||
public static int IDISP2 = 10; // I-axis final displacement
|
||||
|
||||
public static int JDINC = 1;
|
||||
|
||||
public static int IDINC = 1; // JDINC, IDINC: Grid-box increments used in
|
||||
|
||||
// searching
|
||||
|
||||
// for a displacement vector that yields the maximum
|
||||
// lag-correlation patern match .
|
||||
public static int IMNHIT = 25; // Minimum number of binary "hits" required
|
||||
|
||||
// to
|
||||
|
||||
// achieve a satisfactory pattern match.
|
||||
|
||||
public static float RMISS = 999.0f; // Missing value indicator for ztr data
|
||||
|
||||
public static int NTIMES = 5; // Number of radar images to be ingested for
|
||||
|
||||
// pattern matching (generally 5-6)
|
||||
public static int N_FCST = 7; // Number of images in extrapolation forecast
|
||||
|
||||
// sequence, starting at 0, 10-minute intervals
|
||||
// (generally 7 to cover 1 hour)
|
||||
|
||||
public static int MIN_STI_CELLS = 5; // Minimum number of STI cells required
|
||||
|
||||
// to
|
||||
|
||||
// used average cell speed for vector motion.
|
||||
public static int SECONDS_PER_HOUR = 3600;
|
||||
|
||||
public static int SECONDS_PER_MINUTE = 60;
|
||||
|
||||
public static int MINUTES_PER_HOUR = 60;
|
||||
|
||||
public static float BAD_Z = 100.0f; // Maximum "good" value in reflectivity
|
||||
|
||||
// field (float)
|
||||
|
||||
public static int IBAD_Z = 100; // Maximum "good" value in reflectivity
|
||||
|
||||
// field (int)
|
||||
|
||||
public static float BAD_VIL = 120.0f; // Maximum "good" value in VIL field
|
||||
|
||||
// (int)
|
||||
|
||||
// needed for passing into extrap??
|
||||
public static int IBAD_VIL = 120; // Maximum "good" value in VIL field (int)
|
||||
|
||||
// needed for passing into extrap??
|
||||
public static int MINUTE0 = 0; // Radar image number corresponding to
|
||||
|
||||
// initial time
|
||||
|
||||
// forecast.
|
||||
public static int MINUTE30 = 3; // Radar image number corresponding to
|
||||
|
||||
// 30-minute
|
||||
|
||||
// forecast
|
||||
public static int MISSING = -9999;
|
||||
|
||||
public static int MISS = 999;
|
||||
|
||||
public static int NCATR = 5; // Number of rainfall category levels.
|
||||
|
||||
public static float BINCOR_INITIAL = -99.0f; // Initial gridpoint values
|
||||
|
||||
// before binary correlation.
|
||||
|
||||
public static int NUMBER_OF_PRODUCTS = 5; // Number of QPF output products.
|
||||
|
||||
public static int FCST_TIME_INTERVAL = 10; // Minutes between forecast
|
||||
|
||||
// extrapolations.
|
||||
|
||||
public static float AVG_FCST_PARAM = (float) (1.0 / ((MINUTES_PER_HOUR / FCST_TIME_INTERVAL) + 1));
|
||||
|
||||
// Constant used to multiply summed TAV
|
||||
// values by inverse the number of forecasts.
|
||||
// (more efficient than dividing).
|
||||
public static int LOWPOINT = 52; // Low grid point for ground clutter filter
|
||||
|
||||
public static int HIGHPOINT = 63; // High grid point for ground clutter
|
||||
|
||||
// filter
|
||||
|
||||
public static int UPPER_LIMIT = 99;
|
||||
|
||||
/*
|
||||
* Written originally in Fortran (HP-UX) by David Kitzmiller, NWS-TDL
|
||||
* Translated into C++ by Mike Churma, RSIS @ TDL, Nov 1999
|
||||
*
|
||||
* Description: Calculates surface rain accumultion (1/100's inches) from a
|
||||
* time sequence of reflectivity images. Utilizes WSR-88D Z=300R1.4
|
||||
* relationship
|
||||
*
|
||||
* Variables ztr = Input forecast reflectivity grids in dBZ. irain = Output
|
||||
* Rainfall accumulation grid, in 1/100 inches iwork = Input work array
|
||||
* izmnt = Array of reference times (in minutes) corresponding to the ztr
|
||||
* reflectivity images. The first value may be 0, the second the elapsed
|
||||
* time between the 1st and 2nd images, etc. (input) itim1, itim2 = Rain
|
||||
* accumulation will be calculated between ztr images with temporal
|
||||
* dimension itim1 and itim2 inclusive. (input) index = Array index counter.
|
||||
* dbz = Holds an individual reflectivity value (for code clarity). timediff
|
||||
* = difference between izmnt times of two images. rrate = Rain rate. rrate1
|
||||
* = Rain rate at the beginning of the sub-period. rrate2 = Rain rate at the
|
||||
* end of the sub-period. IF ABS(ZTR()) .GE. RMISS, NO RAINFALL CALCULATED
|
||||
* FOR THAT GRID POINT
|
||||
*
|
||||
* Translated to Java 16Feb2009, D Hladky Raytheon
|
||||
*/
|
||||
|
||||
public static long[] zrrain(int[][] ztr, int[] iwork, int[] izmnt,
|
||||
int itim1, int itim2) {
|
||||
|
||||
long[] irain = new long[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
int index;
|
||||
int nt;
|
||||
float rain1;
|
||||
float rrate1;
|
||||
float rrate2;
|
||||
float dbz = 0.0f;
|
||||
float rrate = 0.0f;
|
||||
float z = 0.0f;
|
||||
float timediff;
|
||||
|
||||
// Calculate instantaneous rainrate at initial time.
|
||||
|
||||
for (index = 0; index < ScanUtils.SCAN_GRID_DIM_SQ; index++) {
|
||||
dbz = ztr[itim1][index];
|
||||
|
||||
// if the abs value of dbz is equal to or greater than the
|
||||
// missing indicator, then flag the rain value in that
|
||||
// grid box as missing and don't perform Z to R calculations.
|
||||
|
||||
if (Math.abs(dbz) >= RMISS) {
|
||||
// Put missing marker into accumulation array.
|
||||
irain[index] = MISSING;
|
||||
} else {
|
||||
rrate = 0.0f;
|
||||
if (dbz > 0) {
|
||||
z = (float) Math.pow(10.0, (0.1 * dbz));
|
||||
rrate = (float) Math.pow((z / 300.0), 0.71429);
|
||||
|
||||
// Convert rainrate from mm/hr to inches/minute * 10,000
|
||||
rrate = (float) ((rrate / 25.4) / 60.0);
|
||||
rrate *= 10000.0;
|
||||
}
|
||||
}
|
||||
iwork[index] = (int) (rrate + 0.5);
|
||||
}
|
||||
|
||||
// Calculate rain accumulations
|
||||
|
||||
for (nt = itim1 + 1; nt <= itim2; nt++) {
|
||||
timediff = izmnt[nt] - izmnt[nt - 1];
|
||||
|
||||
for (index = 0; index < ScanUtils.SCAN_GRID_DIM_SQ; index++) {
|
||||
if (irain[index] < -1)
|
||||
continue;
|
||||
|
||||
dbz = ztr[nt][index];
|
||||
|
||||
if (Math.abs(dbz) >= RMISS) {
|
||||
irain[index] = MISSING;
|
||||
continue;
|
||||
}
|
||||
|
||||
rrate = 0.0f;
|
||||
if (dbz > 0) {
|
||||
z = (float) Math.pow(10.0, (0.1 * dbz));
|
||||
rrate = (float) Math.pow((z / 300.0), 0.71429);
|
||||
|
||||
// Convert rainrate from mm/hr to inches/minute * 10,000
|
||||
rrate = (float) ((rrate / 25.4) / 60.0);
|
||||
rrate *= 10000.0;
|
||||
}
|
||||
|
||||
// Rainrate over the point is assumed to be mean of rates
|
||||
// at beginning and end of the subperiod.
|
||||
|
||||
rrate1 = iwork[index];
|
||||
rrate2 = rrate;
|
||||
iwork[index] = (int) (rrate + 0.5);
|
||||
rrate = (float) (0.5 * (rrate1 + rrate2));
|
||||
rain1 = timediff * rrate;
|
||||
irain[index] += (long) (rain1 + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index < ScanUtils.SCAN_GRID_DIM_SQ; index++) {
|
||||
if (irain[index] > -1)
|
||||
irain[index] = irain[index] / 100;
|
||||
if (irain[index] < -1)
|
||||
irain[index] = 32000;
|
||||
}
|
||||
|
||||
return irain;
|
||||
}
|
||||
|
||||
/*
|
||||
* Author: Dave Kitzmiller & Ator TDL Aug 1990 HPUX Update: Translated from
|
||||
* FORTRAN to C++ by M. Churma (RSIS @ TDL) Nov 1999
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Extrapolates elements in a 2D field (gridIn) using a constant
|
||||
* displacement vector (we_displ, rns_displ) and puts the result in and
|
||||
* output grid (gridOut).
|
||||
*
|
||||
* Variables: gridIn, gridOut = Input and output grids, dimensioned in the
|
||||
* calling routine. we_displ = Number of grids points in the West-East
|
||||
* direction to displace the gridIn field in order to get gridOut. (float).
|
||||
* rns_displ = Number of grids points in the North-South direction to
|
||||
* displace the gridIn field in order to get gridOut. (float).
|
||||
*
|
||||
* BADDT = MAXIMUM 'GOOD' VALUE IN PIN(), VALUES .GT. BADDT ARE ASSUMED TO
|
||||
* BE 'MISSING' (INPUT, REAL4) IBADDT = VALUE ASSIGNED TO 'MISSING' POINTS
|
||||
* IN POUT() (INPUT, INTEGER4) irow, icol = Grid row and column indices
|
||||
* (short). newrow, newcol = Grid row and column indices after displacement
|
||||
* from original coordinates (iow, icol). index = 1-D array counter for the
|
||||
* whole 116x116 field. newindex = 1-D array counter for displaced 116x116
|
||||
* field. rounderWE, rounderNS = Variables to allow rounding to the nearest
|
||||
* integer value, depending on the +/- sign of the floating point value to
|
||||
* be rounded.
|
||||
*
|
||||
* Translated to Java 16feb2009 D Hladky Raytheon
|
||||
*/
|
||||
|
||||
public static int[] extrap(int[] gridIn, float we_displ, float rns_displ) {
|
||||
int irow, icol, index;
|
||||
int newrow, newcol, newindex;
|
||||
float rounderWE, rounderNS;
|
||||
int[] gridOut = new int[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
|
||||
// First initialize the entire gridOut OUTPUT ARRAY TO ZEROES.
|
||||
|
||||
for (index = 0; index < gridOut.length; index++) {
|
||||
gridOut[index] = 0;
|
||||
}
|
||||
|
||||
if (rns_displ >= 0)
|
||||
rounderNS = (float) 0.5;
|
||||
else
|
||||
rounderNS = (float) -0.5;
|
||||
|
||||
if (we_displ >= 0)
|
||||
rounderWE = (float) 0.5;
|
||||
else
|
||||
rounderWE = (float) -0.5;
|
||||
|
||||
for (irow = 0; irow < INS; irow++) {
|
||||
for (icol = 0; icol < IWE; icol++) {
|
||||
index = IWE * irow + icol;
|
||||
|
||||
if (gridIn[index] != 0) {
|
||||
if (gridIn[index] <= BAD_Z) {
|
||||
// The "gridIn" array element contains a valid radar
|
||||
// echo
|
||||
// value to be displaced in the gridOut array.
|
||||
|
||||
newrow = irow + (int) (rns_displ + rounderNS);
|
||||
newcol = icol + (int) (we_displ + rounderWE);
|
||||
|
||||
if (((newrow >= 0) && (newrow < INS))
|
||||
&& ((newcol >= 0) && (newcol < IWE))) {
|
||||
newindex = (IWE * newrow) + newcol;
|
||||
|
||||
// The echo can be displaced within the array size
|
||||
// limits.
|
||||
// Make sure that an already existing bad radar
|
||||
// return value
|
||||
// will not be overwritten before shifting the echo
|
||||
// value.
|
||||
|
||||
if (gridOut[newindex] < IBAD_Z)
|
||||
gridOut[newindex] = gridIn[index];
|
||||
}
|
||||
} else {
|
||||
// The "gridIn" array element contains bad radar data,
|
||||
// so write
|
||||
// a bad data value in the corresponding pixel of
|
||||
// "gridOut".
|
||||
|
||||
gridOut[index] = IBAD_Z;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return gridOut;
|
||||
}
|
||||
|
||||
/*
|
||||
* Author: Dave Kitzmiller, TDL
|
||||
*
|
||||
* Description: Analyzes 0-1 hr rainfall amt probabilities using OK-KS-TX
|
||||
* warm season equations.
|
||||
*
|
||||
* Updates: Nov 28 1995 - Also have code for initial stage3-based equations.
|
||||
* - Kitzmiller
|
||||
*
|
||||
* Feb 27 1998 - Kitzmiller Added a routine 'cat_to_amt' to convert the
|
||||
* forecast rainfall category field (in which all grid boxes have values
|
||||
* 0-5) to a rainfall amount field, with values 0-75, IN .01 inches.
|
||||
*
|
||||
* Nov 1999 - Churma (RSIS @NWS-TDL) Translated from Fortran to C-C++
|
||||
*
|
||||
* Variables: vil60_max, vil_smth = Local 0-60 minute VIL maximum and
|
||||
* average. rain30_max, rain_smth = Local 0-30 minute rainfall maximum and
|
||||
* average. rain60_max, rain60_smth = Local 0-60 minute rainfall maximum and
|
||||
* average. irow, icol = Row and column loop counters irow0, icol0 =
|
||||
* Secondary row and column loop counters index = 1-D array counter. index0
|
||||
* = Secondary 1-D array counter.
|
||||
*
|
||||
* Statistical rainfall predictor fields:
|
||||
*
|
||||
* irain_0_30[], irain_0_60[] = Rainfall amount forecasts for 0-30 and 0-60
|
||||
* minutes, used as rainfall amount statistical predictors, dimensioned
|
||||
* IWE,INS. (input) vil_0_60[] = Mean VIL forecasted by extrapolation, 0-60
|
||||
* minutes, dimensioned IWE,INS (input) vilmax_time[] = Maximum VIL over
|
||||
* each grid box during 0-60 min period, forecasted by extrapolation (input)
|
||||
* maxvil_7x7() = Maximum initial time VIL, within 7x7 box region centered
|
||||
* on each grid box (input) n24dbz[] = Over 3x3-box region, number of grid
|
||||
* boxes and time periods in which reflectivity forecast exceeds 24 dBZ
|
||||
* during 0-60 minute period (input) nvil10_3x3() = Number of grid boxes in
|
||||
* 3x3-region with initial-time VIL >= 10 kg/m^2 (input)
|
||||
*
|
||||
* Output fields:
|
||||
*
|
||||
* p10[],p25[],p50[], p75[] = Probability of rainfall exceeding the 4 amount
|
||||
* thresholds described above %. Dimensioned IWE,INS. rain_cat[] = Rainfall
|
||||
* amount forecast derived from probabilities, in categories. Dimensioned
|
||||
* IWE,INS. precip_amt[] = Rainfall amount forecast, in .01 inch rainval[] =
|
||||
* Breakpoints of rainfall categories, in .01 inch, dimensioned NCATR
|
||||
*
|
||||
* Translated to JAVA 16Feb2009 D Hladky Raytheon
|
||||
*/
|
||||
public static HashMap<String, float[]> prob_fcst(long[] irain_0_30,
|
||||
long[] irain_0_60, float[] vil_0_60, int[] maxvil_7x7,
|
||||
int[] nvil10_3x3, int[] n24dbz) {
|
||||
|
||||
float rain60_smth;
|
||||
float rain60_max;
|
||||
float vil60_max;
|
||||
float vil_smth;
|
||||
float rain30_smth;
|
||||
float[] pwork = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
double p10x;
|
||||
double p25x;
|
||||
double p50x;
|
||||
double p75x;
|
||||
double rain_catx;
|
||||
float[] p10 = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
float[] p25 = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
float[] p50 = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
float[] p75 = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
float[] rain_cat = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
int irow;
|
||||
int icol;
|
||||
int irow0;
|
||||
int icol0;
|
||||
int index;
|
||||
int index0;
|
||||
|
||||
// Evaluate 4 probability equations at each grid box. Note
|
||||
// that the outermost rows and columns are not looped
|
||||
// through, because adjoining grid data is needed for the
|
||||
// calculations.
|
||||
|
||||
for (irow = 1; irow < INS - 1; irow++) {
|
||||
for (icol = 1; icol < IWE - 1; icol++) {
|
||||
index = IWE * irow + icol;
|
||||
|
||||
p10[index] = RMISS;
|
||||
p25[index] = RMISS;
|
||||
p50[index] = RMISS;
|
||||
p75[index] = RMISS;
|
||||
rain_cat[index] = MISS;
|
||||
|
||||
// Look to see if 900 can be replaced by a definition (it's
|
||||
// looking for a missing value)
|
||||
if (irain_0_60[index] <= 900) {
|
||||
// Form local averages and local maxima for predictors.
|
||||
|
||||
rain60_smth = 0;
|
||||
rain60_max = 0;
|
||||
vil60_max = 0;
|
||||
vil_smth = 0;
|
||||
rain30_smth = 0;
|
||||
|
||||
for (irow0 = irow - 1; irow0 <= irow + 1; irow0++) {
|
||||
for (icol0 = icol - 1; icol0 <= icol + 1; icol0++) {
|
||||
index0 = (IWE * irow0) + icol0;
|
||||
|
||||
rain60_smth += irain_0_60[index0];
|
||||
rain30_smth += irain_0_30[index0];
|
||||
vil_smth += vil_0_60[index0];
|
||||
|
||||
if (irain_0_60[index0] > rain60_max)
|
||||
rain60_max = irain_0_60[index0];
|
||||
if (vil_0_60[index0] > vil60_max)
|
||||
vil60_max = vil_0_60[index0];
|
||||
}
|
||||
}
|
||||
|
||||
rain60_smth /= 9.0;
|
||||
vil_smth /= 9.0;
|
||||
rain30_smth /= 9.0;
|
||||
|
||||
// Final Stage3-based equations - 22Mar+16Apr 1996 -
|
||||
// Kitzmiller
|
||||
|
||||
p10x = 0.412 + 3.517 * vil_smth + 0.980 * n24dbz[index]
|
||||
+ 0.704 * maxvil_7x7[index];
|
||||
|
||||
p25x = -0.331 + 2.701 * vil_smth + 0.356 * rain30_smth
|
||||
+ 0.469 * maxvil_7x7[index] + 0.230 * n24dbz[index];
|
||||
|
||||
p50x = 0.144 + 2.074 * vil_smth + 0.249 * rain30_smth;
|
||||
p75x = 0.112 + 1.125 * vil_smth + 1.905 * nvil10_3x3[index];
|
||||
|
||||
if (p10x < 0.0)
|
||||
p10x = 0.0;
|
||||
else if (p10x > 99.0)
|
||||
p10x = 99.0;
|
||||
|
||||
if (p25x < 0.0)
|
||||
p25x = 0.0;
|
||||
else if (p25x > 99.0)
|
||||
p25x = 99.0;
|
||||
|
||||
if (p50x < 0.0)
|
||||
p50x = 0.0;
|
||||
else if (p50x > 99.0)
|
||||
p50x = 99.0;
|
||||
|
||||
if (p75x < 0.0)
|
||||
p75x = 0.0;
|
||||
else if (p75x > 99.0)
|
||||
p75x = 99.0;
|
||||
|
||||
p10[index] = (float) p10x;
|
||||
p25[index] = (float) p25x;
|
||||
p50[index] = (float) p50x;
|
||||
p75[index] = (float) p75x;
|
||||
|
||||
// Probability-to-categorical conversions developed Feb
|
||||
// 1998.
|
||||
// Added threshold for .01 inch precip categorical fcst, Oct
|
||||
// 1996
|
||||
// (Kitzmiller)
|
||||
|
||||
rain_catx = 0.0;
|
||||
|
||||
if (p10x >= 7.0)
|
||||
rain_catx = 1.0;
|
||||
if (p10x >= 33.0)
|
||||
rain_catx = 2.0;
|
||||
if ((rain_catx >= 2.0) && (p25x >= 30.0))
|
||||
rain_catx = 3.0;
|
||||
if ((rain_catx >= 3.0) && (p50x >= 22.0))
|
||||
rain_catx = 4.0;
|
||||
if ((rain_catx >= 4.0) && (p75x >= 14.0))
|
||||
rain_catx = 5.0;
|
||||
|
||||
// Assign float cat value to the short array.
|
||||
|
||||
rain_cat[index] = (int) rain_catx;
|
||||
|
||||
} // End of if statement.
|
||||
} // End of icol loop.
|
||||
|
||||
} // End of irow loop.
|
||||
|
||||
HashMap<String, float[]> floats = new HashMap<String, float[]>();
|
||||
floats.put(DATA_TYPE.PRECIP_AMT.name(), cat_to_amt(rain_cat, pwork));
|
||||
floats.put("RAIN_CAT", rain_cat);
|
||||
floats.put(DATA_TYPE.P10.name(), p10);
|
||||
floats.put(DATA_TYPE.P25.name(), p25);
|
||||
floats.put(DATA_TYPE.P50.name(), p50);
|
||||
floats.put(DATA_TYPE.P75.name(), p75);
|
||||
|
||||
return floats;
|
||||
}
|
||||
|
||||
/*
|
||||
* Author: Dave Kitzmiller TDL Feb 1998 HPUX Update: Translated from FORTRAN
|
||||
* to C++ by M. Churma (RSIS @ TDL) Nov 1999
|
||||
*
|
||||
* Additional changes: Removed boundary initialization andsecondary
|
||||
* smoothing; changed smoothing loop to fix "holes" in precip data. - Churma
|
||||
* & Kitzmiller, MDL, July 2001.
|
||||
*
|
||||
* Description: Creates a precipitation amount field from a gridded precip
|
||||
* category field, by assuming that boundaries between category amounts
|
||||
* correspond to isohyets. Precip values greater than zero between the
|
||||
* isohyets are derived by interpolation through a Cressman-type scheme.
|
||||
*
|
||||
* Variables: rain_cat = Input category field (values 0 to NCATR)
|
||||
* dimensioned IWE INS in calling routine. precip_amt = Output precip amount
|
||||
* field, dimensioned IWE INS in calling routine pwork = Input float array,
|
||||
* dimensioned IWE INS.
|
||||
*
|
||||
* rainval = Float vector containing the lowest rainfall amount in within
|
||||
* each of the NCAT categories, in hundredths of an inch. irow, icol, irow0,
|
||||
* icol0 = Row & column counters (short) index = array counter for the whole
|
||||
* 116x116 field. dist = Gridpoint displacement distance (short) wgt =
|
||||
* Weighted distance sum = Sum of weighted precip values. wgtsum = Sum of
|
||||
* weighting values. irad = Calculation counter npt = Calculation counter
|
||||
*/
|
||||
public static float[] cat_to_amt(float rain_cat[], float pwork[]) {
|
||||
int irow;
|
||||
int icol;
|
||||
int irow0;
|
||||
int icol0;
|
||||
int npt;
|
||||
int irad;
|
||||
int i1;
|
||||
int j1;
|
||||
int i2;
|
||||
int j2;
|
||||
int index;
|
||||
float[] rainval = new float[NCATR];
|
||||
float dist;
|
||||
float wgt;
|
||||
float sum;
|
||||
float wgtsum;
|
||||
float[] precip_amt = new float[ScanUtils.SCAN_GRID_DIM_SQ];
|
||||
|
||||
// Initialize rainfall value array. Values are in hundredths of an inch.
|
||||
rainval[0] = 5.0f;
|
||||
rainval[1] = 18.0f;
|
||||
rainval[2] = 38.0f;
|
||||
rainval[3] = 63.0f;
|
||||
rainval[4] = 75.0f;
|
||||
|
||||
// Initialize the output array.
|
||||
|
||||
for (index = 0; index < ScanUtils.SCAN_GRID_DIM_SQ; index++) {
|
||||
precip_amt[index] = 0.0f;
|
||||
int icat = (int) rain_cat[index];
|
||||
|
||||
// Check boundaries
|
||||
if (icat < 1) {
|
||||
continue;
|
||||
}
|
||||
if (icat > NCATR) {
|
||||
icat = NCATR;
|
||||
}
|
||||
// icat - 1 used because C array starts at 0.
|
||||
precip_amt[index] = rainval[icat - 1];
|
||||
}
|
||||
|
||||
// Get smoothed field in pwork[], leaving 0-category values at
|
||||
// 0 precip amount. Smoothing radius is set a 2 grid boxes,
|
||||
// which has worked well.
|
||||
|
||||
for (irow = 0; irow < INS; irow++) {
|
||||
for (icol = 0; icol < IWE; icol++) {
|
||||
index = (INS * irow) + icol;
|
||||
if (precip_amt[index] <= 0) {
|
||||
pwork[index] = precip_amt[index];
|
||||
} else {
|
||||
irad = 2;
|
||||
do {
|
||||
j1 = irow - irad;
|
||||
j2 = irow + irad;
|
||||
|
||||
// Check boundaries
|
||||
|
||||
if (j1 < 0) {
|
||||
j1 = 0;
|
||||
}
|
||||
if (j2 > INS - 1) {
|
||||
j2 = INS - 1;
|
||||
}
|
||||
|
||||
i1 = icol - irad;
|
||||
i2 = icol + irad;
|
||||
|
||||
// Check boundaries
|
||||
|
||||
if (i1 < 0) {
|
||||
i1 = 0;
|
||||
}
|
||||
if (i2 > IWE - 1) {
|
||||
i2 = IWE - 1;
|
||||
}
|
||||
|
||||
sum = 0;
|
||||
wgtsum = 0;
|
||||
npt = 0;
|
||||
|
||||
for (irow0 = j1; irow0 <= j2; irow0++) {
|
||||
for (icol0 = i1; icol0 <= i2; icol0++) {
|
||||
dist = ((icol0 - icol) * (icol0 - icol))
|
||||
+ ((irow0 - irow) * (irow0 - irow));
|
||||
if (dist > 0.0) {
|
||||
wgt = (float) (1.0 / dist);
|
||||
} else {
|
||||
wgt = 1.0f;
|
||||
}
|
||||
|
||||
sum = sum + wgt
|
||||
* precip_amt[(INS * irow0) + icol0];
|
||||
wgtsum += wgt;
|
||||
npt++;
|
||||
}
|
||||
}
|
||||
if (npt < 2) {
|
||||
++irad;
|
||||
}
|
||||
} while (npt < 2 && irad <= 50);
|
||||
|
||||
// wgtsum should never be able to equal 0, but check just in
|
||||
// case.
|
||||
|
||||
if (wgtsum != 0) {
|
||||
pwork[index] = sum / wgtsum;
|
||||
} else {
|
||||
pwork[index] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Assign smoothed pwork values to output array.
|
||||
for (index = 0; index < ScanUtils.SCAN_GRID_DIM_SQ; index++) {
|
||||
if (precip_amt[index] != 0.0f) {
|
||||
precip_amt[index] = (float) (pwork[index] * 0.01);
|
||||
}
|
||||
}
|
||||
|
||||
return precip_amt;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
<?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.
|
||||
-->
|
||||
<!--
|
||||
This is an incremental override file, indicating that the files
|
||||
at different localization levels will be combined.
|
||||
-->
|
||||
<styleRuleset>
|
||||
<!-- QPF % probability of rainfall 1hr -->
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>QPF .10 1hr probability</parameter>
|
||||
<parameter>QPF .25 1hr probability</parameter>
|
||||
<parameter>QPF .50 1hr probability</parameter>
|
||||
<parameter>QPF .75 1hr probability</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits>%</displayUnits>
|
||||
<contourLabeling>
|
||||
<values>10 20 30 40 50 60 70 80 90 100</values>
|
||||
</contourLabeling>
|
||||
</contourStyle>
|
||||
</styleRule>
|
||||
<!-- QPF 1hr categorical forecast -->
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>QPF 1hr categorical rain fcst.</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits>in</displayUnits>
|
||||
<contourLabeling>
|
||||
<values>0.1 0.2 0.3 0.4 0.5 0.6 0.7</values>
|
||||
</contourLabeling>
|
||||
</contourStyle>
|
||||
</styleRule>
|
||||
</styleRuleset>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.dataplugin.scan/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.dataplugin.scan/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.scan</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,23 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: QPF common Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.scan
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.scan,
|
||||
com.raytheon.uf.common.dataplugin.scan.data
|
||||
Require-Bundle: javax.persistence;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.monitor,
|
||||
com.raytheon.uf.common.dataplugin.binlightning,
|
||||
com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.common.sounding,
|
||||
com.raytheon.uf.common.dataplugin.radar,
|
||||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.datastorage
|
||||
Import-Package: com.raytheon.uf.common.time,
|
||||
org.apache.commons.logging
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
utility/,\
|
||||
.
|
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.scan;
|
||||
|
||||
/**
|
||||
* Exception specific to SCAN
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 24, 2014 njensen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ScanException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*
|
||||
*/
|
||||
public ScanException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
*/
|
||||
public ScanException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* @param cause
|
||||
*/
|
||||
public ScanException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cause
|
||||
*/
|
||||
public ScanException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,395 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.scan;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.scan.data.ModelData;
|
||||
import com.raytheon.uf.common.dataplugin.scan.data.ScanTableData;
|
||||
import com.raytheon.uf.common.dataplugin.scan.data.SoundingData;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
|
||||
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* Rehash of SCAN
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 17, 2010 2521 D. Hladky Initial release
|
||||
* Feb 01, 2013 1649 D. Hladky better logging,
|
||||
* Feb 28, 2013 1731 bsteffen Optimize construction of scan resource.
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 08, 2013 1293 bkowal Removed references to hdffileid.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 06, 2013 2228 njensen Use deserialize(byte[])
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "scanseq")
|
||||
@Table(name = "scan", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "scan", indexes = { @Index(name = "scan_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
public class ScanRecord extends PersistablePluginDataObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5983810116816447875L;
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ScanRecord.class);
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
private String icao;
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 2)
|
||||
@DynamicSerializeElement
|
||||
private String type;
|
||||
|
||||
@Column(length = 7)
|
||||
@DataURI(position = 3)
|
||||
@DynamicSerializeElement
|
||||
private double tilt;
|
||||
|
||||
@Transient
|
||||
public GridGeometry2D stationGeometry = null;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
public Date volScanTime = null;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private boolean lastElevationAngle;
|
||||
|
||||
/** table data **/
|
||||
@Transient
|
||||
public ScanTableData<?> tableData = null;
|
||||
|
||||
@Transient
|
||||
/* cell data only */
|
||||
public SoundingData sd = null;
|
||||
|
||||
@Transient
|
||||
/* cell data only */
|
||||
public ModelData md = null;
|
||||
|
||||
public ScanRecord() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ScanRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type of Table
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/** Set the table type saved */
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the radar station ICAO
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getIcao() {
|
||||
return icao;
|
||||
}
|
||||
|
||||
public void setIcao(String icao) {
|
||||
this.icao = icao;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a String from the TABLE enum for which table data to grab
|
||||
*/
|
||||
public ScanTableData<?> getTableData() {
|
||||
return tableData;
|
||||
}
|
||||
|
||||
public void setTableData(ScanTableData<?> table) {
|
||||
this.tableData = table;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Keys for my table
|
||||
*
|
||||
* @param type
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
public Set<String> getTableKeys(ScanTables type) {
|
||||
Set<String> keySet = null;
|
||||
try {
|
||||
ScanTableData<?> table = getTableData();
|
||||
keySet = table.getTableData().keySet();
|
||||
} catch (NullPointerException npe) {
|
||||
return null;
|
||||
}
|
||||
return keySet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Sounding Data
|
||||
*
|
||||
* @param ed
|
||||
*/
|
||||
public void setSoundingData(SoundingData sd) {
|
||||
this.sd = sd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the SoundingData
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public SoundingData getSoundingData() {
|
||||
return sd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Model Data
|
||||
*
|
||||
* @param md
|
||||
*/
|
||||
public void setModelData(ModelData md) {
|
||||
this.md = md;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ModelData
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ModelData getModelData() {
|
||||
return md;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Model Data
|
||||
*
|
||||
* @param md
|
||||
*/
|
||||
public void setTilt(double tilt) {
|
||||
this.tilt = tilt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ModelData
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getTilt() {
|
||||
return tilt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the station Geometry for the WFO
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public GridGeometry2D getStationGeometry() {
|
||||
return stationGeometry;
|
||||
}
|
||||
|
||||
public void setStationGeometry(GridGeometry2D stationGeometry) {
|
||||
this.stationGeometry = stationGeometry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the TableData from the serialized form that is stored in hdf5.
|
||||
*
|
||||
* @param byteData
|
||||
* @throws SerializationException
|
||||
*/
|
||||
public void setTableData(ByteDataRecord byteData)
|
||||
throws SerializationException {
|
||||
Object o = DynamicSerializationManager.getManager(
|
||||
SerializationType.Thrift).deserialize(byteData.getByteData());
|
||||
setTableData((ScanTableData<?>) o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Hash out of the datastore by HUC
|
||||
*
|
||||
* @param dataStore
|
||||
* @param huc
|
||||
*/
|
||||
public void retrieveMapFromDataStore(IDataStore dataStore) {
|
||||
try {
|
||||
ByteDataRecord byteData = (ByteDataRecord) dataStore.retrieve(
|
||||
getDataURI(), getType(), Request.ALL);
|
||||
setTableData(byteData);
|
||||
} catch (Throwable e) {
|
||||
statusHandler.handle(Priority.ERROR, "Couldn't load Table data!"
|
||||
+ getDataURI());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Sounding Data available in this record
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
public void retrieveSoundingDataFromDataStore(IDataStore dataStore) {
|
||||
try {
|
||||
ByteDataRecord byteData = (ByteDataRecord) dataStore.retrieve(
|
||||
getDataURI(), getType() + "/sounding", Request.ALL);
|
||||
Object o = DynamicSerializationManager.getManager(
|
||||
SerializationType.Thrift).deserialize(
|
||||
byteData.getByteData());
|
||||
setSoundingData((SoundingData) o);
|
||||
} catch (Throwable e) {
|
||||
statusHandler.handle(Priority.ERROR, "Couldn't load Sounding data!"
|
||||
+ getDataURI());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Sounding Data available in this record
|
||||
*
|
||||
* @param dataStore
|
||||
*/
|
||||
public void retrieveModelDataFromDataStore(IDataStore dataStore) {
|
||||
try {
|
||||
ByteDataRecord byteData = (ByteDataRecord) dataStore.retrieve(
|
||||
getDataURI(), getType() + "/model", Request.ALL);
|
||||
Object o = DynamicSerializationManager.getManager(
|
||||
SerializationType.Thrift).deserialize(
|
||||
byteData.getByteData());
|
||||
setModelData((ModelData) o);
|
||||
} catch (Throwable e) {
|
||||
statusHandler.handle(Priority.ERROR, "Couldn't load Model data!"
|
||||
+ getDataURI());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the volume scan time
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getVolScanTime() {
|
||||
return volScanTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the volume scan time
|
||||
*
|
||||
* @param volScanTime
|
||||
*/
|
||||
public void setVolScanTime(Date volScanTime) {
|
||||
this.volScanTime = volScanTime;
|
||||
}
|
||||
|
||||
public boolean isLastElevationAngle() {
|
||||
return lastElevationAngle;
|
||||
}
|
||||
|
||||
public void setLastElevationAngle(boolean lastElevationAngle) {
|
||||
this.lastElevationAngle = lastElevationAngle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for debugging.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("\n dataURI: " + getDataURI() + "\n");
|
||||
if (tableData != null) {
|
||||
for (Object key : tableData.getTableData().keySet()) {
|
||||
sb.append(key + " : "
|
||||
+ tableData.getTableData().get(key).toString() + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "scan";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.raytheon.uf.common.dataplugin.scan.data;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
||||
/**
|
||||
*
|
||||
* Cell Table Data.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 05/11/2009 1981 dhladky Initial Creation.
|
||||
* 02/01/13 1569 D. Hladky removed XML where not needed
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@DynamicSerialize
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public class CellTableData<T extends ScanTableDataRow> extends ScanTableData {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CellTableData() {
|
||||
tableName = ScanTables.CELL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureThresholds() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScanTableData copyMap(ScanTableData table) {
|
||||
for (Object id : getTableData().keySet()) {
|
||||
CellTableDataRow row = (CellTableDataRow) getTableData().get(id);
|
||||
table.addRow((String) id, row.copy());
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScanTableData copy() {
|
||||
CellTableData table = new CellTableData();
|
||||
table.setTrueAngle(this.getTrueAngle());
|
||||
table.setVolScanTime(this.getVolScanTime());
|
||||
table.setFeatureIds(this.getFeatureIds());
|
||||
return (CellTableData) copyMap(table);
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue