addViscous_Bowcutt.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:VC3D 作者: AlexanderWard1 项目源码 文件源码
def saveSlice_CSV(self, outputFilename=outputFilename, xSlice=[], ySlice=[], zSlice=[]):
        """ Take a slice and save it to csv """
        outputFilename += '_slice.csv'

#        # This defines how 'narrow' slice we want. Why am I writing this if ParaView will do it fark
#        tol = 1e-2
#        
#        # Pre allocate empty DF here?
#        slicedData = pd.DataFrame()
#        
#        if not xSlice:
#            # We have some slices along x to make
#            for point in xSlice:
#                # we want to slice at all of these points
#                > xSlice[point] - tol
#            self.flowData.transpose().loc[(self.flowData.transpose()["x"] > 0.599 & self.flowData.transpose()["x"] < 0.601 &  self.flowData.transpose()["z"] == 0), "cf"]
#        elif not ySlice:
#            # Slices along y to take
#        elif not zSlice:
#            # And slices aong z

        flowData = self.flowData.apply(pd.to_numeric, errors='ignore')

        slicedData_indices = (flowData["z"] > -0.01) & (flowData["z"] < 0.01)

        slicedData = flowData.loc[slicedData_indices]

        slicedData.to_csv(outputFilename, sep=',', index=0, index_label=0)

        print "Slices saved in", outputFilename
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号