charlottenosam / toons Goto Github PK
View Code? Open in Web Editor NEWWhy plot points, when you can draw cartoons?
License: GNU General Public License v2.0
Why plot points, when you can draw cartoons?
License: GNU General Public License v2.0
@cmason90 first needs to work out what dictionaries do...
@cmason90 needs to do some maths and learn about flux
@vrooje you said the pixel size was given in the data - do you know what the header title was? As I can't work out which it is...
Is the "redshift" given z? And how would I convert pixel size to physical size? (Sorry it's been a while since I've done any astrophysics!!)
Can you check in your datafile please, Brooke? This can be very simple to start with: I'd suggest plain text, with a header marked by #-es as usual, and at least the columns (u-r) color, logM*, and BDratio.
@cmason: you can read files like this with numpy.loadtxt at first. A better way is to use ATPy astronomical tables (you get arrays with names...) - but it's an additional dependency. I like it - but maybe see how far you can get without it at first? Priority is getting some toons on screen! :-)
Ok, one thing that's confusing me a lot and I can't find a simple explanation online...
How do I get python to find the toons
package, and the file bulgeless_agn_properties_testtable.cat
from examples/bulgelessdisk.py
?
I've just used:
import toons
data = numpy.loadtxt('bulgeless_agn_properties_testtable.cat', skiprows=1)
but I get the following errors:
ImportError: No module named toons
IOError: [Errno 2] No such file or directory: 'bulgeless_agn_properties_testtable.cat'
I added the following to bulgelessdisk.py
os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))
which I think makes the directory (examples
) the cwd, so I can find the .cat file ok now, but still not toons
.
I thought python searched recursively so if it can't find toons
in examples
it should go up a level and find it there?
@vrooje I followed your instructions for the data and plotted PETROMAG_U - PETROMAG_R
but the u-r values seem to be a bit off (and not just by a constant value). I'm pretty sure I used the correct columns (5 & 7) so not sure if there's something else I need to do? Is it just the apparent magnitude?
When we have a working version of galtoons that we are happy with, @cmason90 should tweet its gh-pages website to the world. This could mark the end of the project!
Are we happy with the disk shapes? My sister is describing them as "fried eggs" so I might have a play with elongating them a bit/changing the angle to avoid that!
Make the bulges more spherical? Or gibbous moon shaped? (@drphilmarshall can work out how to make them that shape!).
It would be nice to have the toons show the actual colour of the galaxy - @vrooje how do I work this out from the ugriz magnitudes? Is there a simple way to convert these to wavelength? I've tried looking at some of the SDSS documentation but there's nothing immediately obvious (again remember I haven't done much astro!!)
I reckon @drphilmarshall and @vrooje should probably check the plots (now filed under examples/bulgelessdisks/example-bulgelessdisks.png
and examples/theodyssey/example-theodyssey.png
) and my calculations in the code to make sure we are actually plotting the right things (or at least that it looks reasonable!).
My sanity checks have been that bulges are smaller than disks and that the colours make sense (e.g. blue = normally close and bright, high mag).
Otherwise I think I'm happy with it. Will just have a play with the surface brightness thing in #13 but I'm going to have to leave any other more major alterations to another time as I better start packing!
@cmason, can you create an "Project Completion" milestone (with a suitable date) and assign issue #1 to it, please? Milestones and issues are really useful features of github - kept up to date, they can really help you manage your projects. Add some labels, make some intermediate milestones, create some issues and delegate them to us, play around :-)
Create a class called "blobs" which have properties: position, shape (q and phi), size (a), colour, and brightness (alpha).
A galtoon is then composed of a "diskblob", "bulgeblob" and "haloblob"
Need to define:
Position
Area/size
Eccentricity
Axis orientation
Magnitude
Colour
bulgelessdisk.py
should now plot a scatter graph with the data points circles proportional in size to the bulge mass (bulge to total ratio * total mass
)
BUT I get the following error message:
TypeError: 'numpy.float64' object is not callable
when python looks at the Galtoon class attribute normarea
. I can't find any useful/understandable help for this error.
I can produce the correct plot by bypassing the class and just putting the functions I want in the plotting file, so there must be some problem with the way I've made the class or the way I've used numpy? bulgemass
is definitely an array, I've checked that.
It is loading the class ok as I've got it to print some strings from it in bulgelessdisks.py.
Any suggestions??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.