Skip to content

Commit

Permalink
📝 Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed May 28, 2024
1 parent ba2f9fd commit c6d9b5f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@ aladin = Aladin()
aladin
```

## Widget limitations

Because some limitations of the widget framework, some operations need specific behaviors.

### Aladin Lite values

Some values need to be synchronized in their own cell before being used in a next one, like:

- wcs

#### Example with the wcs value:

First cell:

```python
aladin.synchronize_wcs()
```

Second cell:

```python
print(aladin.wcs)
```

## Development installation

First, make sure you have installed jupyter in your python environnement: `pip install jupyter`.
Expand Down
7 changes: 5 additions & 2 deletions src/ipyaladin/aladin.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ def target(self, target: Union[str, SkyCoord]) -> None:
def wcs(self) -> WCS:
"""The WCS of the Aladin Lite widget.
You need to call synchronize_wcs in a previous
cell before accessing this attribute.
Returns
-------
WCS
Expand All @@ -236,8 +239,8 @@ def wcs(self) -> WCS:
"""
if self._wcs == {}:
raise ValueError(
"You need to call synchronize_wcs first and in "
"another Jupyter cell to get the WCS."
"You need to call synchronize_wcs before accessing the wcs attribute. "
"The WCS attribute need to be accessed from the next cell."
)
wcs = WCS(naxis=self._wcs["NAXIS"])
wcs.wcs.cdelt = [self._wcs["CDELT1"], self._wcs["CDELT2"]]
Expand Down

0 comments on commit c6d9b5f

Please sign in to comment.