Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alc and gex header fix #10

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

alc and gex header fix #10

wants to merge 9 commits into from

Conversation

mp-emrld
Copy link
Contributor

@mp-emrld mp-emrld commented May 2, 2022

Did some minor modifications, so that Aarhus Workbench can read the xyz-data and alc-file written with libaarhus.dump(...)
Might be a bit ugly but is working. Feel free to change the coding to be more "pythonic" ;-).

Did the following modifications:

  • all channel/gate related information in .alc file must end on Gate_Ch01_45 not Gate_Ch01_[44].
  • the first gate channel must be numbered with 01 not 00 (like Gate_Ch01_01 instead of Gate_Ch01_[00]).
  • The xyz file must only have 1 header line, when input to AarhusWorkbench, so data['model_info'] must be skipped and not written to file.

@@ -142,13 +142,14 @@ def _un_split_layer_columns(data):

def _dump(data, file, alcfile=None):
df = _un_split_layer_columns(data)
for key, value in data['model_info'].items():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose adding separate argument skip_header or somesuch, as this throws away info in a non-obvious way?

@@ -27,10 +37,19 @@ def is_supported_field(fieldname):
def _dump(xyz, f, columns=None):
if columns is None:
columns = xyz["file_meta"]["columns"]
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split this into a separate function?

columns = clean_column_names(columns)

@redhog
Copy link
Member

redhog commented May 16, 2022

A bit sceptical to including 9999 verbatim as a NaN value... Isn't this specified in a header in many xyz files? Possibly better to filter in the dataframe rather than in parsing maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants