(
+ categoryDirPatternList.size());
+
+ String filePatternStr = config.getFilePattern();
+ this.rootDir = rootDir;
+ this.isDirOnly = (filePatternStr == null)
+ || ".*".equals(filePatternStr);
+
+ for (String patternString : categoryDirPatternList) {
+ Pattern datePattern = null;
+ if (isDirOnly) {
+ datePattern = Pattern.compile(patternString);
+ } else {
+ datePattern = Pattern.compile(patternString + File.separator
+ + config.getFilePattern());
+ }
+ int dirSeparatorIndex = patternString.indexOf(File.separatorChar);
+ patternString = dirSeparatorIndex > patternString.length()
+ || dirSeparatorIndex < 0 ? patternString : patternString
+ .substring(0, dirSeparatorIndex);
+ Pattern categoryTopLevelDirPattern = Pattern.compile(patternString);
+ String[] indexValues = config.getDateGroupIndices().split(
+ "\\s*,\\s*");
+ int yearIndex = Integer.parseInt(indexValues[0]);
+ int monthIndex = Integer.parseInt(indexValues[1]);
+ int dayIndex = Integer.parseInt(indexValues[2]);
+ int hourIndex = Integer.parseInt(indexValues[3]);
+
+ dateInfoList.add(new CategoryDateInfo(datePattern,
+ categoryTopLevelDirPattern, yearIndex, monthIndex,
+ dayIndex, hourIndex));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.common.archive.config.IFileDateHelper#getFileDate(java
+ * .lang.String)
+ */
+ @Override
+ public Calendar getFileDate(String filenamePath) {
+ String pathForPatternCheck = filenamePath.substring(rootDir.length());
+ pathForPatternCheck = isDirOnly ? FilenameUtils
+ .getFullPathNoEndSeparator(pathForPatternCheck)
+ : pathForPatternCheck;
+ Calendar result = null;
+
+ for (CategoryDateInfo dateInfo : dateInfoList) {
+ Matcher matcher = dateInfo.datePattern.matcher(pathForPatternCheck);
+
+ if (matcher.matches()) {
+ int year = Integer.parseInt(matcher.group(dateInfo.yearIndex));
+ // Adjust month value to Calendar's 0 - 11
+ int month = Integer
+ .parseInt(matcher.group(dateInfo.monthIndex)) - 1;
+ int day = Integer.parseInt(matcher.group(dateInfo.dayIndex));
+ int hour = Integer.parseInt(matcher.group(dateInfo.hourIndex));
+
+ result = TimeUtil.newGmtCalendar();
+ result.set(year, month, day, hour, 0, 0);
+ break;
+ }
+ }
+ if (result == null) {
+ // no matching pattern, use file last modified date
+ File file = new File(filenamePath);
+ long lastModifiedMillis = file.lastModified();
+
+ result = TimeUtil.newGmtCalendar();
+ result.setTimeInMillis(lastModifiedMillis);
+ }
+ return result;
+ }
+
+ /**
+ * Check if this directory is a category directory. i.e. if the category is
+ * satellite, is the directory satellite.
+ *
+ * @param dirName
+ * @return true if category directory; false otherwise.
+ */
+ public boolean isCategoryDirectory(String dirName) {
+ for (CategoryDateInfo dateInfo : dateInfoList) {
+ if (dateInfo.categoryTopLevelDirPattern.matcher(dirName).matches()) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java
new file mode 100644
index 0000000000..16dc9fd732
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java
@@ -0,0 +1,125 @@
+/**
+ * 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.archive.config;
+
+import java.io.File;
+import java.util.Calendar;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.filefilter.IOFileFilter;
+
+import com.raytheon.uf.common.time.util.TimeUtil;
+
+/**
+ * Filter files based on a file date parsed using the given file date helper.
+ * Accept returns true for files that fall between the Start and End times. If
+ * start is null, then all after start checks will return true. If end is null,
+ * then all before end checks will return true.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 18, 2013 1965 bgonzale Initial creation
+ *
+ *
+ *
+ * @author bgonzale
+ * @version 1.0
+ */
+
+public class FileDateFilter implements IOFileFilter {
+
+ private IFileDateHelper helper;
+
+ private final Calendar start;
+
+ private final Calendar end;
+
+ /**
+ * Initialization constructor. This filter uses file last modified time as
+ * the filter time.
+ *
+ * @param startDate
+ * @param endDate
+ */
+ public FileDateFilter(Calendar start, Calendar end) {
+ this(start, end, DEFAULT_FILE_DATE_HELPER);
+ }
+
+ /**
+ * Initialization constructor.
+ *
+ * @param startDate
+ * @param endDate
+ * @param helper
+ */
+ public FileDateFilter(Calendar start, Calendar end, IFileDateHelper helper) {
+ this.helper = helper == null ? DEFAULT_FILE_DATE_HELPER : helper;
+ this.start = start;
+ this.end = end;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.commons.io.filefilter.IOFileFilter#accept(java.io.File)
+ */
+ @Override
+ public boolean accept(File file) {
+ String filePath = file.getAbsolutePath();
+ String dirName = FilenameUtils.getFullPath(filePath);
+ String fileName = FilenameUtils.getName(filePath);
+ return accept(new File(dirName), fileName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.commons.io.filefilter.IOFileFilter#accept(java.io.File, java.lang.String)
+ */
+ @Override
+ public boolean accept(File dir, String name) {
+ String dirPath = dir.getAbsolutePath();
+ boolean endsWithSeparator = dirPath.endsWith(File.separator);
+ dirPath = endsWithSeparator ? dirPath : dirPath + File.separator;
+ String fileFullPath = dirPath + name;
+ Calendar fileDate = helper.getFileDate(fileFullPath);
+ boolean isAfterEqualsStart = start == null || fileDate.after(start)
+ || fileDate.equals(start);
+ boolean isBeforeEqualsEnd = end == null || fileDate.before(end)
+ || fileDate.equals(end);
+ return isAfterEqualsStart && isBeforeEqualsEnd;
+ }
+
+ /**
+ * This File Date helper returns a file's last modified time.
+ */
+ private static final IFileDateHelper DEFAULT_FILE_DATE_HELPER = new IFileDateHelper() {
+ @Override
+ public Calendar getFileDate(String filenamePath) {
+ // use file last modified date
+ File file = new File(filenamePath);
+ long lastModifiedMillis = file.lastModified();
+ Calendar result = TimeUtil.newGmtCalendar();
+ result.setTimeInMillis(lastModifiedMillis);
+ return result;
+ }
+ };
+
+}
diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java
new file mode 100644
index 0000000000..16a4f24d0c
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java
@@ -0,0 +1,45 @@
+/**
+ * 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.archive.config;
+
+import java.util.Calendar;
+
+/**
+ * Helper to get a file last modification date.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 21, 2013 bgonzale Initial creation
+ *
+ *
+ *
+ * @author bgonzale
+ * @version 1.0
+ */
+
+public interface IFileDateHelper {
+
+ public Calendar getFileDate(String filenamePath);
+
+}
diff --git a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java
index 1f7ef46ae1..3889f5e143 100644
--- a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java
+++ b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java
@@ -35,6 +35,7 @@ import javax.xml.bind.annotation.XmlElement;
import com.raytheon.uf.common.colormap.AbstractColorMap;
import com.raytheon.uf.common.colormap.Color;
import com.raytheon.uf.common.colormap.IColorMap;
+import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences;
import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences.DataMappingEntry;
import com.raytheon.uf.common.serialization.ISerializableObject;
@@ -53,6 +54,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
* Feb 14, 2013 1616 bsteffen Add option for interpolation of
* colormap parameters, disable colormap
* interpolation by default.
+ * Jun 14, 2013 DR 16070 jgerth Utilize data mapping
*
*
*
@@ -908,7 +910,18 @@ public class ColorMapParameters implements Cloneable, ISerializableObject {
if (colorMapRange != 0.0) {
double pixelValue;
- if (displayToImage != null) {
+ // START DR 16070 fix
+ if (this.dataMapping != null)
+ if (this.dataMapping.getEntries() != null)
+ if (this.dataMapping.getEntries().get(0) != null)
+ if (this.dataMapping.getEntries().get(0).getOperator() != null)
+ if (this.dataMapping.getEntries().get(0).getOperator().equals("i")) {
+ Double dValue = this.dataMapping.getDataValueforNumericValue(dispValue);
+ if (dValue != null)
+ return (dValue.floatValue() - colorMapMin) / colorMapRange;
+ }
+ // END fix
+ if (displayToImage != null) {
pixelValue = displayToImage.convert(dispValue);
} else {
pixelValue = dispValue;
diff --git a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/DataMappingPreferences.java b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/DataMappingPreferences.java
index 7b0c86c1fb..da3a217e7c 100644
--- a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/DataMappingPreferences.java
+++ b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/DataMappingPreferences.java
@@ -37,7 +37,7 @@ import com.raytheon.uf.common.units.PiecewisePixel;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- *
+ * 6/2013 DR 16070 jgerth Interpolation capability
*
*
*
@@ -47,6 +47,8 @@ import com.raytheon.uf.common.units.PiecewisePixel;
@XmlAccessorType(XmlAccessType.NONE)
public class DataMappingPreferences {
+ private String formatString;
+
@XmlAccessorType(XmlAccessType.NONE)
public static class DataMappingEntry implements
Comparable {
@@ -177,6 +179,7 @@ public class DataMappingPreferences {
private final ArrayList greaterThanEntries = new ArrayList();
private final ArrayList lessThanEntries = new ArrayList();
private final ArrayList equalsEntries = new ArrayList();
+ private final ArrayList interpEntries = new ArrayList();
private Unit> imageUnit;
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -248,10 +251,28 @@ public class DataMappingPreferences {
} else if ("<".equals(operator)) {
lessThanEntries.add(entry);
Collections.sort(lessThanEntries);
+ } else if ("i".equals(operator)) {
+ interpEntries.add(entry);
}
}
}
+ /**
+ * Matches a number against the pixelValue and displays value to the
+ * number of decimal places set in formatString
+ *
+ * DR 16070
+ *
+ * @param dataValue
+ * @param formatString
+ * @return
+ */
+ public String getLabelValueForDataValue(double dataValue,
+ String formatString) {
+ this.setFormatString(formatString);
+ return this.getLabelValueForDataValue(dataValue);
+ }
+
/**
* Matches a number against the pixelValue in each entry based on the
* operator until the first match is found.
@@ -281,7 +302,96 @@ public class DataMappingPreferences {
return entry.getLabel();
}
}
+ // START DR 16070 fix
+ Double interpValue = this.getNumericValueforDataValue(dataValue);
+ int ies = interpEntries.size();
+ for (int i = 1; i < ies; i++) {
+ Double pixelValue1 = interpEntries.get(i - 1).getPixelValue();
+ Double pixelValue2 = interpEntries.get(i).getPixelValue();
+ if ((dataValue >= pixelValue1) && (dataValue <= pixelValue2)) {
+ if (this.getFormatString() != null)
+ return String.format("%." + this.getFormatString() + "f%s",
+ interpValue, interpEntries.get(i).getLabel());
+ else
+ return String.format("%.1f%s", interpValue, interpEntries
+ .get(i).getLabel());
+ }
+ }
+ // END fix
return null;
}
+ /**
+ * Get numeric value for data value
+ *
+ * DR 16070
+ */
+ public Double getNumericValueforDataValue(double dataValue) {
+ Double interpValue;
+ int ies = interpEntries.size();
+ for (int i = 1; i < ies; i++) {
+ Double pixelValue1 = interpEntries.get(i - 1).getPixelValue();
+ Double pixelValue2 = interpEntries.get(i).getPixelValue();
+ Double displValue1 = interpEntries.get(i - 1).getDisplayValue();
+ Double displValue2 = interpEntries.get(i).getDisplayValue();
+ if ((dataValue >= pixelValue1) && (dataValue <= pixelValue2)) {
+ interpValue = displValue1 + (dataValue - pixelValue1)
+ / (pixelValue2 - pixelValue1)
+ * (displValue2 - displValue1);
+ return interpValue;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get data value for numeric value
+ *
+ * DR 16070
+ */
+ public Double getDataValueforNumericValue(double numericValue) {
+ Double interpValue;
+ int ies = interpEntries.size();
+ for (int i = 1; i < ies; i++) {
+ Double pixelValue1 = interpEntries.get(i - 1).getPixelValue();
+ Double pixelValue2 = interpEntries.get(i).getPixelValue();
+ Double displValue1 = interpEntries.get(i - 1).getDisplayValue();
+ Double displValue2 = interpEntries.get(i).getDisplayValue();
+ if (displValue1 > displValue2) {
+ if ((numericValue <= displValue1) && (numericValue >= displValue2)) {
+ interpValue = pixelValue1 + (numericValue - displValue1)
+ / (displValue2 - displValue1)
+ * (pixelValue2 - pixelValue1);
+ return interpValue;
+ }
+ } else {
+ if ((numericValue >= displValue1) && (numericValue <= displValue2)) {
+ interpValue = pixelValue1 + (numericValue - displValue1)
+ / (displValue2 - displValue1)
+ * (pixelValue2 - pixelValue1);
+ return interpValue;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Set formatString
+ *
+ * DR 16070
+ */
+ public void setFormatString(String formatString) {
+ this.formatString = formatString;
+ }
+
+ /**
+ * Get formatString
+ *
+ * DR 16070
+ */
+ public String getFormatString() {
+ return formatString;
+ }
+
}
diff --git a/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archivepurger-spring.xml b/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archivepurger-spring.xml
index 2a44f644d6..8dd6192d7d 100644
--- a/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archivepurger-spring.xml
+++ b/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archivepurger-spring.xml
@@ -9,7 +9,7 @@
xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
+ uri="clusteredquartz://archive/archivePurgeScheduled/?cron=${archive.purge.cron}" />
diff --git a/edexOsgi/com.raytheon.uf.edex.archive/resources/archivePurger.properties b/edexOsgi/com.raytheon.uf.edex.archive/resources/archivePurger.properties
deleted file mode 100644
index 78ade270dd..0000000000
--- a/edexOsgi/com.raytheon.uf.edex.archive/resources/archivePurger.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-# purge every half hour
-archivePurge.cron=0+0/30,*,*,*,*,*+*+*+*+?
diff --git a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archive/PROCESSED_DATA.xml b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archive/PROCESSED_DATA.xml
index b719f63b81..7ec34bdc8a 100644
--- a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archive/PROCESSED_DATA.xml
+++ b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archive/PROCESSED_DATA.xml
@@ -18,6 +18,16 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
+
+