* SOFTWARE HISTORY * Date Ticket# Engineer Description @@ -30,14 +30,15 @@ package com.raytheon.edex.plugin.radar.dao; * Feb 06, 2009 1990 bphillip Initial creation * Mar 18, 2013 1804 bsteffen Reduce useless data stored in radar hdf5 * Aug 30, 2013 2298 rjpeter Make getPluginName abstract - * + * Aug 14, 2014 3393 nabowle Remove broken getFullRecord override. + * Aug 19, 2014 3393 nabowle Default constructor. + * *- * + * * @author bphillip * @version 1.0 */ import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -48,10 +49,6 @@ import com.raytheon.uf.common.dataplugin.radar.RadarDataKey; import com.raytheon.uf.common.dataplugin.radar.RadarDataPoint; import com.raytheon.uf.common.dataplugin.radar.RadarRecord; import com.raytheon.uf.common.dataplugin.radar.RadarStoredData; -import com.raytheon.uf.common.dataplugin.radar.level3.GSMBlock.GSMMessage; -import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock; -import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyBlock; -import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants; import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants.MapValues; import com.raytheon.uf.common.dataplugin.radar.util.RadarDataRetriever; import com.raytheon.uf.common.datastorage.IDataStore; @@ -62,17 +59,24 @@ import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.ShortDataRecord; import com.raytheon.uf.common.serialization.DynamicSerializationManager; import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType; -import com.raytheon.uf.common.serialization.SerializationException; -import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.edex.core.dataplugin.PluginRegistry; import com.raytheon.uf.edex.database.plugin.PluginDao; -import com.raytheon.uf.edex.database.query.DatabaseQuery; public class RadarDao extends PluginDao { + /** + * Creates a new radar dao. Equivalent to RadarDao("radar"). + * + * @throws PluginException + * If the dao cannot be initialized + */ + public RadarDao() throws PluginException { + super("radar"); + } + /** * Creates a new radar dao - * + * * @param pluginName * "radar" * @throws PluginException @@ -270,38 +274,6 @@ public class RadarDao extends PluginDao { return retVal; } - @Override - public PluginDataObject[] getFullRecord(DatabaseQuery query, int tile) - throws PluginException { - PluginDataObject[] queryResults = getMetadata(query); - for (PluginDataObject obj : queryResults) { - RadarRecord record = (RadarRecord) obj; - IDataRecord[] hdf5Data = getHDF5Data(record, tile); - record.setMessageData(hdf5Data[0].getDataObject()); - record.setAngleData((float[]) hdf5Data[1].getDataObject()); - record.setThresholds((short[]) hdf5Data[2].getDataObject()); - record.setProductDependentValues((short[]) hdf5Data[8] - .getDataObject()); - - record.setProductVals((HashMap
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Aug 7, 2014 3393 nabowle Initial creation + * + *+ * + * @author nabowle + * @version 1.0 + */ +public class GetRadarDataRecordHandler implements + IRequestHandler
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Aug 7, 2014 3393 nabowle Initial creation + * + *+ * + * @author nabowle + * @version 1.0 + */ +@DynamicSerialize +public class GetRadarDataRecordRequest implements IServerRequest { + + /** The ICAO id of the radar. */ + @DynamicSerializeElement + private String radarId; + + /** The product code. */ + @DynamicSerializeElement + private int productCode; + + /** The primary elevation angle. */ + @DynamicSerializeElement + private double primaryElevationAngle; + + /** The datetime range. */ + @DynamicSerializeElement + private TimeRange timeRange; + + /** + * Constructor. + */ + public GetRadarDataRecordRequest() { + super(); + } + + /** + * @return the radarId + */ + public String getRadarId() { + return radarId; + } + + /** + * @param radarId + * the radarId to set + */ + public void setRadarId(String radarId) { + this.radarId = radarId; + } + + /** + * @return the productCode + */ + public int getProductCode() { + return productCode; + } + + /** + * @param productCode + * the productCode to set + */ + public void setProductCode(int productCode) { + this.productCode = productCode; + } + + /** + * @return the primaryElevationAngle + */ + public double getPrimaryElevationAngle() { + return primaryElevationAngle; + } + + /** + * @param primaryElevationAngle + * the primaryElevationAngle to set + */ + public void setPrimaryElevationAngle(double primaryElevationAngle) { + this.primaryElevationAngle = primaryElevationAngle; + } + + /** + * @return the timeRange + */ + public TimeRange getTimeRange() { + return timeRange; + } + + /** + * @param timeRange + * the timeRange to set + */ + public void setTimeRange(TimeRange timeRange) { + this.timeRange = timeRange; + } +} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.java b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.java new file mode 100644 index 0000000000..94377babb8 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.java @@ -0,0 +1,80 @@ +/** + * 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.radar.response; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * Response object to a GetRadarHDF5Request. + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Aug 7, 2014 3393 nabowle Initial creation + * + *+ * + * @author nabowle + * @version 1.0 + */ +@DynamicSerialize +public class GetRadarDataRecordResponse { + + @DynamicSerializeElement + private RadarDataRecord[] data; + + /** + * Constructor. + */ + public GetRadarDataRecordResponse() { + super(); + } + + /** + * Constructor. + * + * @param datas + * The response data. + */ + public GetRadarDataRecordResponse(RadarDataRecord... datas) { + super(); + this.data = datas; + } + + /** + * @return the data + */ + public RadarDataRecord[] getData() { + return data; + } + + /** + * @param data + * the data to set + */ + public void setData(RadarDataRecord[] data) { + this.data = data; + } + +} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.java new file mode 100644 index 0000000000..adeab21cbb --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.java @@ -0,0 +1,200 @@ +/** + * 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.radar.response; + +import com.raytheon.uf.common.datastorage.records.IDataRecord; +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.common.time.DataTime; + +/** + * A data object for a single radar record. The IDataRecords and a subset of the + * radar fields are available. + * + * String fields are used to match MSAS/LAPS uEngine precision for side by side + * comparison. + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Aug 7, 2014 3393 nabowle Initial creation + * + *+ * + * @author nabowle + * @version 1.0 + */ +@DynamicSerialize +public class RadarDataRecord { + + @DynamicSerializeElement + private IDataRecord[] hdf5Data; + + @DynamicSerializeElement + private DataTime dataTime; + + @DynamicSerializeElement + private String latitude; + + @DynamicSerializeElement + private String longitude; + + @DynamicSerializeElement + private String elevation; + + @DynamicSerializeElement + private String elevationNumber; + + @DynamicSerializeElement + private String trueElevationAngle; + + @DynamicSerializeElement + private String volumeCoveragePattern; + + /** + * Constructor. + */ + public RadarDataRecord() { + super(); + } + + /** + * @return the hdf5Data + */ + public IDataRecord[] getHdf5Data() { + return hdf5Data; + } + + /** + * @param hdf5Data + * the hdf5Data to set + */ + public void setHdf5Data(IDataRecord[] hdf5Data) { + this.hdf5Data = hdf5Data; + } + + /** + * @return the dataTime + */ + public DataTime getDataTime() { + return dataTime; + } + + /** + * @param dataTime + * the dataTime to set + */ + public void setDataTime(DataTime dataTime) { + this.dataTime = dataTime; + } + + /** + * @return the latitude + */ + public String getLatitude() { + return latitude; + } + + /** + * @param latitude + * the latitude to set + */ + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + /** + * @return the longitude + */ + public String getLongitude() { + return longitude; + } + + /** + * @param longitude + * the longitude to set + */ + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + /** + * @return the elevation + */ + public String getElevation() { + return elevation; + } + + /** + * @param elevation + * the elevation to set + */ + public void setElevation(String elevation) { + this.elevation = elevation; + } + + /** + * @return the elevationNumber + */ + public String getElevationNumber() { + return elevationNumber; + } + + /** + * @param elevationNumber + * the elevationNumber to set + */ + public void setElevationNumber(String elevationNumber) { + this.elevationNumber = elevationNumber; + } + + /** + * @return the trueElevationAngle + */ + public String getTrueElevationAngle() { + return trueElevationAngle; + } + + /** + * @param trueElevationAngle + * the trueElevationAngle to set + */ + public void setTrueElevationAngle(String trueElevationAngle) { + this.trueElevationAngle = trueElevationAngle; + } + + /** + * @return the volumeCoveragePattern + */ + public String getVolumeCoveragePattern() { + return volumeCoveragePattern; + } + + /** + * @param volumeCoveragePattern + * the volumeCoveragePattern to set + */ + public void setVolumeCoveragePattern(String volumeCoveragePattern) { + this.volumeCoveragePattern = volumeCoveragePattern; + } +} diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py index 3effe594ce..2c3b901e78 100644 --- a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py @@ -25,7 +25,8 @@ __all__ = [ 'grib', 'grid', 'level', - 'message' + 'message', + 'radar' ] diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py new file mode 100644 index 0000000000..daea64e073 --- /dev/null +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py @@ -0,0 +1,28 @@ +## +# 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. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'request', + 'response' + ] + + diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py new file mode 100644 index 0000000000..97d5ba6397 --- /dev/null +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py @@ -0,0 +1,62 @@ +## +# 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. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Aug 19, 2014 nabowle Generated + +import numpy + +class GetRadarDataRecordRequest(object): + + def __init__(self): + self.timeRange = None + self.productCode = None + self.radarId = None + self.primaryElevationAngle = None + + def getTimeRange(self): + return self.timeRange + + def setTimeRange(self, timeRange): + self.timeRange = timeRange + + def getProductCode(self): + return self.productCode + + def setProductCode(self, productCode): + self.productCode = productCode + + def getRadarId(self): + return self.radarId + + def setRadarId(self, radarId): + self.radarId = radarId + + def getPrimaryElevationAngle(self): + return self.primaryElevationAngle + + def setPrimaryElevationAngle(self, primaryElevationAngle): + self.primaryElevationAngle = numpy.float64(primaryElevationAngle) + diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py new file mode 100644 index 0000000000..b86afc0c3b --- /dev/null +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py @@ -0,0 +1,28 @@ +## +# 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. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'GetRadarDataRecordRequest' + ] + +from GetRadarDataRecordRequest import GetRadarDataRecordRequest + diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py new file mode 100644 index 0000000000..c5bfd9a6d9 --- /dev/null +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py @@ -0,0 +1,39 @@ +## +# 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. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Aug 19, 2014 nabowle Generated + +class GetRadarDataRecordResponse(object): + + def __init__(self): + self.data = None + + def getData(self): + return self.data + + def setData(self, data): + self.data = data + diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py new file mode 100644 index 0000000000..c9901f665b --- /dev/null +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py @@ -0,0 +1,88 @@ +## +# 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. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Aug 19, 2014 nabowle Generated + +class RadarDataRecord(object): + + def __init__(self): + self.hdf5Data = None + self.trueElevationAngle = None + self.elevationNumber = None + self.elevation = None + self.longitude = None + self.latitude = None + self.dataTime = None + self.volumeCoveragePattern = None + + def getHdf5Data(self): + return self.hdf5Data + + def setHdf5Data(self, hdf5Data): + self.hdf5Data = hdf5Data + + def getTrueElevationAngle(self): + return self.trueElevationAngle + + def setTrueElevationAngle(self, trueElevationAngle): + self.trueElevationAngle = trueElevationAngle + + def getElevationNumber(self): + return self.elevationNumber + + def setElevationNumber(self, elevationNumber): + self.elevationNumber = elevationNumber + + def getElevation(self): + return self.elevation + + def setElevation(self, elevation): + self.elevation = elevation + + def getLongitude(self): + return self.longitude + + def setLongitude(self, longitude): + self.longitude = longitude + + def getLatitude(self): + return self.latitude + + def setLatitude(self, latitude): + self.latitude = latitude + + def getDataTime(self): + return self.dataTime + + def setDataTime(self, dataTime): + self.dataTime = dataTime + + def getVolumeCoveragePattern(self): + return self.volumeCoveragePattern + + def setVolumeCoveragePattern(self, volumeCoveragePattern): + self.volumeCoveragePattern = volumeCoveragePattern + diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py new file mode 100644 index 0000000000..69a045eb8c --- /dev/null +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py @@ -0,0 +1,30 @@ +## +# 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. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'GetRadarDataRecordResponse', + 'RadarDataRecord' + ] + +from GetRadarDataRecordResponse import GetRadarDataRecordResponse +from RadarDataRecord import RadarDataRecord + diff --git a/pythonPackages/msaslaps/radar/a2advrad.csh b/pythonPackages/msaslaps/radar/a2advrad.csh index 00abd6b947..f9f0bfc93d 100644 --- a/pythonPackages/msaslaps/radar/a2advrad.csh +++ b/pythonPackages/msaslaps/radar/a2advrad.csh @@ -1,4 +1,24 @@ #!/bin/csh +## +# 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. +## + # # A script wrapper that is meant to get data for a single radar product # from the A-II database. The result is output to stdout as ASCII. @@ -22,7 +42,7 @@ # # Usage: # -# a2gtrad.csh {p} {x} radar msgcode {elev} date time {slop} +# a2advrad.csh {p} {x} radar msgcode {elev} date time {slop} # # p - A literal p. (optional) # x - A literal x. (optional) Expanded set of header information. @@ -37,8 +57,16 @@ # # The literal p option means preserve the final version of the python # submitted to the UEngine instead of cleaning it up. The path to the -# finalized python is /tmp/a2gtradNNNNN.py where NNNNN is a unix process id. +# finalized python is /tmp/a2advradNNNNN.py where NNNNN is a unix process id. # +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 08/07/2014 3393 nabowle Initial modification. Passes parameters straight to +# non-uengine script instead of sed. Remove use of gtasUtil +# if not using the uengine stub. +# # set rmpy = yes set fff = "" @@ -71,37 +99,49 @@ set fxa_home = $FXA_HOME if ( $?STAGING ) then set fxa_home = $STAGING/D-2D endif -# -# Set up the environment we need to run the UEngine. -# -if ( -e ./UEngine.cshsrc ) then - set ueenv = ./UEngine.cshsrc -else if ( -e $mydir/UEngine.cshsrc ) then - set ueenv = $mydir/UEngine.cshsrc -else if ( -e $fxa_home/src/dm/point/UEngine.cshsrc ) then - set ueenv = $fxa_home/src/dm/point/UEngine.cshsrc -else if ( -e $FXA_HOME/bin/UEngine.cshsrc ) then - set ueenv = $FXA_HOME/bin/UEngine.cshsrc -else - bash -c "echo could not find UEngine.cshsrc 1>&2" - exit -endif -source $ueenv + # # Locate python stub that we will modify to create the final UEngine script # -if ( -e ./a2gtradStub.py ) then - set stubpy = ./a2gtradStub.py -else if ( -e $mydir/a2gtradStub.py ) then - set stubpy = $mydir/a2gtradStub.py -else if ( -e $fxa_home/src/dm/radar/a2gtradStub.py ) then - set stubpy = $fxa_home/src/dm/radar/a2gtradStub.py -else if ( -e $FXA_HOME/bin/a2gtradStub.py ) then - set stubpy = $FXA_HOME/bin/a2gtradStub.py +if ( -e ./a2advradStub.py ) then + set stubpy = ./a2advradStub.py +else if ( -e $mydir/a2advradStub.py ) then + set stubpy = $mydir/a2advradStub.py +else if ( -e $fxa_home/src/dm/radar/a2advradStub.py ) then + set stubpy = $fxa_home/src/dm/radar/a2advradStub.py +else if ( -e $FXA_HOME/bin/a2advradStub.py ) then + set stubpy = $FXA_HOME/bin/a2advradStub.py else - bash -c "echo could not find a2gtradStub.py 1>&2" + bash -c "echo could not find a2advradStub.py 1>&2" exit endif + +# +# Determine if we are using the data access framework or the uEngine. +# +grep DataAccessLayer $stubpy >& /dev/null +if ( $status == 0 ) then + set method = "daf" +else + # + # Set up the environment we need to run the UEngine. + # + set method = "uengine" + if ( -e ./UEngine.cshsrc ) then + set ueenv = ./UEngine.cshsrc + else if ( -e $mydir/UEngine.cshsrc ) then + set ueenv = $mydir/UEngine.cshsrc + else if ( -e $FXA_HOME/src/dm/point/UEngine.cshsrc ) then + set ueenv = $FXA_HOME/src/dm/point/UEngine.cshsrc + else if ( -e $FXA_HOME/bin/UEngine.cshsrc ) then + set ueenv = $FXA_HOME/bin/UEngine.cshsrc + else + bash -c "echo could not find UEngine.cshsrc 1>&2" + exit + endif + source $ueenv +endif + # # Locate file that lets us provide a description of the data set. # @@ -124,49 +164,69 @@ set mmm = $2 shift shift set ddd = `echo $mmm | sed -f $mctrans | cut '-d|' -f2 ` -# -# Get program that can do math with ascii time string, then use this to -# properly encode range of times for which we look for data. -# -if ( -x ./gtasUtil ) then - set gtasUtil = ./gtasUtil -else if ( -x $mydir/gtasUtil ) then - set gtasUtil = $mydir/gtasUtil -else if ( -x $fxa_home/src/dm/point/gtasUtil ) then - set gtasUtil = $fxa_home/src/dm/point/gtasUtil -else if ( -x $FXA_HOME/bin/gtasUtil ) then - set gtasUtil = $FXA_HOME/bin/gtasUtil -else - bash -c "echo could not find gtasUtil executable 1>&2" - exit -endif + set eee = `echo $1 | grep -v '.*-'` if ( "$eee" != "" ) shift set slop = `echo $3 | grep '[0-9]'` if ( "$slop" == "" ) set slop = 60 -set aaa = `$gtasUtil = $1 $2 -$slop` -set bbb = `$gtasUtil = $1 $2 $slop` -# -# Modify the text of special tags in stub to create finalized script. -# -set specpy = /tmp/a2gtrad${$}.py -rm -rf $specpy >& /dev/null -touch $specpy -chmod 775 $specpy -if ( "$eee" == "" ) then - cat $stubpy | sed "s/KKKK/$rrr/g" | sed "s/MMMM/$mmm/g" | \ - sed "s/AAAAA/$aaa/g" | sed "s/BBBBB/$bbb/g" | sed "s/FFF/$fff/g" | \ - sed "s/DDDDD/$ddd/g" | sed 's/^.*EEEE.*$//g' >> $specpy + + +if ( "$method" == "daf" ) then + set datetime = $1' '$2 + set opts = "" + + if ( "$eee" != "" ) then + set opts = "$opts --angle $eee" + endif + + if ( "$fff" == "x" ) then + set opts = "$opts --extended" + endif + + /awips2/python/bin/python $stubpy --radar $rrr --code $mmm --datetime="${datetime}" --slop $slop --description="${ddd}" $opts else - cat $stubpy | sed "s/KKKK/$rrr/g" | sed "s/MMMM/$mmm/g" | \ - sed "s/AAAAA/$aaa/g" | sed "s/BBBBB/$bbb/g" | sed "s/FFF/$fff/g" | \ - sed "s/DDDDD/$ddd/g" | sed "s/EEEE/$eee/g" >> $specpy + # + # Get program that can do math with ascii time string, then use this to + # properly encode range of times for which we look for data. + # + if ( -x ./gtasUtil ) then + set gtasUtil = ./gtasUtil + else if ( -x $mydir/gtasUtil ) then + set gtasUtil = $mydir/gtasUtil + else if ( -x $fxa_home/src/dm/point/gtasUtil ) then + set gtasUtil = $fxa_home/src/dm/point/gtasUtil + else if ( -x $FXA_HOME/bin/gtasUtil ) then + set gtasUtil = $FXA_HOME/bin/gtasUtil + else + bash -c "echo could not find gtasUtil executable 1>&2" + exit + endif + + set aaa = `$gtasUtil = $1 $2 -$slop` + set bbb = `$gtasUtil = $1 $2 $slop` + + # + # Modify the text of special tags in stub to create finalized script. + # + set specpy = /tmp/a2advrad${$}.py + rm -rf $specpy >& /dev/null + touch $specpy + chmod 775 $specpy + if ( "$eee" == "" ) then + cat $stubpy | sed "s/KKKK/$rrr/g" | sed "s/MMMM/$mmm/g" | \ + sed "s/AAAAA/$aaa/g" | sed "s/BBBBB/$bbb/g" | sed "s/FFF/$fff/g" | \ + sed "s/DDDDD/$ddd/g" | sed 's/^.*EEEE.*$//g' >> $specpy + else + cat $stubpy | sed "s/KKKK/$rrr/g" | sed "s/MMMM/$mmm/g" | \ + sed "s/AAAAA/$aaa/g" | sed "s/BBBBB/$bbb/g" | sed "s/FFF/$fff/g" | \ + sed "s/DDDDD/$ddd/g" | sed "s/EEEE/$eee/g" >> $specpy + endif + # + # Submit the temporary python script stripping xml stuff, then remove it + # + cd $UE_BIN_PATH + ( uengine -r python < $specpy ) | grep -v '<' | sed 's/>/>/g' | \ + sed 's/</& /dev/null endif # -# Submit the temporary python script stripping xml stuff, then remove it -# -cd $UE_BIN_PATH -( uengine -r python < $specpy ) | grep -v '<' | sed 's/>/>/g' | \ - sed 's/</& /dev/null -# diff --git a/pythonPackages/msaslaps/radar/a2advradStub.py b/pythonPackages/msaslaps/radar/a2advradStub.py index fd29c875f0..06dda8fb6a 100644 --- a/pythonPackages/msaslaps/radar/a2advradStub.py +++ b/pythonPackages/msaslaps/radar/a2advradStub.py @@ -1,177 +1,128 @@ -import BaseRequest -from com.raytheon.uf.common.message.response import ResponseMessageGeneric -from com.raytheon.edex.plugin.radar.dao import RadarDao - -# Perform a radar request for data of interest -rr = BaseRequest.BaseRequest("radar") -rr.addParameter("icao","KKKK","=") -rr.addParameter("productCode","MMMM","=") -rr.addParameter("primaryElevationAngle","EEEE","=") -rr.addParameter("dataTime","AAAAA",">=") -rr.addParameter("dataTime","BBBBB","<=") -hedfmt = "FFF" - -result = rr.execute() -size = result.size() -if size == 0: - return ResponseMessageGeneric("Data not available") - -# ResponseMessageGeneric. Payload is RadarRecord -rmg = result.get(0) -# return rmg - -# RadarRecord -rrec = rmg.getContents() +## +# 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. +## # -# From here to the end is the part we know how to do for radar but not -# for radar. +# Gets data for a single radar product from the A-II database. The result is +# output to stdout as ASCII. This uses a data-specific Request/Response instead +# of the DataAccessLayer in order to preserve data-genericness of the interface. +# +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 08/13/2014 3393 nabowle Initial modification. Replaces UEngine +# with a custom Request/Response. +# # -mytime = rrec.getDataURI().split('/',4)[2] -# RadarDao. Inherits from PluginDao, which has a getHDF5Data method, -# which takes a PluginDataObject as an arg. -raddao = RadarDao("radar") +import argparse +import a2radcommon -# returns IDataRecord[]. IDataRecord is implemented by only one class -- -# AbstractStorageRecord. ASR is extended by a few *DataRecord classes; one -# of them is ByteDataRecord -idra = raddao.getHDF5Data(rrec,-1) +def get_args(): + parser = a2radcommon.get_args_parser() + parser.add_argument("--extended", action='store_true', default=False, + dest="extended", help="Output the extended header.") + return parser.parse_args() -msg = "No data." -if len(idra) > 0: - # pick radar Data record - # record 0 contains Angles getFloatData - # record 1 contains Data getByteData - # record 2 contains DependentValues getShortData - # record 3 contains ProductVals getByteData - # record 4 contains RecordVals getByteData - # record 5 contains StormIds getByteData - # record 6 contains Symbology getByteData - # record 7 contains SymbologyData getByteData - # record 8 contains Thresholds getShortData - dattyp = "raster" - for ii in range(len(idra)): - if idra[ii].getName() == "Data": - rdat = idra[ii] - elif idra[ii].getName() == "Angles": - azdat = idra[ii] - dattyp = "radial" - elif idra[ii].getName() == "DependentValues": - depVals = idra[ii].getShortData() -# elif idra[ii].getName() == "ProductVals": -# prodVals = idra[ii].getByteData() -# elif idra[ii].getName() == "RecordVals": -# recVals = idra[ii].getByteData() -# elif idra[ii].getName() == "StormIds": -# stormVals = idra[ii].getByteData() -# elif idra[ii].getName() == "Symbology": -# symVals = idra[ii].getByteData() -# elif idra[ii].getName() == "SymbologyData": -# symData = idra[ii].getByteData() - elif idra[ii].getName() == "Thresholds": - threshVals = idra[ii].getShortData() - # this hints at the IDR's concrete class: ByteDataRecord - #print "true type of IDataRecord:", idr.getDataObject().toString() +def main(): + user_args = get_args() - dim = rdat.getDimension() - if dim != 2: - return ResponseMessageGeneric(msg) + records = a2radcommon.send_request(user_args) - yLen = rdat.getSizes()[0] - xLen = rdat.getSizes()[1] + if not records: + # print "Data not available" + return - # byte[] -- the raw data - array = rdat.getByteData() - arraySize = len(array) - if xLen * yLen != arraySize: - return ResponseMessageGeneric(msg) + description = user_args.description + if not description: + print >> sys.stderr, "Description not provided" + return - # get data for azimuth angles if we have them. - if dattyp == "radial" : - azVals = azdat.getFloatData() - azValsLen = len(azVals) - if yLen != azValsLen: - return ResponseMessageGeneric(msg) - description = "DDDDD" + format = user_args.extended - # Encode dimensions, time, mapping, description, tilt, and VCP - if hedfmt == "x" : - msg = "\n"+ str(xLen) + " " + str(yLen) + " " + mytime + " " + \ - dattyp + " " + str(rrec.getLatitude()) + " " + \ - str(rrec.getLongitude()) + " " + \ - str(rrec.getElevation()) + " " + \ - str(rrec.getElevationNumber()) + " " + \ - description + " " + str(rrec.getTrueElevationAngle()) + " " + \ - str(rrec.getVolumeCoveragePattern()) + "\n" - else : - msg = "\n"+ str(xLen) + " " + str(yLen) + " " + mytime + " " + \ - dattyp + " " + description + " " + \ - str(rrec.getTrueElevationAngle()) + " " + \ - str(rrec.getVolumeCoveragePattern()) + "\n" - - # Encode level labels - spec = [".", "TH", "ND", "RF", "BI", "GC", "IC", "GR", "WS", "DS", - "RA", "HR", "BD", "HA", "UK"] - nnn = len(threshVals) - j = 0 - while j