Пример #1
0
    def __makeResponse(self):
        from com.raytheon.edex.uengine.tasks.decode import FileIn
        from com.raytheon.edex.uengine.tasks.output import FileOut
        from gov.noaa.nws.ncep.edex.uengine.tasks.radar import GempakDecodeRadarImage
        response = ArrayList()
        size = self.queryResults.size()
        for i in range(size):
            currentQuery = self.queryResults.get(i)
            #
            # Call FileIn constructor
            #
            fileIn = FileIn(self.plugin, currentQuery)
            records = fileIn.retrieveGroup()
            radarImage = GempakDecodeRadarImage(currentQuery, records)

            #
            # Call the execute method, getting back the data record
            #
            record = radarImage.execute()

            fileOut = FileOut(record, self.format)

            #
            # Execute method of FileOut class stores the data
            # in a file in uEngineProducts directory with the extension
            # contained in the string self.format
            #
            writeFile = fileOut.execute()

            #
            # Separate the file name from the complete path and store in content
            #
            content = (
                "%s" %
                writeFile).split("/")[len(("%s" % writeFile).split("/")) - 1]

            #
            # Return content wrapped in a generic XML message
            #
            response.add(ResponseMessageGeneric(content))

        return response
    def __makeResponse(self):
        from com.raytheon.edex.uengine.tasks.decode import FileIn
        from com.raytheon.edex.uengine.tasks.output import FileOut
        from gov.noaa.nws.ncep.edex.uengine.tasks.radar import GempakDecodeRadarImage
        from com.raytheon.edex.uengine.tasks.process import ColorMapImage, ReprojectImage, ImageOut       
        response = ArrayList()
        size = self.queryResults.size() 
        for i in range(size):
            currentQuery = self.queryResults.get(i)
            #
            # Call FileIn constructor
            #
            fileIn = FileIn(self.plugin, currentQuery)
            records = fileIn.retrieveGroup()
            radarImage = GempakDecodeRadarImage(currentQuery, records)

            #
            # Call the execute method, getting back the data record
            #
            record = radarImage.execute()
            
            fileOut = FileOut(record, self.format)
            
            #
            # Execute method of FileOut class stores the data 
            # in a file in uEngineProducts directory with the extension
            # contained in the string self.format 
            #
            writeFile = fileOut.execute()
            
            #
            # Separate the file name from the complete path and store in content
            #
            content = ("%s" % writeFile).split("/")[len(("%s" % writeFile).split("/") ) - 1]
            
            #
            # Return content wrapped in a generic XML message
            #
            response.add(ResponseMessageGeneric(content))
            
        return response
Пример #3
0
    def __makeResponse(self):
        from com.raytheon.edex.uengine.tasks.decode import FileIn
        response = ArrayList()
        size = self.queryResults.size()
        for i in range(size):
            currentQuery = self.queryResults.get(i)
            aLat = "%s" % currentQuery.getLatitude()
            aLon = "%s" % currentQuery.getLongitude()
            aProd = "%s" % currentQuery.getProductCode()
            aNx = "%s" % currentQuery.getNx()
            aNy = "%s" % currentQuery.getNy()
            aDbTime = "%s" % currentQuery.getDataTime()
            aDattim = GempakConvert.dbtimeToSatDattim(aDbTime)
            content = aLat + ";" + aLon + ";" + aProd + ";" + aNx + ";" + aNy + ";" + aDattim
            fileIn = FileIn(self.plugin, currentQuery)
            records = fileIn.retrieveGroup()
            convert = GempakConvert()
            thresholds = convert.getRadarThresholds(currentQuery, records)
            rpgIdDec = "10000"
            content = content + ";" + thresholds[0:-1] + ";" + rpgIdDec
            response.add(ResponseMessageGeneric(content))

        return response
Пример #4
0
 def __makeResponse(self):
     from com.raytheon.edex.uengine.tasks.decode import FileIn
     response = ArrayList()
     size = self.queryResults.size()
     for i in range(size):
         currentQuery = self.queryResults.get(i)
         aLat = "%s" % currentQuery.getLatitude()
         aLon = "%s" % currentQuery.getLongitude()
         aProd = "%s" % currentQuery.getProductCode()
         aNx = "%s" % currentQuery.getNx()
         aNy = "%s" % currentQuery.getNy()
         aDbTime = "%s" % currentQuery.getDataTime()
         aDattim = GempakConvert.dbtimeToSatDattim(aDbTime)
         content = aLat + ";" + aLon + ";" + aProd + ";" + aNx + ";" + aNy + ";" + aDattim
         fileIn = FileIn(self.plugin, currentQuery)
         records = fileIn.retrieveGroup()
         convert = GempakConvert();
         thresholds = convert.getRadarThresholds(currentQuery, records);
         rpgIdDec = "10000"
         content =  content + ";"+ thresholds[0:-1] + ";" + rpgIdDec
         response.add(ResponseMessageGeneric(content))
 
     return response
Пример #5
0
  def __makeResponse(self):
      from com.raytheon.edex.uengine.tasks.decode import FileIn
      response = ArrayList()
      size = self.queryResults.size()
      for i in range(size):
          currentQuery = self.queryResults.get(i)
          aLat = "%s" % currentQuery.getLatitude()
          aLon = "%s" % currentQuery.getLongitude()
          aProd = "%s" % currentQuery.getProductCode()
          aAngle = "%s" % currentQuery.getTrueElevationAngle()
          aNumBins = "%s" % currentQuery.getNumBins()
          aFormat = "%s" % currentQuery.getFormat()
          aDbTime = "%s" % currentQuery.getDataTime()
          aDattim = GempakConvert.dbtimeToSatDattim(aDbTime)
          content = aLat + ";" + aLon + ";" + aProd + ";" + aAngle + ";" + aNumBins + ";" + aFormat + ";" + aDattim
          fileIn = FileIn(self.plugin, currentQuery)
          records = fileIn.retrieveGroup()
          convert = GempakConvert();
          thresholds = convert.getRadarThresholds(currentQuery, records);
          rpgIdDec = currentQuery.getSpatialObject().getRpgIdDec()
          content =  content + ";"+ thresholds[0:-1] + ";" + rpgIdDec
          response.add(ResponseMessageGeneric(content))
 
      return response
Пример #6
0
	def __makeImageResponse(self):
		from com.raytheon.edex.uengine.tasks.decode import FileIn
		from com.raytheon.edex.uengine.tasks.radar import DecodeRadarImage
		from com.raytheon.edex.uengine.tasks.process import ColorMapImage, ReprojectImage, ImageOut
		from com.raytheon.edex.uengine.tasks.output import FileOut
		from com.raytheon.edex.uengine.tasks.response import MakeResponseUri
		response = ArrayList()
		size = self.queryResults.size()
		for i in range(size):
			currentQuery = self.queryResults.get(i)
			fileIn = FileIn(self.plugin, currentQuery)
			records = fileIn.retrieveGroup()
			radarImage = DecodeRadarImage(currentQuery, records)
			geom = radarImage.getGridGeometry()
			crs = radarImage.getCrs()
			colorMap = ColorMapImage(self.__colormap, radarImage.execute(), geom)
			imageOut = None
			if self.__reproject:
				reproject = ReprojectImage(colorMap.execute(), geom, crs)
				reprojectedImage = reproject.execute()
				imageOut = ImageOut(reprojectedImage, self.__format, reproject.getGridGeometry())
			else:
				imageOut = ImageOut(colorMap.execute(), self.__format, geom)
			fileOut = FileOut(imageOut.execute(), self.__format)
			writeFile = fileOut.execute()
			makeResponse = MakeResponseUri(writeFile, None, currentQuery.getIdentifier(), self.__format)
			response.add(makeResponse.execute())
			if self.__kml:
				from com.raytheon.edex.uengine.tasks.output import KmlImage
				kmlImage = KmlImage(writeFile, geom)
				kmlFile = kmlImage.execute()
				kmlResponse = MakeResponseUri(kmlFile, None, None, "kml")
				response.add(kmlResponse.execute())

		return response