Coder Social home page Coder Social logo

astro3d's Introduction

Astro3d

Astro3d provides a GUI and engine to create a 3D model from an astronomical image. The 3D model is saved in a STL file, which can then be sent to a 3D printer.

Requirements

  • Python 3
  • Qt5

Installation

Start a terminal window

In whatever system you have, start a terminal window that will get you to the command line.

Remember, you need to be in the bash shell. If not sure, start bash:

$ bash

Install Anaconda

If you have never installed anaconda before, or want to start fresh, this is the place to start. First, remove any previous instance of anaconda:

$ cd
$ rm -rf anaconda3

Go to the Anaconda download site, https://www.anaconda.com/download/, and download the command line installer appropriate for your system. Choose the Python3.x version.

After downloading, perform the installation:

$ cd <download_directory_here>
$ bash <install_script_here>

Accept all the defaults for any questions asked.

Now, quit the terminal window you were in and start another one. Remember to start bash if necessary.

Create environment

Now we can create the astro3d Python environment. We will use the stenv environment, which is a conda environment that contains all the necessary packages for astro3d.

Create the astro3d conda environment:

$ conda env create -n astro3d -f https://raw.githubusercontent.com/spacetelescope/stenv/main/environment.yaml

The astro3d environment is now ready. To activate, do the following:

$ conda activate astro3d

Always Do

At this point, the environment is setup. From now on, always make sure you are running bash and in the astro3d environment whenever you need to start a new terminal window:

$ bash
$ conda activate astro3d

astro3d code install

If one has never installed astro3d or one wishes to get a fresh install, do the following. Remember to start bash and activate the environment before doing this:

$ cd
$ rm -rf astro3d
$ git clone [email protected]:spacetelescope/astro3d.git
$ cd astro3d
$ pip install .

The application should now be runnable. Note, you can run the application from whatever directory you wish:

$ astro3d

Updating astro3d

To update the code, do the following. Remember to start bash and activate the environment:

$ cd
$ cd astro3d
$ git pull
$ pip install .

This should do it.

astro3d's People

Contributors

larrybradley avatar stscieisenhamer avatar pllim avatar rmrao avatar perrygreenfield avatar zacharyburnett avatar

Stargazers

Michael Johnson avatar Roy Smart avatar Chris Kuethe avatar

Watchers

Austin Murphy avatar  avatar  avatar Carol Christian avatar

Forkers

stscieisenhamer

astro3d's Issues

Update the help

Tyler Desjardins mentions that we should consider moving emails from help[at]stsci.edu to point to the web portal where possible and appropriate. For HST (or any non-JWST), it is https://hsthelp.stsci.edu . For JWST, it is https://jwsthelp.stsci.edu . Please update info in setup.py, setup.cfg, documentation, etc as appropriate.

Please close this issue if it is irrelevant to your repository. This is an automated issue. If this is opened in error, please let pllim know!

xref spacetelescope/hstcal#317

split model along third axis

Comment from @carolc91:

Note though, for the splitting we like that we can choose which way it splits, but we also were hoping for a split in the third axis (along the disk plane) so we can generate two halves. Yes they will be smaller than the nominal size.

documentation

Issue

No documentation exists. Write documentation.

Implementation

  • setup for sphinx
  • [ ] setup for internal browsing
  • docs
    • config file
      • texture definitions
    • work flow
    • saving
    • layers
      • create/edit/remove/disable
      • regions
      • stars
      • clusters
      • catalogs
      • textures
  • read-the-docs integration

add configurability for catalogs in the configuration

Issue

Though one can define user texture to be used in catalogs, there is no option to change the texture without actual code changes.

Implementation

  • determine parameters
  • update config
  • create texture using config

Fix image manipulation

Issue

Things like scaling and rotating the image are not easily accessible. The code is all there to do it, just not clearly documented and implemented.

better handle cases where bulge is required

Issue

Operations such as when spiral_galaxy, create gas/spiral arm, and gas/dust creations depend on a bulge being defined. Currently things go horribly wrong if bulge is not there.

cannot install software

Nothing works from home directory
went to subdirectory astro3d as per instructions, did a source activate....git pull
then

**"python setup.py install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

[Errno 13] Permission denied: '/sw/lib/python2.7/site-packages/test-easy-install-2765.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

/sw/lib/python2.7/site-packages/

Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

https://setuptools.readthedocs.io/en/latest/easy_install.html

Please make the appropriate changes for your system and try again.

[amelonado:~/astro3d] carolc% "**

Merging remove_star regions causing raised areas in .stl files

Issue

From comment:

I added a few large remove_star regions and noticed that merging these regions alters the .stl files. With merging being the only change, the areas under the remove_star regions go from being flat to having high protrusions. An example of this in in the box under AnnaV > Whirl + Companion > No clusters. The difference can be observed in the part 2 .stl files as a bump to the left in the merged version, while the same area is flat in the unmerged version.

Clusters giving error

screen shot 2018-06-01 at 10 00 58 am

I put clusters into the python interface with a textedit file. It worked and they showed up in the interface, but when I tried to save the STL file, it gave me the error above.

AstropyDeprecationWarning

Issue

Update astropy pytest plugins which are given the following:

WARNING: AstropyDeprecationWarning: The module `astropy.tests.pytest_plugins has been deprecated. The variables `PYTEST_HEADER_MODULES` and `TESTED_VERSIONS`should now be imported from `astropy.tests.plugins.display`. The function `enable_deprecations_as_exceptions` should be imported from `astropy.tests.helper` [astropy.tests.pytest_plugins]

scale catalog to match image

Issue

Catalogs can be given given a different image size/rotation in pixel space. Provide a tool to help fix this.

Also, allow WCS information to be used instead.

make own catalog and textures - not working and Processing error

Hello...I have returned to making my own files! First, the interface does not seem to allow me to make my own catalogs anymore. When I mouse to star clusters, stars and textures the output is "hide".
I tried using an already successful set of fits files to make a new print and I get an error
Processing error
'dict" object is not callable

??? so I cannot make prints at all right now.
errorjpeg

Refactor region display

Issue

Currently any change to any one region, such as visibility, deletions, addition, etc., causes a re-paint of all regions. This is not necessary; individual regions can be added/removed from the display. Refactor to take advantage of this.

Create regions based solely on available textures

Issue

Allow creation of regions based solely on textures

Resources

  • First step to resolving #8

Implementation

  • documentation no documentation exists
  • tests no tests exist
  • code
    • check for how textures are implemented
      Textures are programatically defined through the config. No significant changes needed in the model3d api.
    • Implement Textures based on Regions
      • Generalize Regions and create ConceptualRegions for things like bulge etc.
      • Implement Textures on the generalized Regions
    • Encorpate Textures into the main workflow
      • Actually render the textures inModel3d
      • Save the textures
        Nothing need be done: Automatically happened.
      • Read in texture regions into Textures.
    • Implement TextureItem based on RegionItem
      No need to implement a new item type.
    • Populate Textures with TextureItem
      Currently using RegionItem because there is no need for a separate TextureItem, yet.
    • develop a color assigning api and/or allow this to be defined in the config along with the texture
      Colors defined in the config file.
  • tests no tests exist
  • documentation no documentation exists

Replace the region paradigm with just painting textures

Issue

Currently, regions are separated by a conceptual concept, such as "disk", "gas", or "bulge". This paradigm has proven to be limiting. Instead, simply produce regions directly related to the texture desired to be used.

GUI-wise, this is not much of a change. However, this will impact the 3D modeling API and algorithms.

Implementation

  • implement texture-only gui + rendering see issue #13
  • Remove vesitges of the conceptual regions
    • How to identify regions that have special functions, such as Bulge and remove_star.
    • Auto mask creation: where would the new masks go?

expose catalog textures in the config

Issue

Expose the catalog textures in the config. Also, make the catalogs generic, much like the textures, so different types of catalogs with different markers can be added.

Implementation

  • documentation no documentation exists
  • tests no tests exist
  • code
    • Check implementation of catalogs, Stars and Clusters, in Model3d
      • Generalize the implementation not necessary for first cut. taking approach as with regions, and simply adding a new catalog section.
        • Extract StarTexture and StarClusterTexture into the config
        • Determine how best get the parameters into the texture objects.
    • Implement top level layer Catalogs based on Textures
    • Implement CatalogItem
    • Incorporate into workflow
      • Render Catalogs in Model3d
      • Save Catalogs
      • Read in Catalogs
        Only allow reading into a specific type. There is top level reading.
        • Remove top level Catalogs reading
        • Add action on each CatalogType for "read catalog"

Notes

The pair of stellar types, stars and star_clusters, are hardwired into Model3d. Will need to extract.

The parameters for the stellar textures are exposed within the interface itself. Reconsider this later on.

create/edit stars and clusters

Issue

Add feature to create and edit star and star cluster lists.

Implementation

  • code
    • add
    • delete
    • move no need for this functionality
    • create catalog from scratch
    • merge multiple catalogs
    • duplicate for clusters

Resolve deprection warnings

(astro3d) kakawa:astro3d carolc$ git pull
Already up to date.
(astro3d) kakawa:astro3d carolc$ astro3d
/Users/carolc/anaconda3/envs/astro3d/lib/python3.7/site-packages/astro3d-0.4.dev626-py3.7.egg/astro3d/util/text_catalog.py:15: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
TEXT_CATALOG = yaml.load(fh)
/Users/carolc/anaconda3/envs/astro3d/lib/python3.7/site-packages/vispy-0.5.3-py3.7.egg/vispy/visuals/isocurve.py:22: UserWarning: VisPy is not yet compatible with matplotlib 2.2+

warnings.warn("VisPy is not yet compatible with matplotlib 2.2+")

allow overwriting of files

If a model is saved and a file already exists, the whole application crashes. Brutal lesson but should be resolved.

tests

Issue

Write tests

Implementation

  • setup setup.py appropriately
  • write tests

turn off debugging/info outputs

Implementation

  • Fix up the logger convenience functions.
  • Provide a Null logger.
  • Remove the logger parameters from everywhere.
  • track down astropy logging
  • track down stragglers
  • Provide command line options
    • main app
    • specify modules

expose texture parameters on a per-texture basis

Issue

Currently the parameters for StarTexture and StarClusterTexture are exposed explicitly. Now that a user can choose arbitrary textures, the only way to modify their parameters is through the config file. Instead, a panel is needed that displays/modifies the parameters for a selected texture.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.