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

new features and bugfixes on seissolxdmf and seissolxdmfwriter #17

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

Conversation

Thomas-Ulrich
Copy link
Contributor

@Thomas-Ulrich Thomas-Ulrich commented Jun 14, 2024

  • fix format of extracted seissol output (
    <Grid Name="TimeSeries" GridType="Collection" CollectionType="Temporal">
    should appear only once and not at each time step. Paraview was not complaining about that, but SeisSol/Sampler does.
  • print available variables when the variable to read is not available.
  • replace corrupted time-steps (typically the last one when seissol is interrupted writing) with nans instead of 0s.
  • change setup.py to pyproject.toml (more recent format).
  • remove indices larger than number of output times, avoiding such kind of issue:
(base) ulrich@ulrich-ThinkPad-T490s:~/trash$ seissol_output_extractor dyn_0100_coh0.25_1_B1.2_C0.2_R0.8-fault.xdmf --time "i2,i10,i10000"
args.variables was set to all and now contains ['ASl', 'DS', 'Mud', 'PSR', 'P_n', 'Pn0', 'RT', 'SRd', 'SRs', 'Sld', 'Sls', 'StV', 'T_d', 'T_s', 'Td0', 'Ts0', 'Vr', 'fault-tag', 'partition']
Writing hdf5 output with compression enabled (compression_level=4). 
Use --compression=0 if you want to speed-up data extraction.
ASl: 0it [00:00, ?it/s]time step 10000 of ASl is corrupted, replacing with nans
ASl: 3it [00:00, 562.26it/s]
DS: 0it [00:00, ?it/s]time step 10000 of DS is corrupted, replacing with nans
DS: 3it [00:00, 650.78it/s]
Mud: 0it [00:00, ?it/s]time step 10000 of Mud is corrupted, replacing with nans
Mud: 3it [00:00, 579.30it/s]
PSR: 0it [00:00, ?it/s]time step 10000 of PSR is corrupted, replacing with nans
PSR: 3it [00:00, 652.71it/s]
P_n: 0it [00:00, ?it/s]time step 10000 of P_n is corrupted, replacing with nans
P_n: 3it [00:00, 504.04it/s]
Pn0: 0it [00:00, ?it/s]time step 10000 of Pn0 is corrupted, replacing with nans
Pn0: 3it [00:00, 449.73it/s]
RT: 0it [00:00, ?it/s]time step 10000 of RT is corrupted, replacing with nans
RT: 3it [00:00, 625.98it/s]
SRd: 0it [00:00, ?it/s]time step 10000 of SRd is corrupted, replacing with nans
SRd: 3it [00:00, 392.54it/s]
SRs: 0it [00:00, ?it/s]time step 10000 of SRs is corrupted, replacing with nans
SRs: 3it [00:00, 484.20it/s]
Sld: 0it [00:00, ?it/s]time step 10000 of Sld is corrupted, replacing with nans
Sld: 3it [00:00, 432.31it/s]
Sls: 0it [00:00, ?it/s]time step 10000 of Sls is corrupted, replacing with nans
Sls: 3it [00:00, 476.35it/s]
StV: 0it [00:00, ?it/s]time step 10000 of StV is corrupted, replacing with nans
StV: 3it [00:00, 879.62it/s]
T_d: 0it [00:00, ?it/s]time step 10000 of T_d is corrupted, replacing with nans
T_d: 3it [00:00, 467.35it/s]
T_s: 0it [00:00, ?it/s]time step 10000 of T_s is corrupted, replacing with nans
T_s: 3it [00:00, 312.45it/s]
Td0: 0it [00:00, ?it/s]time step 10000 of Td0 is corrupted, replacing with nans
Td0: 3it [00:00, 403.18it/s]
Ts0: 0it [00:00, ?it/s]time step 10000 of Ts0 is corrupted, replacing with nans
Ts0: 3it [00:00, 377.98it/s]
Vr: 0it [00:00, ?it/s]time step 10000 of Vr is corrupted, replacing with nans
Vr: 3it [00:00, 430.92it/s]
done writing dyn_0100_coh0.25_1_B1.2_C0.2_R0.8_extracted-fault.h5
Traceback (most recent call last):
  File "/home/ulrich/mambaforge/bin/seissol_output_extractor", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ulrich/mambaforge/lib/python3.12/site-packages/seissolxdmfwriter/seissol_output_extractor.py", line 201, in main
    sxw.write_from_seissol_output(
  File "/home/ulrich/mambaforge/lib/python3.12/site-packages/seissolxdmfwriter/seissolxdmfwriter.py", line 512, in write_from_seissol_output
    [sx.ReadTimes()[k] for k in time_indices],
     ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

-- add regionFilter option to filter for fault-tag or locationFlags

(base) ulrich@ulrich-ThinkPad-T490s:~/trash$ seissol_output_extractor dyn_0100_coh0.25_1_B1.2_C0.2_R0.8-fault.xdmf --time "i2,i10,i10000" --regionFilter "3,4,50" --xRange 0 10000  --zRange " -1000" 10000
Regions to filter: [3, 4, 50]
cell count after region filtering: 23638/23638
/home/ulrich/mambaforge/lib/python3.12/site-packages/seissolxdmfwriter/seissol_output_extractor.py:186: UserWarning: spatial filtering significantly slows down this script
  warn("spatial filtering significantly slows down this script")
cell count after spatial filtering: 97/23638
args.variables was set to all and now contains ['ASl', 'DS', 'Mud', 'PSR', 'P_n', 'Pn0', 'RT', 'SRd', 'SRs', 'Sld', 'Sls', 'StV', 'T_d', 'T_s', 'Td0', 'Ts0', 'Vr', 'fault-tag', 'partition']
Writing hdf5 output with compression enabled (compression_level=4). 
Use --compression=0 if you want to speed-up data extraction.
ASl: 2it [00:00, 1028.90it/s]
DS: 2it [00:00, 1156.25it/s]
Mud: 2it [00:00, 1033.97it/s]
PSR: 2it [00:00, 664.60it/s]
P_n: 2it [00:00, 961.78it/s]
Pn0: 2it [00:00, 1108.43it/s]
RT: 2it [00:00, 1223.72it/s]
SRd: 2it [00:00, 1116.99it/s]
SRs: 2it [00:00, 1142.71it/s]
Sld: 2it [00:00, 1164.44it/s]
Sls: 2it [00:00, 1083.94it/s]
StV: 2it [00:00, 1209.43it/s]
T_d: 2it [00:00, 1235.98it/s]
T_s: 2it [00:00, 1159.45it/s]
Td0: 2it [00:00, 1159.61it/s]
Ts0: 2it [00:00, 1147.24it/s]
Vr: 2it [00:00, 1233.26it/s]
done writing dyn_0100_coh0.25_1_B1.2_C0.2_R0.8_extracted-fault.h5
done writing dyn_0100_coh0.25_1_B1.2_C0.2_R0.8_extracted-fault.xdmf
full path: /home/ulrich/trash/dyn_0100_coh0.25_1_B1.2_C0.2_R0.8_extracted-fault.xdmf

@palgunadi1993
Copy link

hi Thomas,
I also want to add bug on this line:
https://github.com/SeisSol/Visualization/blob/master/seissolxdmf/seissolxdmf/seissolxdmf.py#L285

should it be self.ReadDataChunk()?

Thanks.
Kadek

@Thomas-Ulrich Thomas-Ulrich changed the title small updates on seissolxdmf and seissolxdmfwriter new features and bugfixes on seissolxdmf and seissolxdmfwriter Feb 11, 2025
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.

2 participants