Skip to content

Commit

Permalink
Fixes error with non-existent folder
Browse files Browse the repository at this point in the history
  • Loading branch information
CLangford2098 committed Sep 18, 2024
1 parent 2119204 commit fbdd32e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/tutorials/examples/designing_a_mask.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Orthonormalise with PCA -- you could also use Gram-Schmidt if you prefer.
try:
basis = np.load('files/basis.npy')
except FileNotFoundError:
import os
from sklearn.decomposition import PCA
pca = PCA().fit(full_basis)

Expand All @@ -107,6 +108,7 @@ except FileNotFoundError:
basis = np.concatenate([np.mean(pca.mean_)*np.array(np.ones((1,npix,npix))), components])

# save for use later
os.makedirs('files', exist_ok=True)
np.save('files/basis', basis)
```

Expand Down

0 comments on commit fbdd32e

Please sign in to comment.