# 10 - Optics The optics between the scene and the sensor, on the Pleiades: diffraction, focus, scattered light, measured PSFs and lens distortion. | In-Focus | Out-of-Focus | |---|---| | ![10 - Optics](https://media.huira.space/examples/10_optics.png) | ![10 - Optics](https://media.huira.space/examples/10_optics_defocus.png) | ## Data | File | What it is | From | |---|---|---| | `tycho2.hrsc` | The Tycho-2 star catalog, in Huira's format | [media.huira.space](https://media.huira.space/data/stars/tycho2/) | You will need this catalog whenever you render stars with Huira: in the later examples, and in your own scenes, which for a space scene is almost always. It is about 120 MB, so keep one copy somewhere central on your machine rather than in this folder, and pass its path wherever you load stars. From the folder you choose, download it with: ```bash curl -fLO https://media.huira.space/data/stars/tycho2/tycho2.hrsc ``` The Tycho-2 catalog is licensed for **non-commercial use only**. Licenses, and how to credit the data: [Tycho-2 star catalog](../getting_started/data.md#tycho-2-star-catalog). ## Run From this folder, in Python: ```bash python optics.py /path/to/tycho2.hrsc ``` or in C++, built as in [Running the examples](index.md#c): ```bash ../../build/10_optics /path/to/tycho2.hrsc ``` Each writes its images to `output/`, in the folder it runs from. ## Source The complete example, in both languages. [View this example on GitHub](https://github.com/huira-render/huira/tree/main/examples/10_optics). `````{tab-set} ````{tab-item} Python :sync: python ```{literalinclude} ../../examples/10_optics/optics.py :language: python ``` ```` ````{tab-item} C++ :sync: cpp ```{literalinclude} ../../examples/10_optics/optics.cpp :language: cpp ``` ```` `````