#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 19:11:00 2020

@author: Chris
"""

import ovito as ov
import numpy as np
import pickle
import glob
from natsort import natsorted

if __name__== '__main__':
    files = natsorted(glob.glob('*ns.pdb'))
    
    dims = np.zeros(0)
    for f in files:
        pipeline = ov.io.import_file(f)
        data = pipeline.compute()
        s = data.cell.matrix[0,0]
        dims = np.append(dims, s)
        
    pickle.dump(dims, open('dimensions.p', 'wb'))