Skip to content

Commit

Permalink
daily
Browse files Browse the repository at this point in the history
  • Loading branch information
nick5435 committed Feb 14, 2017
1 parent 9eb3056 commit 9bcdb0d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
TODO:
# TODO:

* [ ] Improve README
* [ ] Whitepaper
* [ ] Figure out how CoolProp generates its data
* [ ] Path Length should logically correspond to **Energy**, or something like that.
* [ ] **Internal Energy should be able to work as an Input variable** Note: Having same issues as with entropy, might not be feasible as of *2017-02-11*
* [ ] do _function_ to _col_ where _condition_ (Pandas?) (Flag col?)
* [ ] <pre> do \<function> to \<col> where \<condition></pre> (Pandas?) (Flag col?)
* [ ] **Big 'ol CSV of derivatives**
* [ ] CSV Contour Plot w/ column order option
* [ ] Find host for Documentation
Expand Down
47 changes: 23 additions & 24 deletions thermoDataGrabber/thermoDataGrabber/thermoDataGrabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@

import json

# CoolProp is for getting the thermo data
# import CoolProp
import CoolProp.CoolProp as CP
# Matplotlib for making pretty pictures
import matplotlib.pyplot as plt
# Data Storage Containers
import numpy as np
import pandas as pd
import pyrsistent as pyr
Expand Down Expand Up @@ -66,6 +62,7 @@ def __init__(self,
colorMap (str): What color map to use
"""

self.fluid: str
self.fluid = fluid
self.numPoints: Union[List[int], int]
Expand Down Expand Up @@ -123,9 +120,11 @@ def __init__(self,
self.numPoints[1])
elif self.yvar in ["U"]:
yspace = np.linspace(9000.0, 6000000.0, self.numPoints[1])

# Create a empty list for storing data
# Then make our data.
data = []

if "V" not in self.vars:
for x in xspace:
for y in yspace:
Expand Down Expand Up @@ -189,24 +188,17 @@ def __init__(self,
self.units[i] = "kg/m^3"
elif var == "V":
self.units[i] = "m^3"
self.meta = pyr.pmap({
"date":
str(arrow.now('US/Central').format("YYYY-MM-DD @ HH:mm:ss")),
"fluid":
self.fluid,
"xvar":
self.xvar,
"yvar":
self.yvar,
"zvar":
self.zvar,
"numPoints":
self.numPoints,
"colorMap":
self.colorMap,
"units":
self.units
})
self.meta = pyr.pmap({
"date":
str(arrow.now('US/Central').format("YYYY-MM-DD @ HH:mm:ss")),
"fluid": self.fluid,
"xvar": self.xvar,
"yvar": self.yvar,
"zvar": self.zvar,
"numPoints": self.numPoints,
"colorMap": self.colorMap,
"units": self.units
})

def write_data(self, path: str) -> None:
"""
Expand All @@ -216,6 +208,7 @@ def write_data(self, path: str) -> None:
path (str): path where file should be saved
"""

middle_string = "_".join([
str(varname) + "-" + str(point)
for (varname, point) in zip(self.vars, self.numPoints)
Expand Down Expand Up @@ -311,16 +304,22 @@ def fluid_plot(fluid: Union[CSVFluid, ThermoFluid]) -> None:
fluid (Union[CSVFluid, ThermoFluid]): Which fluid object to make a plot for.
"""

# Plotting:
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d") # we want 3D plots

# we want 3D plots
ax = fig.add_subplot(111, projection="3d")

# Plot the data
ax.scatter(
fluid.data[fluid.xvar],
fluid.data[fluid.yvar],
fluid.data[fluid.zvar],
c=fluid.data[fluid.zvar],
cmap=fluid.colorMap,
edgecolors="none") # Plot the data
edgecolors="none")

# Set the Labels
ax.set_xlabel("{0} [{1}]".format(fluid.vars[0], fluid.units[0]))
ax.set_ylabel("{0} [{1}]".format(fluid.vars[1], fluid.units[1]))
Expand Down

0 comments on commit 9bcdb0d

Please sign in to comment.