Skip to content

Commit

Permalink
currently in mostly working state
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosnec committed Dec 21, 2013
1 parent b52dcfd commit 5b4061b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pcat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
def pcat(star_matrix, output, degree=7):
assert degree == 7, \
"PCA of degree != 7 is not yet implemented. Please use degree == 7"
# Saving original directory to go back to later
original_directory = os.getcwd()
# Saving directory of package to use to reference pcat_template.f
source_directory = sys.path[0]
# Changing working directory to output directory so that pcat.f works
os.chdir(output)


## Creating all filenames to use throughout function ##
pcat_source_template_fname = os.path.join(source_directory,
"pcat_template.f")
pcat_compile_fname = os.path.join(output, "pcat")
Expand All @@ -28,7 +32,6 @@ def pcat(star_matrix, output, degree=7):
eigenvectors_fname = os.path.join(output, "eigenvectors.txt")
principle_scores_fname = os.path.join(output, "principle_scores.txt")
reconstruction_fname = os.path.join(output, "reconstruction.txt")
# root = sys.path[0]

number_of_stars = star_matrix.shape[0]
with open(pcat_source_template_fname, "r") as pcat_template, \
Expand Down

0 comments on commit 5b4061b

Please sign in to comment.