astropy / astropy/astrowidgets

INFO: Ginga marker parameters

Open
#169 1 comment 0 reactions 0 assignees View on GitHub
backend: ginga
Dominant language
Python
Stars
34
Forks
19
Avg merge
1d 12h
Merged PRs (30d)
4

Description

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

```python
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 |

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Ginga entry point, ginga/canvas/types/basic.py, and review how get_params_metadata() exposes marker parameters. The issue does not name a destination file, test, or concrete repository change, so confirm where these findings belong before defining completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.