-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualization of a SAR image as a ground surface added #24
Conversation
pybabylonjs/babylonjs.py
Outdated
@@ -68,6 +68,8 @@ def set_defaults(validator, properties, instance, schema): | |||
|
|||
mbrs_schema = deepcopy(core_schema) | |||
|
|||
ground_schema = {"type": "object"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand this and add the JSON schema elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, this is now as the below. Also added image_type
to be able to add different types of data later.
ground_schema = {
"type": "object",
"properties": {
"inspector": {"type": "boolean", "default": False},
"image_type": {"type": "string", "default": "general"},
"width": {"type": "number", "default": 800},
"height": {"type": "number", "default": 600},
"z_scale": {"type": "number", "default": 1},
"wheel_precision": {"type": "number", "default": -1},
"xy_bbox": {"type": "array", "default": [0, 1, 0, 1]},
"band": {"type": "number", "default": 1},
"scale_factor": {"type": "number", "default": 1},
"img_width": {"type": "number"},
"img_height": {"type": "number"},
},
"required": ["xy_bbox", "img_width"],
}
pybabylonjs/data.py
Outdated
io_buf = io.BytesIO(buffer) | ||
return io_buf.read() | ||
|
||
bbox = kwargs["bbox"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be marked as required in the ground schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this, see the schema above
pybabylonjs/data.py
Outdated
with tiledb.open(array_uri, "r") as arr: | ||
img = arr[nr, bbox[0] : bbox[1], bbox[2] : bbox[3]][kwargs["attribute"]] | ||
|
||
img_norm = 20 * np.log10(img * kwargs["scale_factor"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scaling is specific to this SAR image, can we rename the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved this by adding a parameter image_type
that only does this conversion when image_type == "sar"
Renamed scale_factor
to sar_scale_factor
to make this clearer as well
@@ -260,16 +261,16 @@ export class BabylonMBRSView extends BabylonBaseView { | |||
const maxz = extents[5]; | |||
|
|||
const scale = this.zScale; | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
First iteration of this type of image, which uses a blob to be able to display the data. This PR will make it possible to test this on TileDB Cloud in the next deployment.
Example API call to create this new visualization: