# Unable to use sbpy to fit curves to plots

**URL:** <https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078>\
**Category:** Support\
**Tags:** dp0, dp03\
**Created:** [November 15, 2023, 11:22am UTC](https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078 "2023-11-15T11:22:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scunningham-9](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/scunningham-9/32/2680_2.png) [@Scunningham-9](https://www.rubin.community/u/Scunningham-9)\
**Post date:** [November 15, 2023, 11:22am UTC](https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078/1 "2023-11-15T11:22:36Z")

</div>

I have been attempting to plot phase curves of solar system objects. Attempting to fit curves to the data as tutorial notebooks have shown has not worked. Whenever I attempt this the error suggests the module sbpy does not exist. Is it yet to be installed or is there some other issue likely to be causing this error.

---

<div class="post-metadata">

**Author:** ![ameisner](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ameisner/32/2392_2.png) [@ameisner](https://www.rubin.community/u/ameisner)\
**Post date:** [November 15, 2023, 1:43pm UTC](https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078/2 "2023-11-15T13:43:31Z")

</div>

Hi Sam,

Is it correct to assume that you’re attempting to import `sbpy` on RSP?

Also, which tutorial notebooks are you referring to? Searching for `sbpy` among the current set of DP0 tutorial notebooks, I can only find references to `sbpy` in Markdown cells, but not in any code cells, suggesting that it’s not currently intended to be a dependency:

[https://github.com/search?q=repo%3Arubin-dp0%2Ftutorial-notebooks+sbpy&type=code](https://github.com/search?q=repo%3Arubin-dp0%2Ftutorial-notebooks+sbpy&type=code)

There was some [prior discussion](http://www.rubin.community/t/add-sbpy-on-the-rsp-as-a-default-installed-python-library-package-like-astropy/7836) about plans for installing `sbpy` for use on RSP — with regard to that it might be helpful to know what image you’re using for your RSP instance and what exact command (is it simply `import sbpy` ?) you’re attempting to use for this import. In any case, I confirm that with the currently recommended weekly (`w_2023_37`), `import sbpy` fails for me. Thanks very much…

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [November 15, 2023, 6:07pm UTC](https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078/3 "2023-11-15T18:07:17Z")

</div>

My apologies, the RSP developer team is now working towards installing `sbpy`. Timescale is likely several weeks before it becomes the recommended image for the Notebook Aspect. It will be announced at that time.

However, the DP0.3 tutorial notebooks for fitting phase curves do not rely on `sbpy` and should work fine. The relevant functions from `sbpy` were defined right in the notebooks to enable phase curve fitting until `sbpy` is installed.

Side note that `sbpy` is pip-installable, in the meantime (`pip install --user sbpy`).

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [December 4, 2023, 11:55pm UTC](https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078/4 "2023-12-04T23:55:24Z")

</div>

As of Thu Nov 30, the `sbpy` package is part of the recommended image of the Rubin Science Platform’s Notebook Aspect (Weekly 2023\_47).

---

<div class="post-metadata">

**Author:** ![galaxyumi331](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/galaxyumi331/32/2677_2.png) [@galaxyumi331](https://www.rubin.community/u/galaxyumi331)\
**Post date:** [January 30, 2024, 11:53pm UTC](https://www.rubin.community/t/unable-to-use-sbpy-to-fit-curves-to-plots/8078/5 "2024-01-30T23:53:42Z")

</div>

As of today, the DP0.3 tutorial notebooks 04a and 04b on phase curves use `sbpy`. @Scunningham-9, please try them out!
