Commit 3746bfb8 authored by Caillat Michel's avatar Caillat Michel
Browse files

Added levelUnit to the properties returned by getContour for each contour

parent b3c9215e
......@@ -1144,7 +1144,7 @@ class DataBlock:
#pts = [[x[0], shape[0] - x[1] -1] for x in pts]
feature = {"type":"LineString", \
"coordinates": pts,\
"properties": {"level" : level}}
"properties": {"level" : level, "levelUnit" : self.__header["BUNIT"]}}
features.append(feature)
contours_geojson = { "type": "FeatureCollection", "features" : features }
......@@ -1168,14 +1168,19 @@ class DataBlock:
accum = np.asarray(accum)
result = {}
result["sum"] = "%11.4g" % (np.sum(accum) / self.__convert * self.__cdelt);
result["min"] = "%11.4g" % (np.min(accum))
result["max"] = "%11.4g" % (np.max(accum))
result["mean"] = "%11.4g" % (np.mean(accum))
result["stdev"] = "%11.4g" % (np.std(accum))
result["numpix"] = accum.shape[0]
bunit = self.__header["BUNIT"]
if bunit == "Jy/beam":
sumunit = "Jy"
else:
sumunit = bunit
result["sum"] = "%11.4g %s" % ((np.sum(accum) / self.__convert * self.__cdelt) , sumunit)
result["min"] = "%11.4g %s" % ((np.min(accum)) , bunit)
result["max"] = "%11.4g %s" % ((np.max(accum)) , bunit)
result["mean"] = "%11.4g %s" % ((np.mean(accum)), bunit)
result["stdev"] = "%11.4g %s" % ((np.std(accum)), bunit)
result["numpix"] = "%d pixels" % accum.shape[0]
result["percentage of total number of pixels"] = "%9.2g%%" % (accum.shape[0] / (shape[0]*shape[1]) * 100)
result["boundingRect"] = bdr
result["boundingRect"] = f"{bdr} (x, y, width and height in pixels)"
result = {"status":True, "message":"", "result":result}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment