Skip to content

Instantly share code, notes, and snippets.

@Farzadtb
Created March 28, 2019 06:07
Show Gist options
  • Save Farzadtb/6e7989e14ab65a6e8d53773cfd84b108 to your computer and use it in GitHub Desktop.
Save Farzadtb/6e7989e14ab65a6e8d53773cfd84b108 to your computer and use it in GitHub Desktop.
import os
import copy
import numpy as np
np.set_printoptions(precision=2, threshold=20, suppress=True)
import pyNastran
pkg_path = pyNastran.path[0]
from pyNastran.utils import print_bad_path
from pyNastran.op2.op2 import read_op2
from pyNastran.utils import object_methods, object_attributes
import pandas as pd
os.chdir(path)
pd.set_option('precision', 3)
np.set_printoptions(precision=3, threshold=20)
#op2_filename = r'D:\work\pynastran_0.8.0\models\iSat\ISat_Launch_Sm_4pt.op2'
op2_filename = os.path.abspath(os.path.join(path, str(modfemfile)+'.op2'))
assert os.path.exists(op2_filename), print_bad_path(op2_filename)
define the input file with a file path
op2 = read_op2(op2_filename, build_dataframe=True, debug=False)
op2stats=op2.get_op2_stats()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment