Ejemplo n.º 1
0
 def _get_data(self):
     self.query = create_query(self)
     if self.output == "csv":
         self.data = web_post(self.wcps_url, {"query":self.query})
     if self.output == "netcdf":
         self.data = web_post_file(self.wcps_url, {"query":self.query})
     if self.output == "gtiff":
         self.data = web_post_file(self.wcps_url, {"query":self.query})
     if self.output == "png":
         self.data = web_post_file(self.wcps_url, {"query":self.query})
Ejemplo n.º 2
0
    def _get_data(self):
        self.query = create_query(self)
        if self.output == "csv":
            self.data = web_post(self.wcps_url, {"query": self.query})
            self.data = self.data[2:-2]
            self.data = self.data.split('}},{{')

            self.data = [x.split('},{') for x in self.data]
            self.data = [[x.split(',') for x in y] for y in self.data]
            self.data = np.array(self.data)
            self.data = self.data.astype(np.float)
        if self.output == "netcdf":
            self.data = web_post_file(self.wcps_url, {"query": self.query})
        if self.output == "geotiff":
            self.data = web_post_file(self.wcps_url, {"query": self.query})
Ejemplo n.º 3
0
    def _get_data(self):
        self.query = create_query(self)
        if self._data is None:
            if self.output == "csv":
                self._data = web_post(self.wcps_url,
                                      {"query": self.query})[1:-1]
                self._data = self._data.split('},{')
                self._data = [x.split(',') for x in self._data]
                self._data = np.array(self._data)
                self._data = self._data.astype(np.float)
            if self.output == "netcdf":
                self._data = web_post_file(self.wcps_url,
                                           {"query": self.query})
            if self.output == "gtiff":
                self._data = web_post_file(self.wcps_url,
                                           {"query": self.query})
        else:
            return self._data

        return self._data