Skip to main content

A module for creating solar stl files

Project description

# sunimage2stl
A python package that turns 2D images of the Sun into 3D printable models in .stl file form.
I created this while interning at the Harvard-Smithsonian Center for Astrophysics.
It is intended to create hemispherical 3D prints of the whole sun and flat 3D prints of specific features of the sun (ex. solar flares).
These are to be used for educational purposes, specifically for the visually impaired.
Currently, the full Sun Model is exclusively for XRT data while the partial sun model is for any png file.

## Getting Started
### Prerequisites
- os
- subprocess
- numpy
- matplotlib
- scipy
- skimage
- stl_tools
- numpy-stl
- imageio

### Installing
1. ```mkdir sunimage2stl```
2. ```cd sunimage2stl```
3. ```git clone https://github.com/nathanielcrosby/3DSunModeling.git``` OR Download
4. ```ls``` to make sure you see setup.py
5. ```python setup.py install```
6. go into a python window and ensure everything can be imported and is working properly by testing some examples

### Examples

#### Full Sun

The Full Sun aspect is entirely HINODE XRT data. A date should be given and then the program will find the nearest image.

All Full Sun Commands Start With:
```
date = '2014/05/16'
r = 460. #px

image, header, x, y, z = sunimage2stl.3DPlot.image_to_xyz_mesh(date, r=r, base_len=228.6, offset_x=0., offset_y=0.,
scale_factor_percent=0.25, minimum_intensity_threshold=0.45, buffer_zone=0., buffer_val=1.1,
buffer=True, exp=2.0, scale_bool=True, earth=True, interval=2., local=True, index=2, flat_base=False)
```
To Do any of the Following just add these lines:

3D Full Sun .stl File:
```
sunimage2stl.3DPlot.stl_mesh_maker(x, y, z, interval=1, fname='test1.stl')
```

3D Full Sun Movie:
```
sunimage2stl.3DPlot.make_movie(x, y, z, image, file='movie.gif', fps=30, st_ang=0, en_ang=360,
st_elev_ang=90, en_elev_ang=0, time=10)
```

3D Full Sun 3D Plot:
```
sunimage2stl.3DPlot.ThreeDPlot(x, y, z, image, stride=10, figx=10., figy=10., save=False, file='3d.png')
```

2D Full Sun .stl File:
```
sunimage2stl.3DPlot.image_to_flat_stl(date, scale=100., width=100., depth=100., height=20.)
```

#### Partial Sun

These require a .png file as the "file" input.
- An image should be chosen
- Cropped to the proper size
- Exported as a .png
- file is then set to the image name

2D Partial Sun .stl File:
```
file = '2012_04_16__17_38_56_12__SDO_AIA_AIA_304' #.png
sunimage2stl.ImagePlot.stl_file_maker(file, interval=2, threshold=0.35, fname='test.stl', gaussian=1)
```

2D Partial Sun Plot:
```
file = '2012_04_16__17_38_56_12__SDO_AIA_AIA_304' #.png
sunimage2stl.ImagePlot.TwoDPlot(file, save=False)
```
## Authors
Nathaniel Crosby


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sunimage2stl-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sunimage2stl-0.1.0-py2-none-any.whl (13.7 kB view details)

Uploaded Python 2

File details

Details for the file sunimage2stl-0.1.0.tar.gz.

File metadata

  • Download URL: sunimage2stl-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15

File hashes

Hashes for sunimage2stl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5653c3334cc3f7fd35a02757ade659062c46a960b61911c061f25d8b2feb56a7
MD5 f31b2145cf744b9815be86884ba180dd
BLAKE2b-256 5652b9221d8719cbc2b1d41dd2ebf5bb623625e16ec9378651600d6ed63eade3

See more details on using hashes here.

File details

Details for the file sunimage2stl-0.1.0-py2-none-any.whl.

File metadata

  • Download URL: sunimage2stl-0.1.0-py2-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15

File hashes

Hashes for sunimage2stl-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 ba8665701c0d5a8e4620bd43a9740404e17bc099aa36c55dcb3e28ba9abded03
MD5 0a1884f0b0ffabae70f63d7f28cf117f
BLAKE2b-256 cbbc6ba6b346305b8ccd8cfac769b5770658d4f01936f2a264f16feee280bc9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page