remove ohd, hydro, dat features and plugins

This commit is contained in:
mjames-upc 2017-09-19 12:33:48 -06:00
parent 65156ef841
commit 1ef135705a
2528 changed files with 47 additions and 417575 deletions

View file

@ -1,50 +0,0 @@
<?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.
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor" currentAnimationMode="Temporal">
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="densityCapability" density="99999.0"/>
</capabilities>
</loadProperties>
<properties isSystemResource="false" isBlinking="false"
isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData" plotSource="${legend}"
plotModelFile="${svg}"
retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<binOffset posOffset="${posOffset}" negOffset="${negOffset}" virtualOffset="0"/>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="mping" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -1,53 +0,0 @@
<?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.
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor" currentAnimationMode="Temporal">
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="densityCapability" density="99999.0"/>
</capabilities>
</loadProperties>
<properties isSystemResource="false" isBlinking="false"
isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData" plotSource="${legend}"
plotModelFile="${svg}"
retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<binOffset posOffset="${posOffset}" negOffset="${negOffset}" virtualOffset="0"/>
<metadataMap>
<mapping key="category">
<constraint constraintValue="${category}" constraintType="EQUALS" />
</mapping>
<mapping key="pluginName">
<constraint constraintValue="mping" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -1,191 +0,0 @@
<?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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="mPING">
<contribute xsi:type="titleItem"
titleText="------ mPING 5 Minute Plots ------" id="MpingLine"/>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotAll.xml"
menuText="mPING Plot All" id="MpingPlotAll">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING All 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Rain/Snow" id="MpingPlotRainSnow">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Rain/Snow 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Rain/Snow"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Hail" id="MpingPlotHail">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Hail 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Hail"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Wind Damage" id="MpingPlotWindDamage">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Wind Damage 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Wind Damage"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Tornado" id="MpingPlotTornado">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Tornado 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Tornado"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Flood" id="MpingPlotFlood">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Flood 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Flood"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Mudslide" id="MpingPlotMudslide">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Mudslide 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Mudslide"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Reduced Visibility" id="MpingPlotReducedVisibility">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Reduced Visibility 5min"/>
<substitute key="posOffset" value="0"/>
<substitute key="negOffset" value="300"/>
<substitute key="category" value="Reduced Visibility"/>
</contribute>
<contribute xsi:type="titleItem"
titleText="------ mPING 30 Minute Plots ------" id="MpingLine"/>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotAll.xml"
menuText="mPING Plot All" id="MpingPlotAll">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING All 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Rain/Snow" id="MpingPlotRainSnow">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Rain/Snow 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Rain/Snow"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Hail" id="MpingPlotHail">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Hail 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Hail"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Wind Damage" id="MpingPlotWindDamage">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Wind Damage 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Wind Damage"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Tornado" id="MpingPlotTornado">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Tornado 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Tornado"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Flood" id="MpingPlotFlood">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Flood 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Flood"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Mudslide" id="MpingPlotMudslide">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Mudslide 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Mudslide"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/mping/MpingPlotCategory.xml"
menuText="Reduced Visibility" id="MpingPlotReducedVisibility">
<substitute key="svg" value="mpingPlotDesign.svg"/>
<substitute key="legend" value="mPING Reduced Visibility 30min"/>
<substitute key="posOffset" value="300"/>
<substitute key="negOffset" value="1500"/>
<substitute key="category" value="Reduced Visibility"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -1,24 +0,0 @@
<?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.
-->
<menuContributionFile>
<include installTo="menu:obs?before=CollectionDissemSep"
fileName="menus/mping/baseMPing.xml"/>
</menuContributionFile>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 32 KiB

View file

@ -1,97 +0,0 @@
<?xml version="1.0"?>
<svg width="80" height="80"
viewBox="0 0 80 80"
overflow="visible"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
<defs>
<script type="text/python" plotDelegate="plotDelegate">
import datetime
class MpingPlotDelegate(PlotDelegate):
def __init__(self):
PlotDelegate.__init__(self)
def getSampleText(self, rec):
timeobs = datetime.datetime.utcfromtimestamp(rec.getLong("timeObs")/1000)
description = rec.getString("description")
category = rec.getString("category")
sampleString = "mPING %s\n\tCategory: %s\n\tDescription: %s"%(timeobs,category,description)
return sampleString
plotDelegate = MpingPlotDelegate()
</script>
<style type="text/css">
<![CDATA[
@font-face { font-family: "WindSymbolFont";
src: url(WindSymbols.svg#WindSymbols); }
@font-face { font-family: "StandardFont";
src: url(Standard.svg#Standard); }
@font-face { font-family: "WxSymbolFont";
src: url(WxSymbols.svg#WxSymbols); }
@font-face { font-family: "SpecialSymbolFont";
src: url(SpecialSymbols.svg#SpecialSymbols); }
@font-face { font-family: "mPING";
src: url(mping.svg#mping); }
text.barb
{
fill: none;
font-size: 1em;
font-size: 1em;
font-family: WindSymbolFont;
}
text.arrow
{
fill: none;
font-size: 1em;
font-size: 1em;
font-family: WindSymbolFont;
}
text.text
{
fill: none;
font-size: 1em;
stroke-width: 1px;
font-family: StandardFont;
font-size: 1em;
}
text.weather
{
fill: none;
font-size: 2em;
stroke-width: 1px;
font-family: WxSymbolFont;
}
text.mping
{
fill: none;
font-size: 1.5em;
stroke-width: 0.5px;
font-family: mPING;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-transform: none;
}
text.special
{
fill: none;
font-size: 1em;
stroke-width: 1px;
font-size: 1em;
font-family: SpecialSymbolFont;
}
]]>
</style>
<symbol overflow="visible" id="plotData" class="info">
<text id="rawmPingText" plotMode="sample" class="text" plotParam="description,category,timeObs" x="0" y="0">0</text>
<text id="cloudText" plotMode="table" class="mping" plotLookupTable="mPing_trans.txt" plotParam="description_id" style="text-anchor: start" x="0" y="0">0</text>
</symbol>
</defs>
<use id="wind" x="40" y="40" width="80" height="80" visibility="visible" xlink:href="#plotData"/>
</svg>

Before

Width:  |  Height:  |  Size: 3 KiB

View file

@ -77,18 +77,10 @@
<param name="feature"
value="com.raytheon.uf.edex.gfe.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.hydro.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.radar.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.dat.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.config.auto.feature" />
@ -105,10 +97,6 @@
<param name="feature"
value="com.raytheon.uf.edex.npp.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.remote.script.feature" />
</antcall>
<antcall target="build">
<param name="feature"
value="com.raytheon.uf.edex.binlightning.feature" />
@ -125,10 +113,12 @@
<param name="feature"
value="gov.nasa.msfc.sport.edex.glmdecoder.feature" />
</antcall>
<!--
<antcall target="build">
<param name="feature"
value="gov.nasa.msfc.sport.edex.sportlma.feature" />
</antcall>
-->
<antcall target="build">
<param name="feature"
value="gov.noaa.nws.crh.edex.grib.decoderpostprocessor.feature" />

View file

@ -84,18 +84,10 @@
id="com.raytheon.uf.edex.gfe.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.edex.hydro.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.edex.radar.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.edex.dat.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.edex.ncep.feature"
version="0.0.0"/>
@ -104,10 +96,6 @@
id="com.raytheon.uf.edex.npp.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.edex.remote.script.feature"
version="0.0.0"/>
<includes
id="com.raytheon.uf.edex.config.auto.feature"
version="0.0.0"/>

View file

@ -32,10 +32,6 @@
<constructor-arg ref="smartInitSrv"/>
</bean>
<bean id="spcWatch" class="com.raytheon.edex.plugin.gfe.watch.SPCWatchSrv"/>
<bean id="tpcWatch" class="com.raytheon.edex.plugin.gfe.watch.TPCWatchSrv"/>
<bean id="wclWatch" class="com.raytheon.edex.plugin.gfe.watch.WCLWatchSrv"/>
<bean id="vtecChangeListener" class="com.raytheon.edex.plugin.gfe.server.notify.VTECTableChangeListener"/>
<camelContext id="gfe-camel-spring" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
@ -44,42 +40,6 @@
https://issues.apache.org/jira/browse/CAMEL-7540 -->
<endpoint id="smartInitLauncher" uri="quartz://smartInitThread?trigger.repeatCount=${smartinit.additional.threads}&amp;trigger.repeatInterval=1"/>
<route id="SPCWatch">
<from uri="vm:gfe.spcWatch"/>
<doTry>
<bean ref="spcWatch" method="handleWatch"/>
<doCatch>
<exception>java.lang.Throwable</exception>
<to
uri="log:gfeWatch?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="TPCWatch">
<from uri="vm:gfe.tpcWatch"/>
<doTry>
<bean ref="tpcWatch" method="handleWatch"/>
<doCatch>
<exception>java.lang.Throwable</exception>
<to
uri="log:gfeWatch?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="WCLWatch">
<from uri="direct-vm:wclWatch"/>
<doTry>
<bean ref="wclWatch" method="handleWclWatch"/>
<doCatch>
<exception>java.lang.Throwable</exception>
<to
uri="log:gfeWatch?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="smartInitTrigger">
<from uri="timer://smartInitTimer?fixedRate=true&amp;period=30000"/>
<bean ref="smartInitQueue" method="fireSmartInit"/>

View file

@ -1,122 +0,0 @@
/**
* 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.edex.plugin.gfe.watch;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.activetable.VTECPartners;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
/**
* Watches ingested warnings for WOU products from the SPC (Storm Prediction
* Center). If the warning is a WOU, then it looks to see if the site is in the
* ATTN...WFO... line, and if so, sends a user message to GFE to alert users.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 03, 2008 njensen Initial creation
* Jul 10, 2009 #2590 njensen Added multiple site support
* May 12, 2014 #3157 dgilling Re-factor based on AbstractWatchNotifierSrv.
* Jun 10, 2014 #3268 dgilling Re-factor based on AbstractWatchNotifierSrv.
* Oct 08, 2014 #4953 randerso Refactored AbstractWatchNotifierSrv to allow
* subclasses to handle all watches if desired.
* </pre>
*
* @author njensen
* @version 1.0
*/
public final class SPCWatchSrv extends AbstractWatchNotifierSrv {
private static final String SPC_WATCH_TYPE = "SPC";
private static final String DEFAULT_SPC_SITE = "KNHC";
private static final String TEST_TEXT_MSG = " This is a TEST watch. Please restart the GFE in TEST mode before issuing WCN. ";
private static final String ALERT_MSG = "Alert: %s %s has arrived. "
+ "Check for 'red' locks (owned by others) on your Hazard grid and resolve them. "
+ "If hazards are separated into temporary grids, please run MergeHazards. "
+ "Next...save Hazards grid. Finally, select PlotSPCWatches from the Hazards menu.";
private static final Map<String, String> phenTextMap;
static {
Map<String, String> phenTextMapTemp = new HashMap<String, String>(2, 1f);
phenTextMapTemp.put("TO", "Tornado Watch");
phenTextMapTemp.put("SV", "Severe Thunderstorm Watch");
phenTextMap = Collections.unmodifiableMap(phenTextMapTemp);
}
/**
* Constructor
*/
public SPCWatchSrv() {
super(SPC_WATCH_TYPE);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.plugin.gfe.warning.AbstractWarningNotifierSrv#
* buildNotification(java.util.List, java.lang.String,
* com.raytheon.uf.common.activetable.VTECPartners)
*/
@Override
protected String buildNotification(List<AbstractWarningRecord> decodedVTEC,
VTECPartners partnersConfig) {
Collection<String> spcSites = partnersConfig
.getSpcSites(DEFAULT_SPC_SITE);
// find the first record from our configured list of issuing sites.
// Also this product must be a NEW SV.A or TO.A
AbstractWarningRecord matchRecord = null;
for (AbstractWarningRecord e : decodedVTEC) {
if (spcSites.contains(e.getOfficeid())
&& e.getSig().equals("A")
&& ((e.getPhen().equals("TO")) || (e.getPhen().equals("SV")))
&& e.getAct().equals("NEW")) {
matchRecord = e;
break;
}
}
if (matchRecord == null) {
statusHandler.debug("SPC notification: "
+ "no SV.A, TO.A vtec lines, or not NEW action code");
return null;
}
// create the message
String eventType = phenTextMap.get(matchRecord.getPhen());
StringBuilder msg = new StringBuilder(String.format(ALERT_MSG,
eventType, matchRecord.getEtn()));
if (matchRecord.getVtecstr().charAt(1) == 'T') {
msg.append(TEST_TEXT_MSG);
}
return msg.toString();
}
}

View file

@ -1,605 +0,0 @@
/**
* 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.edex.plugin.gfe.watch;
import java.io.File;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.edex.plugin.gfe.server.IFPServer;
import com.raytheon.uf.common.activetable.VTECPartners;
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.dataplugin.gfe.textproduct.CombinationsFileUtil;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord;
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.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonIncludePathUtil;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.RunProcess;
import com.raytheon.uf.edex.activetable.ActiveTablePyIncludeUtil;
import jep.JepException;
/**
* Watches ingested warnings for WOU products from the SPC (Storm Prediction
* Center). If the warning is a WOU, then it looks to see if the site is in the
* ATTN...WFO... line, and if so, sends a user message to GFE to alert users.
*
* <pre>
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------------------------
* Oct 03, 2008 njensen Initial creation
* Jul 10, 2009 2590 njensen Added multiple site support
* May 12, 2014 3157 dgilling Re-factor based on AbstractWatchNotifierSrv.
* Jun 10, 2014 3268 dgilling Re-factor based on AbstractWatchNotifierSrv.
* Oct 08, 2014 4953 randerso Refactored AbstractWatchNotifierSrv to allow
* subclasses to handle all watches if desired.
* Added hooks for TCVAdvisory creation Changed
* to use Python to store TCVAdvisory files
* Added code to keep practice and operational
* advisory files separated Added call to
* nwrwavestcv.csh Added support for sending
* TCVAdvisory files to VTEC partners
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* Jan 27, 2016 5237 tgurney Replace LocalizationFile with ILocalizationFile
* Apr 13, 2016 5577 randerso Add support for pre-TCV
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to
* LocalizationException
* Jan 27, 2016 5237 tgurney Replace LocalizationFile with
* ILocalizationFile
* Sep 01, 2016 5873 randerso Changed to use StormNumber instead of
* StormName and add leading zeroes to advisory
* number in json file names to ensure they
* sort correctly.
* Oct 03, 2016 19293 randerso Changes for 2017 Tropical Season
* Nov 11, 2016 19293 randerso Use new CombinationsFileUtil methods that
* allow specifying the site ID
*
* correctly
* Sep 01, 2016 5873 randerso Add leading zeroes to advisory number in
* json file names to ensure they sort
*
* </pre>
*
* @author njensen
* @version 1.0
*/
public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
private static final String NWRWAVES_SCRIPT = "/awips/adapt/NWRWAVES/nwrwavestcv.csh ";
private static final String TCV_ADVISORY_PATH = FileUtil.join("gfe",
"tcvAdvisories");
private static final String PRACTICE_PATH = FileUtil.join(TCV_ADVISORY_PATH,
"practice");
private static final String TPC_WATCH_TYPE = "TPC";
private static final String DEFAULT_TPC_SITE = "KNHC";
private static final String ALERT_TXT = "Alert: TCV has arrived %s. "
+ "Check for 'red' locks (owned by others) on your Hazard grid and resolve them. "
+ "If hazards are separated into temporary grids, please run Mergehazards. "
+ "Next...save Hazards grid. Finally, select PlotTPCEvents from Hazards menu.";
private static final Pattern ADVISORY_NUMBER_PATTERN = Pattern
.compile("([0-9]+)([A-Z]*)");
private static final Pattern ATLANTIC_XXX = Pattern.compile("AT\\d");
private static final Pattern PACIFIC_XXX = Pattern.compile("[CE]P\\d");
private static final ThreadLocal<PythonScript> pythonScript = new ThreadLocal<PythonScript>() {
@Override
protected PythonScript initialValue() {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext context = pathMgr.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
LocalizationFile lf = pathMgr.getLocalizationFile(context, FileUtil
.join(GfePyIncludeUtil.COMMON_GFE, "JsonSupport.py"));
String filePath = lf.getFile().getAbsolutePath();
String includePath = PyUtil.buildJepIncludePath(true,
GfePyIncludeUtil.getCommonGfeIncludePath());
try {
return new PythonScript(filePath, includePath,
this.getClass().getClassLoader());
} catch (JepException e) {
statusHandler.error(e.getLocalizedMessage(), e);
}
return null;
}
};
/*
* regex to parse HLS MND header
*/
private static final Pattern HLS_MND_PATTERN = Pattern.compile(
"^.*\\s(?<stormName>\\w+)\\sLOCAL STATEMENT "
+ "(?<advisoryType>SPECIAL |INTERMEDIATE )?"
+ "(ADVISORY NUMBER\\s(?<advisoryNumber>[0-9]+[A-Z]*))\\s*\\n"
+ "NATIONAL WEATHER SERVICE .*\\s(?<stormNumber>[A-Z]+[0-9]+)\\s*$",
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
/**
* Constructor
*/
public TPCWatchSrv() {
super(TPC_WATCH_TYPE);
}
@Override
public void handleWatch(List<AbstractWarningRecord> warningRecs) {
/*
* Since all records originate from a single TCV product the issuing
* office and record type will be the same we only need to look at the
* first record.
*/
AbstractWarningRecord record = warningRecs.get(0);
String pil = record.getPil();
String xxxId = record.getXxxid();
boolean practiceMode = (record instanceof PracticeWarningRecord);
String issuingOffice = record.getOfficeid();
// if it's a TCV or pre-TCV
if ("TCV".equals(pil) || "PTC".equals(pil)) {
super.handleWatch(warningRecs);
}
// if we are not in practice mode
if (!practiceMode && "TCV".equals(pil)) {
// if xxxId does NOT end with a digit (i.e. its NOT a national TCV)
if (!Character.isDigit(xxxId.charAt(xxxId.length() - 1))) {
// build the full 9-letter PIL
String fullPil = SiteMap.getInstance()
.mapICAOToCCC(issuingOffice) + pil + xxxId;
// build the command line for the NWRWAVES script
final String command = NWRWAVES_SCRIPT + fullPil;
// Create a separate thread to run the script
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
RunProcess proc;
try {
proc = RunProcess.getRunProcess().exec(command);
} catch (IOException e) {
statusHandler.error("Error executing " + command,
e);
return;
}
int exitCode = proc.waitFor();
if (exitCode != 0) {
statusHandler.error(
command + " terminated abnormally with exit code: "
+ exitCode);
}
}
});
thread.start();
}
}
// update TCV Advisories
Matcher xxxMatcher = ATLANTIC_XXX.matcher(xxxId);
for (String siteId : getActiveSites()) {
String site4 = SiteMap.getInstance().getSite4LetterId(siteId);
if (issuingOffice.equals(site4)) {
if ("TCV".equals(pil)) {
if (xxxMatcher.matches()) {
this.handleNationalTCV(siteId, xxxId, practiceMode);
} else {
// if WFO TCV save the pending.json files
this.saveTCVAdvisories(siteId, pil, practiceMode);
}
}
// if HLS then delete the advisory files if the watch is
// canceled
else if ("HLS".equals(pil)) {
this.deleteTCVAdvisoriesIfCanceled(siteId, pil,
practiceMode, record.getRawmessage());
}
break; // found matching officeId so we're done
}
}
}
private void handleNationalTCV(String siteId, String xxxid,
boolean practiceMode) {
this.synchronizeTCVAdvisories(siteId, practiceMode);
String filename = xxxid + ".json";
LocalizationFile lf = this.getLocalizationFile(siteId, filename,
practiceMode);
if (lf != null && lf.exists()) {
Map<String, Object> advDict = loadJSONDictionary(lf);
Object obj = advDict.get("AllCAN");
boolean allCAN = (obj == null ? false : (Boolean) obj);
String comboName = String.format("Combinations_%s_%s", xxxid,
siteId);
if (allCAN) {
// create a flag file to indicate AllCAN has occurred
LocalizationFile allCANFile = this.getLocalizationFile(siteId,
xxxid + ".allCAN", practiceMode);
try (SaveableOutputStream stream = allCANFile
.openOutputStream()) {
// Nothing to write, just need empty file
stream.save();
} catch (IOException | LocalizationException e) {
statusHandler.error("Error creating .allCAN file", e);
}
// delete existing json file
try {
lf.delete();
} catch (LocalizationException e) {
statusHandler.error("Error removing " + lf.toString(), e);
}
// empty the combinations files
List<List<String>> combinations = Collections.emptyList();
try {
CombinationsFileUtil.saveCombinationsFile(siteId,
combinations, comboName);
CombinationsFileUtil.saveCombinationsFile(siteId,
combinations, "prev" + comboName);
} catch (LocalizationException e) {
statusHandler.error("Error emptying combinations files.",
e);
}
} else {
// copy combinations file to prev
try {
List<List<String>> combinations = CombinationsFileUtil
.loadCombinationsFile(siteId, comboName);
CombinationsFileUtil.saveCombinationsFile(siteId,
combinations, "prev" + comboName);
} catch (GfeException | LocalizationException e) {
statusHandler.error(
"Error copying current combinations file to prev.",
e);
}
}
sendTCVFiles(siteId);
}
}
private void saveTCVAdvisories(String siteId, String pil,
boolean practiceMode) {
this.synchronizeTCVAdvisories(siteId, practiceMode);
String pendingFilename = "pending.json";
LocalizationFile pendingFile = this.getLocalizationFile(siteId,
pendingFilename, practiceMode);
Map<String, Object> pendingDict = this.loadJSONDictionary(pendingFile);
if (pendingDict == null) {
return;
}
pendingDict.put("Transmitted", true);
String stormNumber = (String) pendingDict.get("StormNumber");
String advisoryNumber = (String) pendingDict.get("AdvisoryNumber");
Matcher matcher = ADVISORY_NUMBER_PATTERN.matcher(advisoryNumber);
if (matcher.matches()) {
advisoryNumber = String.format("%03d%s",
Integer.valueOf(matcher.group(1)), matcher.group(2));
}
String transmittedFilename = stormNumber + "_" + advisoryNumber
+ ".json";
LocalizationFile transmittedFile = this.getLocalizationFile(siteId,
transmittedFilename, practiceMode);
boolean transmittedFileSaved = this.saveJSONDictionary(transmittedFile,
pendingDict);
if (transmittedFileSaved) {
try {
pendingFile.delete();
} catch (LocalizationException e) {
statusHandler.error("Unable to delete " + pendingFile, e);
}
// if not practice mode
if (!practiceMode) {
// send TCV files to VTEC partner sites
sendTCVFiles(siteId);
}
}
}
private void deleteTCVAdvisoriesIfCanceled(String siteId, String pil,
boolean practiceMode, String productText) {
File advisoriesDirectory = this.synchronizeTCVAdvisories(siteId,
practiceMode);
Matcher matcher = HLS_MND_PATTERN.matcher(productText);
if (matcher.find()) {
String stormNumber = matcher.group("stormNumber");
// get the list of json files for this storm
List<String> jsonFiles = new ArrayList<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(
advisoriesDirectory.toPath(), stormNumber + "_*.json")) {
for (Path path : stream) {
jsonFiles.add(path.getFileName().toString());
}
} catch (IOException e) {
statusHandler
.error("Unable to get list of json files for storm: "
+ stormNumber, e);
}
if (!jsonFiles.isEmpty()) {
// load the highest numbered file for this storm
Collections.sort(jsonFiles, Collections.reverseOrder());
LocalizationFile advFile = this.getLocalizationFile(siteId,
jsonFiles.get(0), practiceMode);
Map<String, Object> advDict = loadJSONDictionary(advFile);
boolean allCAN = (Boolean) advDict.get("AllCAN");
if (allCAN) {
// create a flag file to indicate AllCAN has occurred
LocalizationFile allCANFile = this.getLocalizationFile(
siteId, stormNumber + ".allCAN", practiceMode);
try (SaveableOutputStream stream = allCANFile
.openOutputStream()) {
// Nothing to write, just need empty file
stream.save();
} catch (IOException | LocalizationException e) {
statusHandler.error("Error creating .allCAN file", e);
}
for (String advisoryName : jsonFiles) {
LocalizationFile advisoryFile = this
.getLocalizationFile(siteId, advisoryName,
practiceMode);
try {
advisoryFile.delete();
} catch (LocalizationException e) {
statusHandler.error(
"Unable to delete " + advisoryFile, e);
}
}
// if not practice mode
if (!practiceMode) {
// send TCV files to VTEC partner sites
sendTCVFiles(siteId);
}
}
}
}
}
private void sendTCVFiles(String siteId) {
IFPServer ifpServer = IFPServer.getActiveServer(siteId);
if (ifpServer == null) {
return;
}
IFPServerConfig config = ifpServer.getConfig();
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext commonBaseCx = pathMgr.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
String scriptPath = pathMgr
.getFile(commonBaseCx, FileUtil
.join(ActiveTablePyIncludeUtil.VTEC, "sendTCV.py"))
.getPath();
String pythonIncludePath = PyUtil.buildJepIncludePath(
PythonIncludePathUtil.getCommonPythonIncludePath(),
ActiveTablePyIncludeUtil.getCommonGfeIncludePath(),
ActiveTablePyIncludeUtil.getVtecIncludePath(siteId),
ActiveTablePyIncludeUtil.getGfeConfigIncludePath(siteId),
ActiveTablePyIncludeUtil.getIscScriptsIncludePath());
PythonScript script = null;
try {
script = new PythonScript(scriptPath, pythonIncludePath,
this.getClass().getClassLoader());
try {
Map<String, Object> argMap = new HashMap<>();
argMap.put("siteID", siteId);
argMap.put("config", config);
script.execute("runFromJava", argMap);
} catch (JepException e) {
statusHandler.handle(Priority.PROBLEM,
"Error executing sendTCV.", e);
}
script.dispose();
} catch (JepException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to instantiate sendTCV python script object.", e);
}
}
private File synchronizeTCVAdvisories(String siteId, boolean practiceMode) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext context = pathMgr
.getContextForSite(LocalizationType.CAVE_STATIC, siteId);
// Retrieving a directory causes synching to occur
File file = pathMgr
.getLocalizationFile(context, getTCVAdvisoryPath(practiceMode))
.getFile();
return file;
}
private LocalizationFile getLocalizationFile(String siteId, String filename,
boolean practiceMode) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext context = pathMgr
.getContextForSite(LocalizationType.CAVE_STATIC, siteId);
LocalizationFile localizationFile = pathMgr.getLocalizationFile(context,
FileUtil.join(getTCVAdvisoryPath(practiceMode), filename));
return localizationFile;
}
private String getTCVAdvisoryPath(boolean practiceMode) {
return practiceMode ? PRACTICE_PATH : TCV_ADVISORY_PATH;
}
private Map<String, Object> loadJSONDictionary(ILocalizationFile lf) {
if (lf != null) {
PythonScript script = pythonScript.get();
if (script != null) {
Map<String, Object> args = new HashMap<>();
args.put("localizationType",
lf.getContext().getLocalizationType());
args.put("siteID", lf.getContext().getContextName());
args.put("fileName", lf.getPath());
try {
@SuppressWarnings("unchecked")
Map<String, Object> retVal = (Map<String, Object>) script
.execute("loadJsonFromJava", args);
return retVal;
} catch (JepException e) {
statusHandler.error("Error loading TCV advisory from " + lf,
e);
}
}
}
return null;
}
private boolean saveJSONDictionary(ILocalizationFile lf,
Map<String, Object> dict) {
if (lf != null) {
PythonScript script = pythonScript.get();
if (script != null) {
Map<String, Object> args = new HashMap<>();
args.put("localizationType",
lf.getContext().getLocalizationType());
args.put("siteID", lf.getContext().getContextName());
args.put("fileName", lf.getPath());
args.put("javaObject", dict);
try {
script.execute("saveJsonFromJava", args);
return true;
} catch (JepException e) {
statusHandler.error("Error saving TCV advisory to " + lf,
e);
return false;
}
}
}
return false;
}
@Override
protected String buildNotification(List<AbstractWarningRecord> decodedVTEC,
VTECPartners partnersConfig) {
Collection<String> tpcSites = partnersConfig
.getTpcSites(DEFAULT_TPC_SITE);
// get all VTEC records, assemble unique list of phen/sig and storm#
Map<String, Set<String>> phensigStormAct = new HashMap<>();
for (AbstractWarningRecord e : decodedVTEC) {
if (tpcSites.contains(e.getOfficeid())) {
String phensig = e.getPhensig();
String storm = e.getEtn();
String act = e.getAct();
Set<String> psActs = phensigStormAct.get(phensig + ":" + storm);
if (psActs == null) {
psActs = new TreeSet<>();
phensigStormAct.put(phensig + ":" + storm, psActs);
}
psActs.add(act);
}
}
if (phensigStormAct.isEmpty()) {
statusHandler.debug(
"TPC Notification: no HU/TR vtec lines, or not NEW action code");
return null;
}
String pil = decodedVTEC.get(0).getPil();
String xxxId = decodedVTEC.get(0).getXxxid();
Matcher xxxMatcher = PACIFIC_XXX.matcher(xxxId);
if ("PTC".equals(pil)) {
return String.format(ALERT_TXT, "from NHC");
} else if ("TCV".equals(pil) && xxxMatcher.matches()) {
return String.format(ALERT_TXT, "for your office");
} else {
return null;
}
}
}

View file

@ -1,364 +0,0 @@
/**
* 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.edex.plugin.gfe.watch;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.edex.plugin.gfe.server.IFPServer;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
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.SimulatedTime;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.core.EdexException;
/**
* If a WCL (watch county list) is ingested, this class will send a notification
* to the GFE users alerting them that their WFO may be in the path of an
* upcoming TO.A or SV.A.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* ??? ??, 20?? wldougher Initial creation
* Jun 09, 2014 #3268 dgilling Ensure code works in multi-domain scenarios.
* Jun 13, 2014 #3278 dgilling Ensure temporary files get deleted.
* Sep 25, 2014 #3661 randerso Update WCLWatchSrv to use localization correctly
* Sep 25, 2014, #3670 randerso Send notification directly to AlertViz
* Aug 26, 2015 #17647 yteng Correct end time of grid from ViewWCL procedure
*
* </pre>
*
* @author wldougher
* @version 1.0
*/
public class WCLWatchSrv {
private static final String ALERT_SINGLE = "Alert: "
+ "%1$s has arrived. "
+ "Please open a GFE session for site %2$s and select ViewWCL and use %1$s. (Hazards menu)";
private static final String ALERT_MULTIPLE = "Alert: "
+ "%1$s has arrived. "
+ "Please open GFE sessions for each of the following sites %2$s and select ViewWCL and use %1$s. (Hazards menu)";
private static final Pattern EXPIRE_TIME_PATTERN = Pattern
.compile("(\\d{2})(\\d{2})(\\d{2})\\-");
private static final String HYPHEN = Pattern.quote("-");
private static final Pattern TORNADO_WATCH = Pattern
.compile("\\.TORNADO WATCH");
private static final Pattern UGC_FOLLOW_PATTERN = Pattern
.compile("^(\\d{3})$");
private static final Pattern UGC_NEW_PATTERN = Pattern
.compile("^(([A-Z]{3})(\\d{3}))$");
private static final Pattern UGC_PATTERN = Pattern.compile("\\d{3}\\-");
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(WCLWatchSrv.class);
/**
* Process a WCL watch, partially parsed and passed as a WclInfo object.
* More parsing is performed on the input parameter, a summary script is
* written and moved into the "wcl" folder (whose location is determined by
* localization). If any of the active local site IDs are mentioned in the
* WCL, a AlertViz message is created and sent to alert the user. Otherwise,
* a message is written to the log.
*
* @param wclInfo
* The partially-parsed warning
* @throws EdexException
* When portions of the warning cannot be parsed (i.e., dates),
* or when there are problems generating the WCL script file.
*/
public void handleWclWatch(WclInfo wclInfo) throws EdexException {
statusHandler.debug("handleWclWatch started");
Collection<String> sitesToNotify = WatchProductUtil
.findAttnWFOs(wclInfo.getLines());
Set<String> siteIDs = getSiteIDs();
sitesToNotify.retainAll(siteIDs); // Keep shared IDs
// Process the WCL regardless of whether we are sending a notice
// Throw out every line which is not a UGC line
List<String> finalUGCList = getUGCs(wclInfo);
// Get the expiration time of the product
Date expireTime = getExpireTime(wclInfo);
// Get the issue time of the product
Date issueTime = wclInfo.getIssueTime();
// Get the watch type
String watchType = getWatchType(wclInfo);
// Get the WCL 'letter'
String completeProductPil = wclInfo.getCompleteProductPil();
// Create a wcl info string
String wclStr = makeWclStr(finalUGCList, expireTime, issueTime,
watchType);
statusHandler.info("WCLData: " + wclStr);
// Write wcl info to files for required sites
createWclFile(siteIDs, completeProductPil, wclStr);
if (sitesToNotify.isEmpty()) {
statusHandler
.debug("WCL notification: no acitve sites in ATTN list");
} else if (wclInfo.getNotify()) {
String msg;
if (sitesToNotify.size() == 1) {
msg = String.format(ALERT_SINGLE, completeProductPil,
sitesToNotify.iterator().next());
} else {
msg = String.format(ALERT_MULTIPLE, completeProductPil,
sitesToNotify.toString());
}
EDEXUtil.sendMessageAlertViz(Priority.CRITICAL,
"com.raytheon.edex.plugin.gfe", "GFE", "GFE", msg, msg,
null);
} else {
statusHandler.info("Notification of WCL skipped");
}
statusHandler.debug("handleWclWatch() ending");
}
/**
* Save WCL info to the localization path cave_static.SITE/gfe/wcl/ for each
* of the specified sites.
*
* @param siteIDs
* list of site IDs to create files for
* @param completeProductPil
* WCL pil (used for file name)
* @param wclStr
* WCL info to be written to the file
*/
protected void createWclFile(Collection<String> siteIDs,
String completeProductPil, String wclStr) {
IPathManager pathManager = PathManagerFactory.getPathManager();
for (String siteID : siteIDs) {
LocalizationContext ctx = pathManager.getContextForSite(
LocalizationType.CAVE_STATIC, siteID);
LocalizationFile wclFile = pathManager.getLocalizationFile(ctx,
FileUtil.join("gfe", "wcl", completeProductPil));
try (PrintStream wclOut = new PrintStream(
wclFile.openOutputStream())) {
wclOut.println(wclStr);
wclOut.close();
wclFile.save();
} catch (LocalizationException e) {
statusHandler.error("Error writing WCL file to " + wclFile, e);
continue;
}
statusHandler.info("Wrote WCL to " + wclFile);
}
}
/**
* Create a string representing the parameters (parsed from a WclInfo) in
* JSON format (identical to Python source, for data structures). The
* expireTime and issueTime fields are converted to seconds for convenience
* in Python.
*
* @param finalUGCList
* the final UGCs in the WCL
* @param expireTime
* the time the WCL expires, as a Date
* @param issueTime
* the time the WCL was issued, as a Date
* @param watchType
* the watch type String (either "SV.A" or "TO.A")
* @return the String created from the parameters
*/
protected String makeWclStr(List<String> finalUGCList, Date expireTime,
Date issueTime, String watchType) {
StringBuilder wclObj = new StringBuilder();
wclObj.append("watchType = \"" + watchType + "\"\n");
wclObj.append("finalUGCList = [");
String sep = "";
for (String ugc : finalUGCList) {
wclObj.append(sep);
wclObj.append("\"" + ugc + "\"");
sep = ",";
}
wclObj.append("]\n");
wclObj.append("expTime =");
if (expireTime == null) {
wclObj.append("None\n");
} else {
wclObj.append(expireTime.getTime() / 1000L);
wclObj.append("\n");
}
wclObj.append("issueTime =");
if (issueTime == null) {
wclObj.append("None\n");
} else {
wclObj.append(issueTime.getTime() / 1000L);
wclObj.append("\n");
}
String wclStr = wclObj.toString();
return wclStr;
}
/**
* Find the watch type in a WclInfo. This is "SV.A" unless any line matches
* the TORNADO_WATCH pattern.
*
* @param wclInfo
* The object representing the WCL watch
* @return "TO.A" if any line contains the TORNADO_WATCH pattern "SV.A"
* otherwise
*/
protected String getWatchType(WclInfo wclInfo) {
String watchType = "SV.A";
for (String line : wclInfo.getLines()) {
if (TORNADO_WATCH.matcher(line).find()) {
watchType = "TO.A";
break;
}
}
return watchType;
}
/**
* @param wclInfo
* The object representing the WCL watch
* @return the expiration time as a Date, or null if no line in wclInfo
* contains a match for EXPIRE_TIME_PATTERN.
*/
protected Date getExpireTime(WclInfo wclInfo) {
Date expireTime = null;
for (String line : wclInfo.getLines()) {
Matcher expireSearch = EXPIRE_TIME_PATTERN.matcher(line);
if (expireSearch.find()) {
int day = Integer.parseInt(expireSearch.group(1));
int hour = Integer.parseInt(expireSearch.group(2));
int minute = Integer.parseInt(expireSearch.group(3));
Calendar cal = Calendar
.getInstance(TimeZone.getTimeZone("UTC"));
cal.setTime(currentTime());
int dom = cal.get(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, day);
cal.set(Calendar.HOUR_OF_DAY, hour);
cal.set(Calendar.MINUTE, minute);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
// Guess whether end time crossed a month boundary.
if (day < (dom - 7)) {
cal.add(Calendar.MONTH, 1);
}
expireTime = cal.getTime();
break;
}
}
return expireTime;
}
/**
* Get the current simulated time. Declared as a method so test code can
* override it so EDEX and/or CAVE don't have to be started to test.
*
* @return current simulated time
*/
protected Date currentTime() {
return SimulatedTime.getSystemTime().getTime();
}
/**
* Parse UGCs from the lines of wclInfo and return them as a List of
* Strings.
*
* @param wclInfo
* The object representing the WCL watch
* @return the UGCs as a list of "SSS###" Strings, where SSS is a
* 3-character state abbreviation and ### is a 3-digit zone code
*/
protected List<String> getUGCs(WclInfo wclInfo) {
StringBuilder ugcComposite = new StringBuilder();
for (String line : wclInfo.getLines()) {
// See if current line contains UGC_PATTERN
if (UGC_PATTERN.matcher(line).find()) {
ugcComposite.append(line);
}
}
String[] ugcList = ugcComposite.toString().split(HYPHEN);
// Process the list of UGC lines into a list of UGCs in full form
// matching edit area names
List<String> finalUGCList = new ArrayList<String>(ugcList.length);
String state = null;
for (String ugc : ugcList) {
Matcher newGroup = UGC_NEW_PATTERN.matcher(ugc);
if (newGroup.matches()) {
state = newGroup.group(2);
finalUGCList.add(newGroup.group(1));
} else {
Matcher followGroup = UGC_FOLLOW_PATTERN.matcher(ugc);
if (followGroup.matches()) {
finalUGCList.add(state + followGroup.group(1));
}
}
}
return finalUGCList;
}
/**
* Obtain the list of active sites. This was made into a method so that it
* could be overridden in unit tests.
*
* @return a Set of Strings representing the site IDs.
*/
protected Set<String> getSiteIDs() {
Set<String> siteIDs = IFPServer.getActiveSites();
return siteIDs;
}
}

View file

@ -1,28 +0,0 @@
<pluginNotificationList>
<pluginNotification>
<endpointName>gfe.spcWatch</endpointName>
<format>PDO</format>
<endpointType>VM</endpointType>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="warning,practicewarning" constraintType="IN"/>
</mapping>
<mapping key="pil">
<constraint constraintValue="WOU" constraintType="EQUALS"/>
</mapping>
</metadataMap>
</pluginNotification>
<pluginNotification>
<endpointName>gfe.tpcWatch</endpointName>
<format>PDO</format>
<endpointType>VM</endpointType>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="warning,practicewarning" constraintType="IN"/>
</mapping>
<mapping key="pil">
<constraint constraintValue="TCV,HLS,PTC" constraintType="IN"/>
</mapping>
</metadataMap>
</pluginNotification>
</pluginNotificationList>

View file

@ -18,20 +18,12 @@
<constructor-arg value="true" /> <!-- require valid distribution file for startup -->
</bean>
<bean id="radarRadarServerDistRegistry" factory-bean="radarserverDistributionSrv"
factory-method="register">
<constructor-arg value="radar" />
<constructor-arg value="jms-durable:queue:Ingest.RadarRadarServer" />
</bean>
<camelContext id="radar-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<endpoint id="radarJmsEndpoint" uri="jms-durable:queue:Ingest.Radar?concurrentConsumers=${radar-decode.sbn.threads}"/>
<endpoint id="radarRadarServerJmsEndpoint" uri="jms-durable:queue:Ingest.RadarRadarServer?concurrentConsumers=${radar-decode.local.threads}"/>
<!-- Begin Radar routes -->
<route id="radarIngestRoute">
<from ref="radarJmsEndpoint"/>
@ -41,14 +33,6 @@
<to uri="direct:radarcommon" />
</route>
<route id="radarRadarServerIngestRoute">
<from ref="radarRadarServerJmsEndpoint"/>
<setHeader headerName="dataType">
<constant>radar-local</constant>
</setHeader>
<to uri="direct:radarcommon" />
</route>
<route id="radarCommonIngestRoute">
<from uri="direct:radarcommon" />
<setHeader headerName="pluginName">
@ -76,12 +60,4 @@
</route>
</camelContext>
<bean id="radarServerConnectionHandler"
class="com.raytheon.edex.rpgenvdata.RadarServerConnectionHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg
value="com.raytheon.uf.common.dataplugin.radar.request.RadarServerConnectionRequest" />
<constructor-arg ref="radarServerConnectionHandler" />
</bean>
</beans>

View file

@ -1,4 +1,2 @@
# Number threads for radar products ingested from the SBN
radar-decode.sbn.threads=5
# Number threads for radar products ingested locally
radar-decode.local.threads=1

View file

@ -188,20 +188,6 @@ class StdWarningDecoder():
self._productPil, self._issueTime, linePos,\
self._completeProductPil = self._getPilAndDTG()
# If this is a WCL - don't go any further. Run WCL procedure and exit.
if self._productPil[0:3] == "WCL":
endpoint = "WCLWatch"
# build a Java object for the warning
from com.raytheon.edex.plugin.gfe.watch import WclInfo
import JUtil
lines = JUtil.pyValToJavaObj(self._lines)
warning = WclInfo(long(self._issueTime * 1000),
self._completeProductPil, lines, self._notifyGFE)
from com.raytheon.uf.edex.core import EDEXUtil
EDEXUtil.getMessageProducer().sendAsync(endpoint, warning)
LogStream.logEvent("%s forwarded to WCLWatch" % self._productPil)
return []
# Determine if this is a segmented product
segmented = self._determineSegmented(linePos)

View file

@ -1,7 +0,0 @@
<?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>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.edex.rpgenvdata</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>

View file

@ -1,4 +0,0 @@
#Thu Feb 11 20:35:01 GMT+00:00 2010
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false

View file

@ -1,24 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: RPG Environmental Data Plug-in
Bundle-SymbolicName: com.raytheon.edex.rpgenvdata
Bundle-Version: 1.16.0
Bundle-Vendor: Raytheon
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.11.24",
com.raytheon.uf.common.status;bundle-version="1.11.24",
com.raytheon.rcm.lib;bundle-version="1.11.24",
com.raytheon.uf.common.dataplugin.grid,
javax.measure;bundle-version="1.0.0",
com.raytheon.edex.common;bundle-version="1.11.24",
javax.jms;bundle-version="1.0.0",
com.raytheon.edex.plugin.radar;bundle-version="1.12.1174",
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
org.itadaki.bzip2;bundle-version="0.9.1",
com.raytheon.uf.edex.ndm
Import-Package: com.raytheon.uf.common.dataplugin.radar,
com.raytheon.uf.common.dataplugin.radar.request,
com.raytheon.uf.common.ohd,
com.raytheon.uf.edex.plugin.mpe.conversion

View file

@ -1,7 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
utility/,\
.,\
res/,\
resources/

View file

@ -1,8 +0,0 @@
<project name="component-substitute" basedir="." default="utility-substitute">
<property name="enable-component-substitute" value="true" />
<target name="utility-substitute">
</target>
</project>

View file

@ -1,13 +0,0 @@
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="radarServerConnectionHandler"
class="com.raytheon.edex.rpgenvdata.RadarServerConnectionHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg
value="com.raytheon.uf.common.dataplugin.radar.request.RadarServerConnectionRequest" />
<constructor-arg ref="radarServerConnectionHandler" />
</bean>
</beans>

View file

@ -1,68 +0,0 @@
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="envData" class="com.raytheon.edex.rpgenvdata.RPGEnvironmentalDataRunner" />
<bean id="radarServerNdmListener" class="com.raytheon.edex.rpgenvdata.ndm.RadarServerNdmSubscriber"/>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="prodList.txt" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="tdwrProdList.txt" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="rps-RPGOP-tcp.clear-air" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="rps-RPGOP-tcp.storm" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="rps-SPGOP-tcp.storm" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="wmoSiteInfo.txt" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="cronOTRs.xml" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="elevationLists.txt" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="tdwrElevations.txt" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="ssssElevationLists.txt" />
<constructor-arg ref="radarServerNdmListener" />
</bean>
<camelContext id="rpgenvdata-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
<endpoint id="rpgEnvDataCron" uri="clusteredquartz://rpgEnvData/rpgEnvDataRoute/?cron=${rpgenvdata.envdata.cron}"/>
<endpoint id="rpgBiasTableCron" uri="clusteredquartz://rpgBiasTable/rpgBiasTableRoute/?cron=${rpgenvdata.biastable.cron}"/>
<route id="rpgEnvDataRoute">
<from uri="rpgEnvDataCron" />
<bean ref="envData" method="sendEnvironmentalData" />
</route>
<route id="rpgBiasTableRoute">
<from uri="rpgBiasTableCron" />
<bean ref="envData" method="sendBiasTable" />
</route>
</camelContext>
</beans>

View file

@ -1,3 +0,0 @@
# rpg crongs
rpgenvdata.envdata.cron=0+0+*+*+*+?
rpgenvdata.biastable.cron=0+26,46+*+*+*+?

View file

@ -1,122 +0,0 @@
/**
* 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.edex.rpgenvdata;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlList;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name="configuration")
@XmlAccessorType(XmlAccessType.FIELD)
public class Configuration {
@XmlAccessorType(XmlAccessType.FIELD)
public static class Model {
@XmlAttribute public String name;
@XmlAttribute public String description;
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class ClipRadius {
@XmlAttribute public double value;
@XmlAttribute public String units;
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="parameter")
public static class ParameterDef {
@XmlAttribute public String id;
@XmlAttribute public String name;
@XmlAttribute public String type;
@XmlAttribute public String units;
@XmlAttribute public String value;
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class Field {
@XmlAttribute public String name;
@XmlAttribute(required=true) public String description;
@XmlAttribute public String units;
@XmlAttribute private Float acceptableInventoryPercentage;
@XmlElement(name="level")
Level[] levels;
@XmlTransient
public float getAcceptableInventoryRatio() {
if (acceptableInventoryPercentage != null)
return acceptableInventoryPercentage.floatValue() / 100.0f;
else
return 1;
}
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class Level {
@XmlAttribute public String name;
@XmlAttribute public String description;
@XmlAttribute public String units;
@XmlAttribute @XmlList public String[] levels;
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class InventoryHint {
@XmlAttribute public String levelType;
@XmlAttribute public int nLevels;
}
public Model model = new Model();
public ClipRadius clipRadius = new ClipRadius();
public Integer timeStepHint;
@XmlElement(name="parameter")
public ParameterDef[] parameters = new ParameterDef[0];
@XmlElement(name="field")
public Field[] fields = new Field[0];
@XmlElement(name="inventoryHint")
public InventoryHint[] inventoryHints= new InventoryHint[0];
private static JAXBContext jaxbContext;
private static Unmarshaller unmarshaller;
public static JAXBContext getJAXBContext() throws JAXBException {
if (jaxbContext == null) {
synchronized (Configuration.class) {
if (jaxbContext == null) {
jaxbContext = JAXBContext.newInstance(Configuration.class);
unmarshaller = jaxbContext.createUnmarshaller();
}
}
}
return jaxbContext;
}
public static Unmarshaller getUnmashaller() throws JAXBException {
getJAXBContext();
return unmarshaller;
}
}

View file

@ -1,42 +0,0 @@
/**
* 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.edex.rpgenvdata;
public class RPGEnvironmentalDataRunner {
public String sendEnvironmentalData() {
RPGEnvironmentalDataManager mgr = new RPGEnvironmentalDataManager();
try {
mgr.sendEnvironmentalDataToRPGs();
return mgr.getMessages();
} finally {
mgr.close();
}
}
public String sendBiasTable() {
RPGEnvironmentalDataManager mgr = new RPGEnvironmentalDataManager();
try {
mgr.sendBiasTableToRPGs();
return mgr.getMessages();
} finally {
mgr.close();
}
}
}

View file

@ -1,63 +0,0 @@
/**
* 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.edex.rpgenvdata;
import com.raytheon.uf.common.dataplugin.radar.request.RadarServerConnectionRequest;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
/**
* Handles a RadarServerConnectionRequest, and returns the address to the radar
* server in the system
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 31, 2011 mnash Initial creation
*
* </pre>
*
* @author mnash
* @version 1.0
*/
public class RadarServerConnectionHandler implements
IRequestHandler<RadarServerConnectionRequest> {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.serialization.comm.IRequestHandler#handleRequest
* (com.raytheon.uf.common.serialization.comm.IServerRequest)
*/
@Override
public String handleRequest(RadarServerConnectionRequest request)
throws Exception {
String radarServerConnectionURL = System.getenv("RADAR_SERVER");
if (radarServerConnectionURL == null) {
radarServerConnectionURL = "tcp://localhost:8813";
}
return radarServerConnectionURL;
}
}

View file

@ -1,237 +0,0 @@
/**
* 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.edex.rpgenvdata;
import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TemporaryQueue;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import javax.xml.bind.JAXBException;
import com.raytheon.rcm.mqsrvr.EventObj;
import com.raytheon.rcm.mqsrvr.ReplyObj;
import com.raytheon.rcm.mqsrvr.ReqObj;
import com.raytheon.rcm.rmr.RmrEvent;
import com.raytheon.uf.common.serialization.JAXBManager;
/**
* Manages client connection to RadarServer
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* D. Friedman Initial creation
* Jun 10, 2015 4497 nabowle Use JAXBManager.
*
* </pre>
*
* @author dfriedma
* @version 1.0
*/
public class RcmClient {
private Properties properties;
private QueueConnectionFactory connectionFactory;
private Queue destination;
private TemporaryQueue replyQueue;
private QueueConnection queueConn;
private QueueSession queueSession;
private QueueSender queueSender;
private QueueReceiver queueReceiver;
private static JAXBManager jaxbManager;
private static final long RESPONSE_TIMEOUT = 30 * 1000;
public RcmClient() {
}
public RcmClient(Properties properties) {
this.properties = properties;
}
public void initialize() throws Exception {
if (properties == null) {
properties = new Properties();
}
if (jaxbManager == null) {
synchronized (RcmClient.class) {
if (jaxbManager == null) {
jaxbManager = new JAXBManager(true, ReqObj.class,
ReplyObj.class, EventObj.class, RmrEvent.class);
}
}
}
properties.setProperty("queue.RadarServer", "RadarServer");
properties.setProperty("java.naming.factory.initial",
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
properties.setProperty("connectionFactoryNames",
"queueConnectionFactory");
properties.setProperty("java.naming.provider.url",
System.getenv("RADAR_SERVER"));
javax.naming.Context ctx = new InitialContext(properties);
connectionFactory = (QueueConnectionFactory) ctx
.lookup("queueConnectionFactory");
destination = (Queue) ctx.lookup("RadarServer");
}
public void close() {
teardown();
}
public void onFailure(String detail, Exception e) {
// This implementation does nothing. Subclasses may override.
}
public ReplyObj sendRequest(ReqObj req) {
if (!getConnection()) {
return null;
}
String xml;
try {
xml = jaxbManager.marshalToXml(req);
} catch (JAXBException e) {
onFailure("Error creating message", e);
return null;
}
String messageText = null;
try {
TextMessage msg = queueSession.createTextMessage(xml);
msg.setJMSReplyTo(replyQueue);
queueSender.send(msg);
String msgId = msg.getJMSMessageID();
while (true) {
// TODO: diminishing timeout if ignored messages?
Message m2 = queueReceiver.receive(RESPONSE_TIMEOUT);
if (m2 == null) {
onFailure(
"Timed out waiting for response from RadarServer",
null);
return null;
}
String corrId = m2.getJMSCorrelationID();
if (corrId != null && corrId.equals(msgId)) {
if (m2 instanceof TextMessage) {
messageText = ((TextMessage) m2).getText();
}
break;
} else {
// TODO: really "failure"?
onFailure("Ignoring message from RadarServer", null);
}
}
} catch (JMSException e) {
onFailure("Error sending message to RadarServer", e);
teardown();
return null;
}
ReplyObj ro = null;
try {
if (messageText == null) {
throw new Exception("Error decoding reply message");
}
Object o = jaxbManager.unmarshalFromXml(messageText);
ro = (ReplyObj) o;
} catch (Exception e) {
// Catches JAXB exceptions and cast exception for assuming ReplyObj
ro = new ReplyObj(e.toString());
}
return ro;
}
public <T> T sendCheckedAndHandled(ReqObj req, Class<T> replyClass) {
ReplyObj ro = sendRequest(req);
if (ro != null && ro.error != null) {
onFailure("Received error from RadarServer: " + ro.error, null);
return null;
} else if (ro != null && !replyClass.isAssignableFrom(ro.getClass())) {
onFailure(String.format("Received unexpected response of type %s",
replyClass.getSimpleName()), null);
return null;
}
return replyClass.cast(ro);
}
public ReplyObj sendCheckedAndHandled(ReqObj req) {
return sendCheckedAndHandled(req, ReplyObj.class);
}
private boolean getConnection() {
if (queueConn == null) {
try {
queueConn = connectionFactory.createQueueConnection();
queueSession = queueConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
// queueSender.setDisableMessageID(false);
queueSender = queueSession.createSender(destination);
replyQueue = queueSession.createTemporaryQueue();
queueReceiver = queueSession.createReceiver(replyQueue);
queueConn.start();
} catch (Exception e) {
teardown();
onFailure("Error connecting to RadarServer", e);
}
}
return queueConn != null;
}
private void teardown() {
QueueConnection aConn = queueConn;
queueConn = null;
if (aConn != null) {
try {
aConn.close();
} catch (Exception e2) {
// nothing
}
}
}
}

View file

@ -1,44 +0,0 @@
/**
* 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.edex.rpgenvdata;
/**
* StatusConstants for dissemination
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 2010 dfriedma Initial creation
*
* </pre>
*
* @author dfriedma
* @version 1.0
*/
public class StatusConstants {
public static final String PLUGIN_NAME = "com.raytheon.edex.rpgenvdata";
public static final String CATEGORY_RPG_ENV_DATA = "RPGEnvData";
}

View file

@ -1,60 +0,0 @@
package com.raytheon.edex.rpgenvdata.ndm;
import java.io.File;
import com.raytheon.edex.rpgenvdata.RcmClient;
import com.raytheon.rcm.mqsrvr.ReqObj.SendConfigFile;
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.util.FileUtil;
import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
/**
* Sends NDM configuration files to the RadarServer.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2014-02-03 DR 14762 D. Friedman Created.
* </pre>
*
*/
public class RadarServerNdmSubscriber implements INationalDatasetSubscriber {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(RadarServerNdmSubscriber.class);
// TODO: duplicate..
private class MyRcmClient extends RcmClient {
@Override
public void onFailure(String detail, Exception e) {
statusHandler.handle(Priority.SIGNIFICANT, detail, e);
}
}
@Override
public void notify(String fileName, File file) {
MyRcmClient rcmClient = null;
try {
try {
rcmClient = new MyRcmClient();
rcmClient.initialize();
SendConfigFile req = new SendConfigFile();
req.fileName = file.getName();
req.fileData = FileUtil.file2bytes(file);
rcmClient.sendCheckedAndHandled(req);
} catch (Exception e) {
// TODO: maybe rely on caller exception handling?
rcmClient = null;
statusHandler.handle(Priority.SIGNIFICANT,
"Error initializing RadarServer connection", e);
}
} finally {
if (rcmClient != null) {
rcmClient.close();
}
}
}
}

View file

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!-- To send the RAP40 model to the RPG, copy this file to
/awips2/edex/data/utility/common_static/site/{SITE-ID}/rpgenvdata/EnvironParamsLevelTable.xml
-->
<configuration>
<model name="RAP40" description="RUC 40km" />
<!-- <inventoryHint levelType="MB" nLevels="36" /> -->
<inventoryHint levelType="SFC" nLevels="1" />
<timeStepHint>3600</timeStepHint>
<clipRadius value="400" units="km" />
<!-- EDEX unit is actually "gpm" -->
<field name="GH" units="m" description="Geopotential Height">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100" />
</field>
<field name="RH" units="%" description="Relative Humidity">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300" />
</field>
<field name="T" units="K" description="Temperature">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100" />
</field>
<field name="uW" description="U Wind Component" units="m/s">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100" />
</field>
<field name="vW" description="V Wind Component" units="m/s">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300 250 200 150 100" />
</field>
<field name="P" units="Pa" description="Pressure">
<level name="SFC" description="Surface Level" units="" />
</field>
<parameter id="mod_name" name="Model Name" type="string" />
<parameter id="mod_run_date" name="Model Run Date" type="string" />
<parameter id="mod_run_time" name="Model Run Time" type="string" />
<parameter id="val_date" name="Valid Date" type="string" />
<parameter id="val_time" name="Valid Time" type="string" />
<parameter id="forecast_hr" name="Forecast Hour" type="int" />
<parameter id="coord_system" name="Coordinate System" type="string" value="Cartesian"/>
<parameter id="proj" name="Projection" type="string" />
<parameter id="lat_lower_left" name="Latitude Lower Left Corner" units="degrees" type="float" />
<parameter id="lon_lower_left" name="Longitude Lower Left Corner" units="degrees" type="float" />
<parameter id="lat_upper_right" name="Latitude Upper Right Corner" units="degrees" type="float" />
<parameter id="lon_upper_right" name="Longitude Upper Right Corner" units="degrees" type="float" />
<parameter id="lat_tang_pt" name="Latitude of Tangent point" units="degrees" type="float" />
<parameter id="lon_tang_pt" name="Longitude of Tangent point" units="degrees" type="float" />
<parameter id="numXpts" name="Number of points in X direction" type="int" />
<parameter id="numYpts" name="Number of points in Y direction" type="int" />
</configuration>

View file

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<configuration>
<model name="RAP13" description="RUC 13km" />
<!-- <inventoryHint levelType="MB" nLevels="36" /> -->
<inventoryHint levelType="SFC" nLevels="1" />
<timeStepHint>3600</timeStepHint>
<clipRadius value="400" units="km" />
<!-- EDEX unit is actually "gpm" -->
<field name="GH" units="m" description="Geopotential Height">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 975 950 925 900 875 850 825 800 775 750 725 700 675 650 625 600 575 550 525 500 475 450 425 400 375 350 325 300 250 200 150 100" />
</field>
<field name="RH" units="%" description="Relative Humidity">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 975 950 925 900 875 850 825 800 775 750 725 700 675 650 625 600 575 550 525 500 475 450 425 400 375 350 325 300 250 200 150 100" />
</field>
<field name="T" units="K" description="Temperature">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 975 950 925 900 875 850 825 800 775 750 725 700 675 650 625 600 575 550 525 500 475 450 425 400 375 350 325 300 250 200 150 100" />
</field>
<field name="uW" description="U Wind Component" units="m/s">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 975 950 925 900 875 850 825 800 775 750 725 700 675 650 625 600 575 550 525 500 475 450 425 400 375 350 325 300 250 200 150 100" />
</field>
<field name="vW" description="V Wind Component" units="m/s">
<level name="MB" description="Pressure Level" units="mb"
levels="1000 975 950 925 900 875 850 825 800 775 750 725 700 675 650 625 600 575 550 525 500 475 450 425 400 375 350 325 300 250 200 150 100" />
</field>
<field name="P" units="Pa" description="Pressure">
<level name="SFC" description="Surface Level" units="" />
</field>
<parameter id="mod_name" name="Model Name" type="string" />
<parameter id="mod_run_date" name="Model Run Date" type="string" />
<parameter id="mod_run_time" name="Model Run Time" type="string" />
<parameter id="val_date" name="Valid Date" type="string" />
<parameter id="val_time" name="Valid Time" type="string" />
<parameter id="forecast_hr" name="Forecast Hour" type="int" />
<parameter id="coord_system" name="Coordinate System" type="string" value="Cartesian"/>
<parameter id="proj" name="Projection" type="string" />
<parameter id="lat_lower_left" name="Latitude Lower Left Corner" units="degrees" type="float" />
<parameter id="lon_lower_left" name="Longitude Lower Left Corner" units="degrees" type="float" />
<parameter id="lat_upper_right" name="Latitude Upper Right Corner" units="degrees" type="float" />
<parameter id="lon_upper_right" name="Longitude Upper Right Corner" units="degrees" type="float" />
<parameter id="lat_tang_pt" name="Latitude of Tangent point" units="degrees" type="float" />
<parameter id="lon_tang_pt" name="Longitude of Tangent point" units="degrees" type="float" />
<parameter id="numXpts" name="Number of points in X direction" type="int" />
<parameter id="numYpts" name="Number of points in Y direction" type="int" />
</configuration>

View file

@ -1,7 +0,0 @@
<?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>

View file

@ -1,28 +0,0 @@
<?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>

View file

@ -1,16 +0,0 @@
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

View file

@ -1,5 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
utility/,\
.

View file

@ -1,555 +0,0 @@
/**
* 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";
}
}

View file

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
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.
-->
<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>

View file

@ -1,7 +0,0 @@
<?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>

View file

@ -1,28 +0,0 @@
<?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>

View file

@ -1,28 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: FFMP common Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.ffmp
Bundle-Version: 1.16.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
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;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.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;bundle-version="1.0.0",
javax.measure;bundle-version="1.0.0",
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;bundle-version="1.16.0"
Import-Package: com.raytheon.uf.common.util

View file

@ -1,6 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
utility/,\
.,\
res/

View file

@ -1,12 +0,0 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="ffmpDataFactory"
class="com.raytheon.uf.common.dataplugin.ffmp.dataaccess.FFMPGeometryFactory" />
<bean factory-bean="dataAccessRegistry" factory-method="register" id="ffmpDataAccessRegister">
<constructor-arg value="ffmp" />
<constructor-arg ref="ffmpDataFactory" />
</bean>
</beans>

View file

@ -1,126 +0,0 @@
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;
}
}

View file

@ -1,466 +0,0 @@
/**
* 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;
}
}

View file

@ -1,941 +0,0 @@
/**
* 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);
}
}
}

View file

@ -1,339 +0,0 @@
/**
* 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);
}
}

View file

@ -1,66 +0,0 @@
/**
* 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);
}
}

View file

@ -1,73 +0,0 @@
/**
* 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);
}
}

View file

@ -1,145 +0,0 @@
/**
* 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;
}
}

View file

@ -1,600 +0,0 @@
/**
* 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;
}
}

View file

@ -1,153 +0,0 @@
/**
* 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);
}
}
}
}

View file

@ -1,138 +0,0 @@
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;
}
}

View file

@ -1,474 +0,0 @@
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.
}
}

View file

@ -1,299 +0,0 @@
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));
}
}
}

View file

@ -1,705 +0,0 @@
/**
* 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";
}
}

View file

@ -1,94 +0,0 @@
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();
}
}

View file

@ -1,127 +0,0 @@
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;
}
}

View file

@ -1,538 +0,0 @@
/**
* 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
*
* </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);
}
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();
}
}
}
}

View file

@ -1,144 +0,0 @@
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;
}
}

View file

@ -1,69 +0,0 @@
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;
}
}

View file

@ -1,89 +0,0 @@
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);
}
}

View file

@ -1,621 +0,0 @@
/**
* 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);
}
}
}

View file

@ -1,772 +0,0 @@
/**
* 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);
}
}

View file

@ -1,98 +0,0 @@
/**
* 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();
}
}

View file

@ -1,82 +0,0 @@
/**
* 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);
}
}

View file

@ -1,175 +0,0 @@
/**
* 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);
}
}
}

View file

@ -1,153 +0,0 @@
/**
* 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);
}
}

View file

@ -1,729 +0,0 @@
/**
* 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.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.PluginDataObject;
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
*
* </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 (String siteKey : siteKeysToDataKeys.keySet()) {
// 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);
}
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,
siteKeysToDataKeys.get(siteKey), 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 (Long pfaf : geomMap.keySet()) {
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(geomMap.get(pfaf));
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, PluginDataObject.DATAURI_ID };
}
@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 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();
}
}

View file

@ -1,275 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

View file

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

View file

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

View file

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

View file

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

View file

@ -1,274 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

View file

@ -1,12 +0,0 @@
<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>

View file

@ -1,635 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
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.
-->
<!--
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>

View file

@ -1,7 +0,0 @@
<?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>

View file

@ -1,28 +0,0 @@
<?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>

View file

@ -1,17 +0,0 @@
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

View file

@ -1,5 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
utility/,\
.

View file

@ -1,694 +0,0 @@
/**
* 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";
}
}

View file

@ -1,178 +0,0 @@
/**
* 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;
}
}

View file

@ -1,515 +0,0 @@
/**
* 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;
}
}

View file

@ -1,204 +0,0 @@
/**
* 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;
}
}

View file

@ -1,48 +0,0 @@
/**
* 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;
}
}

View file

@ -1,176 +0,0 @@
/**
* 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;
}
}

View file

@ -1,242 +0,0 @@
/**
* 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;
}
}

View file

@ -1,261 +0,0 @@
<!-- ====================
This is a colormap file that is read via JaXB to marshel 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>

View file

@ -1,7 +0,0 @@
<?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>

View file

@ -1,28 +0,0 @@
<?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>

Some files were not shown because too many files have changed in this diff Show more