Core mass script documentation
Toward the end of last week I worked on writing a script that would open, read and write the mass data in the sinks_*.okc files to a new .csv file (In particular for the CollidingFlows problem, see our data here: CollidingFlowsFigures). The purpose of this was to gain all of the sink data over time, so that we could visualize it, as you can see by the results I have posted below. These charts will allow us to observe how the sinks accumulate mass over the time of the simulation. Here I will document the development of my code, and discuss what else I would like to do with it.
Objectives
Editing code:
- Write information of the density/mass of the cores to a .csv file
- Convert the information from the .csv into solar masses and Myr.
- Take converted .csv file and make graphs using matplotlib, or excel. Excel is quick, but a code that can do all of this and generate plots in one swoop would be super efficient for later uses.
- Document and post concise and general form under the VisIt page as a script tab.
So far I have completed the first bullet~ (02-09-2015)
Editing charts:
- Convert mass to solar masses.
- Convert time to Myr.
- Crop the x-axes to when the first sink forms. Get rid of the 0 values.
- Fix x and y-axes to be the same for all the runs.
okc_to_csv.py v. 1
Screen capture of code | Screen capture of .okc file |
The code reads the first line of the .okc file, splits the numbers into a list of ints. It then uses those numbers in order to access the data below that starts at the 34th line. The only parts that are hard coded are the headers for the columns of the csv file (L17) and the number of lines of data it has to read into the .csv (L27). Essentially you change this by the number of sinks that form by the end of the simulation. You can check this by counting the number of lines of data that are spit out by the final frame of the simulation.
Results 02-09-2015
Shear 0 | |
Shear 15 | |
Shear 30 | |
Shear 60 |
Attachments (10)
-
s0_sinkdata.png (98.6 KB) - added by 10 years ago.
chart of unconverted sink masses (s0)
-
s15_sinkdata.png (101.8 KB) - added by 10 years ago.
chart of unconverted sink masses (s15)
-
s30_sinkdata.png (68.8 KB) - added by 10 years ago.
chart of unconverted sink masses (s30)
-
s60_sinkdata.png (68.9 KB) - added by 10 years ago.
chart of unconverted sink masses (s60)
-
s0_rawsink_data.csv (10.3 KB) - added by 10 years ago.
csv of unconverted sink masses (s0)
-
s15_rawsink_data.csv (8.7 KB) - added by 10 years ago.
csv of unconverted sink masses (s15)
-
s30_rawsink_data.csv (3.6 KB) - added by 10 years ago.
csv of unconverted sink masses (s30)
-
s60_rawsink_data.csv (2.9 KB) - added by 10 years ago.
csv of unconverted sink masses (s60)
-
okc_script_screencap.png (125.1 KB) - added by 10 years ago.
okc to csv v. 1 screencap
-
okc_screencap.png (150.6 KB) - added by 10 years ago.
screen cap of okc
Download all attachments as: .zip
Comments
No comments.