Skip to content
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

INFO: Ginga marker parameters #169

Open
pllim opened this issue Jun 28, 2023 · 1 comment
Open

INFO: Ginga marker parameters #169

pllim opened this issue Jun 28, 2023 · 1 comment

Comments

@pllim
Copy link
Member

pllim commented Jun 28, 2023

This is part of a larger effort to collect what parameters do different backends take for markers. I was tasked with Ginga and chose to document my findings as GitHub issue. Luckily Ginga has a way for me to programmatically query such things, for example:

https://github.com/ejeschke/ginga/blob/61e44c23d5210cc953bffec7a0fd488727b17dbf/ginga/canvas/types/basic.py#L36

from ginga.canvas.types import basic

params = basic.TextP.get_params_metadata()
for p in params:
    print(f"{p.name} | {p.default} | {p.description}")

I did not include canvas objects that don't look like they quality as "markers," e.g., Bezier Curve.

Point

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
radius 1.0 Radius of object
style cross Style of point (default 'cross')
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
showcap False Show caps for this object

Crosshair

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color green Color of outline
alpha 1.0 Opacity of outline
text None Text annotation
textcolor yellow Color of text annotation
font Sans Serif Font family for text
fontsize None Font size of text (default: vary by scale)
fontscale True Scale font with scale of viewer
format xy Format for text annotation (default: xy)

Box (rectangular)

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
xradius 1.0 X radius of object
yradius 1.0 Y radius of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object
rot_deg 0.0 Rotation about center of object

SquareBox

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
radius 1.0 radius of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object
rot_deg 0.0 Rotation about center of object

Rectangle

The Square class somehow is a direct subclass, so has these same parameters.

Name Default Description
coord data Set type of coordinates
x1 0.0 First X coordinate of object
y1 0.0 First Y coordinate of object
x2 0.0 Second X coordinate of object
y2 0.0 Second Y coordinate of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
drawdims False Annotate with dimensions of object
font Sans Serif Font family for text
showcap False Show caps for this object

Triangle

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
xradius 1.0 X radius of object
yradius 1.0 Y radius of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object
rot_deg 0.0 Rotation about center of object

RightTriangle

Name Default Description
coord data Set type of coordinates
x1 0.0 First X coordinate of object
y1 0.0 First Y coordinate of object
x2 0.0 Second X coordinate of object
y2 0.0 Second Y coordinate of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object

Circle

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
radius 1.0 Radius of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object

Ellipse

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
xradius 1.0 X radius of object
yradius 1.0 Y radius of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object
rot_deg 0.0 Rotation about center of object

Annulus

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of center of object
y 0.0 Y coordinate of center of object
radius 1.0 Inner radius of annulus
width None Width of annulus
atype circle Type of annulus
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline

Polygon

Name Default Description
coord data Set type of coordinates
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
color yellow Color of outline
alpha 1.0 Opacity of outline
fill False Fill the interior
fillcolor None Color of fill
fillalpha 1.0 Opacity of fill
showcap False Show caps for this object

Line

Name Default Description
coord data Set type of coordinates
x1 0.0 First X coordinate of object
y1 0.0 First Y coordinate of object
x2 0.0 Second X coordinate of object
y2 0.0 Second Y coordinate of object
linewidth 1 Width of outline
linestyle solid Style of outline (default solid)
arrow none Arrows at ends (default: none)
color yellow Color of outline
alpha 1.0 Opacity of outline
showcap False Show caps for this object

Text

Name Default Description
coord data Set type of coordinates
x 0.0 X coordinate of lower left of text
y 0.0 Y coordinate of lower left of text
text EDIT ME Text to display
font Sans Serif Font family for text
fontsize None Font size of text (default: vary by scale)
fontsize_min 6.0 Minimum font size of text (if not fixed)
fontsize_max None Maximum font size of text (if not fixed)
fontscale False Scale font with scale of viewer
color yellow Color of text
alpha 1.0 Opacity of text
rot_deg 0.0 Rotation of text
showcap False Show caps for this object
@pllim
Copy link
Member Author

pllim commented Aug 24, 2023

Ginga already has regions translators, showcased here: https://github.com/ejeschke/ginga/blob/main/ginga/tests/test_ap_regions.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant