Skip to content

Travelling wave issue #5

@hayg25

Description

@hayg25

Dear All,
we are facing an error using travelling wave. We use an ascii file that describe the Real part of the Ez field. (Astra creates Ez amplitude. )
here is the beginning of the field file :

0.0463882 0.146368 1.0 3.0
0 0.000460828
0.0019328 0.000520359
0.0038657 0.000713513
0.0057985 0.001090399
0.0077314 0.001747379
0.0096642 0.002854052
0.011597 0.004693939
0.0135299 0.007738147
0.0154627 0.012756721
0.0173956 0.021017368
0.0193284 0.034547562
0.0212612 0.05652299
0.0231941 0.091638022
0.0251269 0.146182363
0.0270598 0.226647868
0.0289926 0.335974245
0.0309254 0.468011834
0.0328583 0.606172101
0.0347911 0.730979055
0.036724 0.830228453
0.0386568 0.90186113
0.0405896 0.949887063
0.0425225 0.979679013

So in lume-astra I am facing an error concerning the first line which has 4 rows ...

see the error when trying the fieldplot :

~/opt/anaconda3/envs/Astra/lib/python3.9/site-packages/astra/fieldmaps.py in load_fieldmaps(astra_input, search_paths, fieldmap_dict, sections, verbose, strip_path)
     84                     astra_input[sec][k] = file
     85 
---> 86                 fmap[file] = np.loadtxt(file)
     87 
     88     # Loop again

~/opt/anaconda3/envs/Astra/lib/python3.9/site-packages/numpy/lib/npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, like)
   1144         # converting the data
   1145         X = None
-> 1146         for x in read_data(_loadtxt_chunksize):
   1147             if X is None:
   1148                 X = np.array(x, dtype)

~/opt/anaconda3/envs/Astra/lib/python3.9/site-packages/numpy/lib/npyio.py in read_data(chunk_size)
    991             if len(vals) != N:
    992                 line_num = i + skiprows + 1
--> 993                 raise ValueError("Wrong number of columns at line %d"
    994                                  % line_num)
    995 

ValueError: Wrong number of columns at line 2

Thanks for the feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions