This notebook can be used to test the basic features of a Catalog
object, which is defined in by the class definition in skyofstars/catalogs.py
. This will only work if you have installed sky-of-stars as a package, as described in the README
.
In [1]:
# import everything from skyofstars
from skyofstars.examples import *
In [6]:
example = create_test_catalog()
We defined a new kind of Python variable, by writing a class definition for a Catalog
. We can create a new one of these objects as follows.
In [18]:
example.coordinates = example.coordinates.transform_to('icrs')
print (example.coordinates.icrs.ra.rad)
In [5]:
# we can also access all the functions we defined *inside* the Catalog
example.plot_celestial(s=5, alpha=0.2)
In [6]:
# we can list all the stuff defined inside the Catalog like this:
dir(example)
Out[6]:
Defining our own objects is nice, so we can stored functions and data right next to each other, instead of having to keep passing variables as arguments into many functions. It helps force us to create standardized objects, where we can make sure we know exactly what kind of data to expect.