Skip to content

Commit

Permalink
❇️ Added a dedicated entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjacquenot committed Dec 21, 2024
1 parent 1b97110 commit ab386f4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion openfast_python/openfast_io/turbsim_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
import pandas as pd
import numpy as np
import argparse
import os
import struct
import time
Expand Down Expand Up @@ -311,5 +312,27 @@ def compute_rot_avg(self, R):
self['rot_avg'][i,:] = u_rot


def main():
# Create argument parser
parser = argparse.ArgumentParser(
description="Read an OpenFAST .bts wind field files")
parser.add_argument(
"input_file",
type=str,
help="Path to the input .bts file."
)

# Parse arguments
args = parser.parse_args()

# Process input and output files
input_file = args.input_file
# ts = TurbSimFile('../_tests/TurbSim.bts')
ts = TurbSimFile(input_file)
df = ts.toDataFrame()
print(df['VertProfile'].info())
print(df['MidLine'].info())


if __name__=='__main__':
ts = TurbSimFile('../_tests/TurbSim.bts')
main()

0 comments on commit ab386f4

Please sign in to comment.