Giter VIP home page Giter VIP logo

lasif_2.0's People

Contributors

afichtner avatar dirkphilip avatar flo-woelfl avatar krischer avatar larsgeb avatar phlos avatar solvithrastar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lasif_2.0's Issues

adapted irregular mesh with lasif

Hello, here I ran into one problem when using the irregular mesh from salvus smoothsem,
but get an error which is related to the domain identification:

/tmp/ipykernel_30620/1694013832.py in
1 events=lasif.api.list_events(lasif_root, output=True)
----> 2 submit_forward('1','buildmesh/japan_hindu.h5',events)

/tmp/ipykernel_30620/1399908083.py in submit_forward(iteration, modelfile, events)
41 event=event,
42 iteration=iteration,
---> 43 side_set="r1"
44 )
45 if i%5==0 and i!=0 :

~/Salvus/salvus_lasif_yjgao-main/LASIF_2.0/lasif/salvus_utils.py in create_salvus_forward_simulation(comm, event, iteration, mesh, side_set)
95 mesh, sim_set["absorbing_boundaries_in_km"]
96 )
---> 97 if not domain.is_global_domain():
98 absorbing = sc.boundary.Absorbing(
99 width_in_meters=comm.project.simulation_settings[

~/Salvus/salvus_lasif_yjgao-main/LASIF_2.0/lasif/domain.py in is_global_domain(self)
503 def is_global_domain(self):
504 if not self.is_read:
--> 505 self._read()
506
507 if self.is_global_mesh:

~/Salvus/salvus_lasif_yjgao-main/LASIF_2.0/lasif/domain.py in _read(self)
188 # the points on the boundary are arranged in a way that a proper
189 # polygon will be drawn.
--> 190 sorted_indices = self.get_sorted_edge_coords()
191 x, y, z = self.domain_edge_coords[np.append(sorted_indices, 0)].T
192 lats, lons, _ = xyz_to_lat_lon_radius(x[0], y[0], z[0])

~/Salvus/salvus_lasif_yjgao-main/LASIF_2.0/lasif/domain.py in get_sorted_edge_coords(self)
478 # start sorting with the first node
479 print(indices_sorted)
--> 480 indices_sorted[0] = 0
481 for i in range(num_edge_points)[1:]:
482 prev_idx = indices_sorted[i - 1]

IndexError: index 0 is out of bounds for axis 0 with size 0

Below is the mesh building:

sm = SmoothieSEM()
sm.basic.model = "csem"
sm.basic.min_period_in_seconds = 30.0
sm.basic.elements_per_wavelength = 2.0
sm.basic.number_of_lateral_elements = 24
sm.advanced.tensor_order = 1

sm.source.latitude = 40
sm.source.longitude = 140
sm.chunk.max_colatitude = 80.0
sm.spherical.min_radius = 4000.0
sm.topography.topography_file = "topography_earth2014_egm2008_lmax_10800.nc"
sm.topography.topography_varname = (
"topography_earth2014_egm2008_lmax_10800_lmax_4096"
)
sm.topography.moho_topography_file = "moho_topography_crust_1_0_egm2008.nc"
sm.topography.moho_topography_varname = (
"moho_topography_crust_1_0_egm2008_lmax_128"
)
sm.refinement.lateral_refinements = [
{
"theta_min": 40.0,
"theta_max": 70.0,
"r_min": 4500.0,
"phi_min": -15.0,
"phi_max": 15.0,
}
]

sm.source.azimuth = 290.0

from obspy.clients.fdsn import Client

source = sn.simple_config.source.seismology.SideSetMomentTensorPoint3D(
latitude=40,
longitude=140,
depth_in_m=120,
side_set_name="r1",
mrr=5.47e15,
mtt=-4.11e16,
mpp=3.56e16,
mrt=2.26e16,
mrp=-2.25e16,
mtp=1.92e16,
)

get USarray stations from iris

inv = Client("gfz").get_stations(
network="*", level="station", format="text",minlatitude=34.782,
maxlatitude=46.5322,minlongitude=66.3029, maxlongitude=88.2316)

inv2 = Client("iris").get_stations(
network="*", level="station", format="text",minlatitude=34.782,
maxlatitude=46.5322,minlongitude=66.3029, maxlongitude=88.2316)

receivers = sn.simple_config.receiver.seismology.parse(
inv, dimensions=3, fields=["displacement"]
)

receivers2 = sn.simple_config.receiver.seismology.parse(
inv2, dimensions=3, fields=["displacement"]
)

newreceivers=receivers+receivers2

event_collection = sn.EventCollection.from_sources(
sources=[source], receivers=newreceivers
)
sm.spherical.ellipticity = 0.0033528106647474805
from salvus.mesh.mask_generators import RayMaskGenerator
rmg = RayMaskGenerator(
event_collection,
phases=["P","pP","S","sS"],
number_of_points_per_ray=100,
distance_in_km=1000.0,
)

m= sm.create_mesh(mesh_processing_callback=rmg)
m.find_surface()
#print(m.side_sets)
m.get_element_nodes().shape
m.side_sets['r1']
m.map_nodal_fields_to_element_nodal()
m.attach_global_variable("reference_frame", "spherical")
m.attach_global_variable("rotation_convention", "Spherical")
m.write_h5('japan_hindu.h5')

LASIF without Salvus

Hi, I want to use LASIF but I wasn't able to install Salvus because it is subject to licensing fees that I can't afford right now.

Is there a tutorial on using LASIF with a solver other than Salvus?

Selecting events on a global mesh takes a long time to do nothing.

Hey guys,

When I want to select events for a global mesh, the automatic event selection filters the entire catalogue for events that are actually within the mesh. This is of course a bit superfluous, as the mesh is global and all events in the catalogue should fall within it. I am guessing there are a few other operations within LASIF that filter on domain as well which aren't necessarily needed for global meshes.

One idea to speed up these kind of operations is by setting a field for a mesh being global, and skipping filtering. I'll look into this when I find the time.

Installation error with (unnecessary?) `typing` in environment.yml

Hi guys,
Problem: I tried reinstalling lasif2 (after foolishly removing my env without backup) and ran into issues with the typing library: AttributeError: type object 'Callable' has no attribute '_abc_registry'

Steps to reproduce:

  1. Update conda conda update conda
  2. Clone git repo git clone https://github.com/dirkphilip/LASIF_2.0.git
  3. Install environment conda env create -f environment.yml (where I have renamed the env to lasif2 to differentiate it from the old lasif which I have also installed on my system).
  4. Activate env conda activate lasif2
  5. cd into LASIF_2.0 directory and install: cd LASIF_2.0; pip install -e .
    This final step resulted in the following relevant output:
    AttributeError: type object 'Callable' has no attribute '_abc_registry'

Potential cause
I had a bit of a look around, and for example here and here are mentions of issues with python 3.7, the typing library (and maybe certain pip versions, but since typing is here not downloaded over pip I'm assuming that has nothing to do with my issue).

?Solution?
I solved this by removing typing: conda uninstall typing - then the installation ran without problem.
I also tested installing a test env with lasif where I'd simply removed typing from the environment.yml file. This seems to yield exactly the same result.

Question
I'm still marking this as an issue because I'm wondering where this issue popped up -- presumably you guys use py3.7 as well without this problem. Any ideas?

My full conda env, fwiw:

$ conda list
# packages in environment at /home/phlos/anaconda3/envs/lasif2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
attrs                     19.3.0                     py_0    conda-forge
babel                     2.8.0                      py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
bleach                    3.1.5              pyh9f0ad1d_0    conda-forge
brotlipy                  0.7.0           py37h8f50634_1000    conda-forge
ca-certificates           2020.4.5.1           hecc5488_0    conda-forge
cairo                     1.16.0            hcf35c78_1003    conda-forge
cartopy                   0.17.0          py37hd759880_1006    conda-forge
certifi                   2020.4.5.1       py37hc8dfbb8_0    conda-forge
cffi                      1.14.0           py37hd463f26_0    conda-forge
chardet                   3.0.4           py37hc8dfbb8_1006    conda-forge
click                     7.1.2                    pypi_0    pypi
cmasher                   1.3.1                    pypi_0    pypi
colorama                  0.4.3                      py_0    conda-forge
colorspacious             1.1.2                    pypi_0    pypi
cryptography              2.9.2            py37hb09aad4_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
dbus                      1.13.6               he372182_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
dill                      0.3.1.1          py37hc8dfbb8_1    conda-forge
docutils                  0.16             py37hc8dfbb8_1    conda-forge
entrypoints               0.3             py37hc8dfbb8_1001    conda-forge
expat                     2.2.9                he1b5a44_2    conda-forge
flake8                    3.8.1                    pypi_0    pypi
flask                     1.1.2                    pypi_0    pypi
flask-cache               0.13.1                   pypi_0    pypi
fontconfig                2.13.1            h86ecdb6_1001    conda-forge
freetype                  2.10.2               he06d7ca_0    conda-forge
fribidi                   1.0.9                h516909a_0    conda-forge
future                    0.18.2           py37hc8dfbb8_1    conda-forge
geographiclib             1.50                     pypi_0    pypi
geojson                   2.5.0                    pypi_0    pypi
geos                      3.7.2                he1b5a44_2    conda-forge
gettext                   0.19.8.1          hc5be6a0_1002    conda-forge
glib                      2.64.2               h6f030ca_1    conda-forge
graphite2                 1.3.13            he1b5a44_1001    conda-forge
graphviz                  2.42.3               h0511662_0    conda-forge
gst-plugins-base          1.14.5               h0935bb2_2    conda-forge
gstreamer                 1.14.5               h36ae1b5_2    conda-forge
h5netcdf                  0.8.0                    pypi_0    pypi
h5py                      2.10.0          nompi_py37h513d04c_102    conda-forge
harfbuzz                  2.4.0                h9f30f68_3    conda-forge
hdf5                      1.10.5          nompi_h3c11f04_1104    conda-forge
html5lib                  1.0.1                      py_0    conda-forge
icu                       64.2                 he1b5a44_1    conda-forge
idna                      2.9                        py_1    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        1.6.0            py37hc8dfbb8_0    conda-forge
importlib_metadata        1.6.0                         0    conda-forge
ipydatawidgets            4.0.1                      py_0    conda-forge
ipykernel                 5.2.1            py37h43977f1_0    conda-forge
ipyscales                 0.4.0                      py_1    conda-forge
ipython                   7.14.0           py37hc8dfbb8_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1                      py_0    conda-forge
isodate                   0.6.0                      py_1    conda-forge
itsdangerous              1.1.0                    pypi_0    pypi
jedi                      0.17.0           py37hc8dfbb8_0    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
joblib                    0.15.1                     py_0    conda-forge
jpeg                      9c                h14c3975_1001    conda-forge
jsonschema                3.2.0            py37hc8dfbb8_1    conda-forge
jupyter                   1.0.0                      py_2    conda-forge
jupyter_client            6.1.3                      py_0    conda-forge
jupyter_console           6.1.0                      py_1    conda-forge
jupyter_contrib_core      0.3.3                      py_2    conda-forge
jupyter_contrib_nbextensions 0.5.1                    py37_0    conda-forge
jupyter_core              4.6.3            py37hc8dfbb8_1    conda-forge
jupyter_highlight_selected_word 0.2.0                 py37_1000    conda-forge
jupyter_latex_envs        1.4.6                 py37_1000    conda-forge
jupyter_nbextensions_configurator 0.4.1                    py37_0    conda-forge
jupytext                  1.4.2              pyh9f0ad1d_0    conda-forge
keepalive                 0.5                        py_1    conda-forge
kiwisolver                1.2.0            py37h99015e2_0    conda-forge
lasif                     0453b-dirty               dev_0    <develop>
ld_impl_linux-64          2.34                 h53a641e_1    conda-forge
libblas                   3.8.0               16_openblas    conda-forge
libcblas                  3.8.0               16_openblas    conda-forge
libclang                  9.0.1           default_hde54327_0    conda-forge
libffi                    3.2.1             he1b5a44_1007    conda-forge
libgcc-ng                 9.2.0                h24d8f2e_2    conda-forge
libgfortran-ng            7.5.0                hdf63c60_6    conda-forge
libiconv                  1.15              h516909a_1006    conda-forge
liblapack                 3.8.0               16_openblas    conda-forge
libllvm9                  9.0.1                he513fc3_1    conda-forge
libopenblas               0.3.9                h5ec1e0e_0    conda-forge
libpng                    1.6.37               hed695b0_1    conda-forge
libsodium                 1.0.17               h516909a_0    conda-forge
libstdcxx-ng              9.2.0                hdf63c60_2    conda-forge
libtiff                   4.1.0                hc7e4089_6    conda-forge
libtool                   2.4.6             h14c3975_1002    conda-forge
libuuid                   2.32.1            h14c3975_1000    conda-forge
libwebp-base              1.1.0                h516909a_3    conda-forge
libxcb                    1.13              h14c3975_1002    conda-forge
libxkbcommon              0.10.0               he1b5a44_0    conda-forge
libxml2                   2.9.10               hee79883_0    conda-forge
libxslt                   1.1.33               h31b3aaa_0    conda-forge
llvm-openmp               10.0.0               hc9558a2_0    conda-forge
lxml                      4.5.1            py37he3881c9_0    conda-forge
lz4-c                     1.9.2                he1b5a44_1    conda-forge
markupsafe                1.1.1            py37h8f50634_1    conda-forge
matplotlib                3.2.1                         0    conda-forge
matplotlib-base           3.2.1            py37h30547a4_0    conda-forge
mccabe                    0.6.1                    pypi_0    pypi
mistune                   0.8.4           py37h8f50634_1001    conda-forge
mock                      4.0.2            py37hc8dfbb8_0    conda-forge
more-itertools            8.3.0                      py_0    conda-forge
mpi                       1.0                     openmpi    conda-forge
mpi4py                    3.0.3            py37hbfacf26_1    conda-forge
nbconvert                 5.6.1            py37hc8dfbb8_1    conda-forge
nbformat                  5.0.6                      py_0    conda-forge
ncurses                   6.1               hf484d3e_1002    conda-forge
networkx                  2.4                        py_1    conda-forge
nose                      1.3.7           py37hc8dfbb8_1004    conda-forge
notebook                  6.0.3            py37hc8dfbb8_0    conda-forge
nspr                      4.25                 he1b5a44_0    conda-forge
nss                       3.47                 he751ad9_0    conda-forge
numexpr                   2.7.1            py37h0da4684_1    conda-forge
numpy                     1.16.5           py37h95a1406_0    conda-forge
obspy                     1.2.1            py37h03ebfcd_1    conda-forge
olefile                   0.46                       py_0    conda-forge
openmpi                   4.0.3                hdf1f1ad_1    conda-forge
openssl                   1.1.1g               h516909a_0    conda-forge
owslib                    0.19.2                     py_0    conda-forge
packaging                 20.4               pyh9f0ad1d_0    conda-forge
pandas                    1.0.3            py37h0da4684_1    conda-forge
pandoc                    2.9.2.1                       0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
pango                     1.42.4               h7062337_4    conda-forge
parso                     0.7.0              pyh9f0ad1d_0    conda-forge
pathlib                   1.0.1            py37hc8dfbb8_2    conda-forge
pcre                      8.44                 he1b5a44_0    conda-forge
pexpect                   4.8.0            py37hc8dfbb8_1    conda-forge
pickleshare               0.7.5           py37hc8dfbb8_1001    conda-forge
pillow                    7.1.2            py37h718be6c_0    conda-forge
pip                       20.1.1             pyh9f0ad1d_0    conda-forge
pixman                    0.38.0            h516909a_1003    conda-forge
pluggy                    0.13.1           py37hc8dfbb8_1    conda-forge
progressbar               2.5                        py_0    conda-forge
proj4                     5.2.0             he1b5a44_1006    conda-forge
prometheus_client         0.7.1                      py_0    conda-forge
prompt-toolkit            3.0.5                      py_0    conda-forge
prompt_toolkit            3.0.5                         0    conda-forge
prov                      1.5.3                      py_1    conda-forge
pthread-stubs             0.4               h14c3975_1001    conda-forge
ptyprocess                0.6.0                   py_1001    conda-forge
py                        1.8.1                      py_0    conda-forge
pyasdf                    0.6.1                    pypi_0    pypi
pycodestyle               2.6.0                    pypi_0    pypi
pycparser                 2.20                       py_0    conda-forge
pydot                     1.4.1           py37hc8dfbb8_1002    conda-forge
pyepsg                    0.4.0                      py_0    conda-forge
pyexodus                  0.1.3                    pypi_0    pypi
pyflakes                  2.2.0                    pypi_0    pypi
pygments                  2.6.1                      py_0    conda-forge
pykdtree                  1.3.1           py37h03ebfcd_1003    conda-forge
pyopenssl                 19.1.0                     py_1    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyproj                    1.9.6           py37h516909a_1002    conda-forge
pyqt                      5.12.3           py37h8685d9f_3    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtchart                 5.12                     pypi_0    pypi
pyqtgraph                 0.11.0rc0                  py_0    conda-forge
pyqtwebengine             5.12.1                   pypi_0    pypi
pyrsistent                0.16.0           py37h8f50634_0    conda-forge
pyshp                     2.1.0                      py_0    conda-forge
pysocks                   1.7.1            py37hc8dfbb8_1    conda-forge
pytest                    5.4.2            py37hc8dfbb8_0    conda-forge
python                    3.7.6           h8356626_5_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pythreejs                 2.2.0              pyh8c360ce_0    conda-forge
pytz                      2020.1             pyh9f0ad1d_0    conda-forge
pyyaml                    5.3.1            py37h8f50634_0    conda-forge
pyzmq                     19.0.1           py37hac76be4_0    conda-forge
qt                        5.12.5               hd8c4c69_1    conda-forge
qtconsole                 4.7.4              pyh9f0ad1d_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
rdflib                    5.0.0            py37hc8dfbb8_2    conda-forge
readline                  8.0                  hf8c457e_0    conda-forge
requests                  2.23.0             pyh8c360ce_2    conda-forge
salvus-seismo             0.0.0-gf867               dev_0    <develop>
scipy                     1.4.1            py37ha3d9a3c_3    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                46.4.0           py37hc8dfbb8_0    conda-forge
shapely                   1.6.4           py37hec07ddf_1006    conda-forge
six                       1.14.0                     py_1    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
sparqlwrapper             1.8.5           py37hc8dfbb8_1003    conda-forge
sphinx                    3.0.3                      py_0    conda-forge
sphinx_rtd_theme          0.4.3                      py_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
sqlalchemy                1.3.17           py37h8f50634_0    conda-forge
sqlite                    3.30.1               hcee41ef_0    conda-forge
sysroot_linux-64          2.12                 h3a0023d_1    conda-forge
terminado                 0.8.3            py37hc8dfbb8_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
tk                        8.6.10               hed695b0_0    conda-forge
toml                      0.10.1                   pypi_0    pypi
tornado                   6.0.4            py37h8f50634_1    conda-forge
tqdm                      4.46.0                   pypi_0    pypi
traitlets                 4.3.3            py37hc8dfbb8_1    conda-forge
traittypes                0.2.1                      py_1    conda-forge
urllib3                   1.25.9                     py_0    conda-forge
wcwidth                   0.1.9              pyh9f0ad1d_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                     py_1    conda-forge
widgetsnbextension        3.5.1                    py37_0    conda-forge
xorg-kbproto              1.0.7             h14c3975_1002    conda-forge
xorg-libice               1.0.10               h516909a_0    conda-forge
xorg-libsm                1.2.3             h84519dc_1000    conda-forge
xorg-libx11               1.6.9                h516909a_0    conda-forge
xorg-libxau               1.0.9                h14c3975_0    conda-forge
xorg-libxdmcp             1.1.3                h516909a_0    conda-forge
xorg-libxext              1.3.4                h516909a_0    conda-forge
xorg-libxpm               3.5.13               h516909a_0    conda-forge
xorg-libxrender           0.9.10            h516909a_1002    conda-forge
xorg-libxt                1.1.5             h516909a_1003    conda-forge
xorg-renderproto          0.11.1            h14c3975_1002    conda-forge
xorg-xextproto            7.3.0             h14c3975_1002    conda-forge
xorg-xproto               7.0.31            h14c3975_1007    conda-forge
xz                        5.2.5                h516909a_0    conda-forge
yaml                      0.2.4                h516909a_0    conda-forge
zeromq                    4.3.2                he1b5a44_2    conda-forge
zipp                      3.1.0                      py_0    conda-forge
zlib                      1.2.11            h516909a_1006    conda-forge
zstd                      1.4.4                h6597ccf_3    conda-forge

adjoint simulation adjoint source

Source idx 25 at location [ 1.69635e+06, 4.48826e+06, 4.19137e+06 ] was not attached. Please check the coordinates ...
Weird problem though the source are in the center of domain.

py.test shows some assertion errors

Hi, sorry to bother you guys, but I encountered some assertion errors when executing the py.test command after I install the LASIF_2.0 through pyenv(not anaconda).

I'm a rookie at Seismology. And I'm not sure what's wrong with my installation.

Here is some info about my env.
platform MacOS Monterey
Python 3.7.13
Python packages:
alabaster 0.7.12
appnope 0.1.3
attrs 22.2.0
Babel 2.11.0
backcall 0.2.0
Cartopy 0.20.3
certifi 2022.12.7
charset-normalizer 2.1.1
click 8.1.3
cmasher 1.6.3
colorama 0.4.6
colorspacious 1.1.2
cycler 0.11.0
debugpy 1.6.4
decorator 5.1.1
dill 0.3.6
docutils 0.17.1
e13tools 0.9.6
entrypoints 0.4
exceptiongroup 1.1.0
Flask 2.2.2
Flask-Cache 0.13.1
fonttools 4.38.0
geographiclib 2.0
geojson 2.5.0
greenlet 2.0.1
h5py 3.7.0
idna 3.4
imagesize 1.4.1
importlib-metadata 6.0.0
iniconfig 1.1.1
ipydatawidgets 4.3.2
ipykernel 6.16.2
ipython 7.34.0
ipywidgets 8.0.4
isodate 0.6.1
itsdangerous 2.1.2
jedi 0.18.2
Jinja2 3.1.2
joblib 1.2.0
jupyter_client 7.4.8
jupyter_core 4.12.0
jupyterlab-widgets 3.0.5
kiwisolver 1.4.4
lasif 0.0.1 /Users/yanghaote2/Documents/code/LASIF_2.0
lxml 4.9.2
MarkupSafe 2.1.1
matplotlib 3.5.3
matplotlib-inline 0.1.6
mock 5.0.0
nest-asyncio 1.5.6
networkx 2.6.3
nose 1.3.7
numexpr 2.8.4
numpy 1.21.6
obspy 1.3.1
packaging 22.0
pandas 1.3.5
parso 0.8.3
pathlib 1.0.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.4.0
pip 22.3.1
pluggy 1.0.0
progressbar 2.5
prompt-toolkit 3.0.36
prov 2.0.0
psutil 5.9.4
ptyprocess 0.7.0
pyasdf 0.7.5
Pygments 2.14.0
pyparsing 3.0.9
pyproj 3.2.1
PyQt5 5.15.7
PyQt5-Qt5 5.15.2
PyQt5-sip 12.11.0
pyqtgraph 0.12.4
pyshp 2.3.1
pytest 7.2.0
python-dateutil 2.8.2
pythreejs 2.4.1
pytz 2022.7
pyzmq 24.0.1
rdflib 6.2.0
requests 2.28.1
scipy 1.7.3
seaborn 0.12.2
setuptools 47.1.0
Shapely 1.8.5
six 1.16.0
snowballstemmer 2.2.0
Sphinx 5.3.0
sphinx-rtd-theme 1.1.1
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy 1.4.46
toml 0.10.2
tomli 2.0.1
tornado 6.2
tqdm 4.64.1
traitlets 5.8.0
traittypes 0.2.1
typing_extensions 4.4.0
urllib3 1.26.13
wcwidth 0.2.5
Werkzeug 2.2.2
widgetsnbextension 4.0.4
zipp 3.11.0

AssertionError:

$LASIF_2.0 git:(master) py.test                                                                     3.7.13
Exception ignored in: <function Popen.__del__ at 0x10e332dd0>
Traceback (most recent call last):
  File "/Users/yanghaote2/.pyenv/versions/3.7.13/lib/python3.7/subprocess.py", line 883, in __del__
    ResourceWarning, source=self)
ResourceWarning: subprocess 75182 is still running
Exception ignored in: <function Popen.__del__ at 0x10e332dd0>
Traceback (most recent call last):
  File "/Users/yanghaote2/.pyenv/versions/3.7.13/lib/python3.7/subprocess.py", line 883, in __del__
    ResourceWarning, source=self)
ResourceWarning: subprocess 75183 is still running
============================================ test session starts ============================================
platform darwin -- Python 3.7.13, pytest-7.2.0, pluggy-1.0.0
rootdir: /Users/yanghaote2/Documents/code/LASIF_2.0, configfile: pytest.ini
collected 207 items                                                                                         

lasif/rotations.py ....                                                                               [  1%]
lasif/utils.py ...                                                                                    [  3%]
lasif/window_selection.py .                                                                           [  3%]
lasif/components/events.py ..                                                                         [  4%]
lasif/components/iterations.py .                                                                      [  5%]
lasif/function_templates/process_data.py s                                                            [  5%]
lasif/function_templates/window_picking_function.py s                                                 [  6%]
lasif/tests/test_adjoint_sources.py ....                                                              [  8%]
lasif/tests/test_api.py .............................                                                 [ 22%]
lasif/tests/test_cli_interface.py .................s......                                            [ 33%]
lasif/tests/test_code_formatting.py s                                                                 [ 34%]
lasif/tests/test_domain.py .......................................................................... [ 70%]
.......................                                                                               [ 81%]
lasif/tests/test_rotations.py ..                                                                      [ 82%]
lasif/tests/test_utils.py .                                                                           [ 82%]
lasif/tests/test_window_selection.py .                                                                [ 83%]
lasif/tests/components/test_adjoint_sources_component.py .FF.                                         [ 85%]
lasif/tests/components/test_downloads_component.py .                                                  [ 85%]
lasif/tests/components/test_events_component.py ......                                                [ 88%]
lasif/tests/components/test_iterations_component.py ....                                              [ 90%]
lasif/tests/components/test_project_component.py F...                                                 [ 92%]
lasif/tests/components/test_query_component.py ...                                                    [ 93%]
lasif/tests/components/test_validator_component.py ..                                                 [ 94%]
lasif/tests/components/test_visualization_component.py ssssssss                                       [ 98%]
lasif/tests/data/example_project/FUNCTIONS/process_data.py s                                          [ 99%]
lasif/tests/data/example_project/FUNCTIONS/window_picking_function.py s                               [ 99%]
lasif/tools/adjoint/utils.py .                                                                        [100%]

================================================= FAILURES ==================================================
_________________________________________ test_get_misfit_for_event _________________________________________

comm = <lasif.components.communicator.Communicator object at 0x13831f9d0>

    def test_get_misfit_for_event(comm):
        events = lasif.api.list_events(comm, output=True)
        iteration = lasif.api.list_iterations(comm, output=True)[0]
        lasif.api.calculate_adjoint_sources_multiprocessing(comm, iteration, "A")
        misfit = comm.adj_sources.get_misfit_for_event(
            event=events[0], iteration=iteration
        )
>       np.testing.assert_almost_equal(misfit, 1.301670132868937)
E       AssertionError: 
E       Arrays are not almost equal to 7 decimals
E        ACTUAL: 1.3016674437258846
E        DESIRED: 1.301670132868937

/Users/yanghaote2/Documents/code/LASIF_2.0/lasif/tests/components/test_adjoint_sources_component.py:57: AssertionError
------------------------------------------- Captured stdout call --------------------------------------------

===========================================================
Starting adjoint source calculation for event 1 of 2...
===========================================================

Writing adjoint sources...
1 Adjoint sources are in your file.
Finalizing adjoint sources...

===========================================================
Starting adjoint source calculation for event 2 of 2...
===========================================================

Writing adjoint sources...
1 Adjoint sources are in your file.
Finalizing adjoint sources...
------------------------------------------- Captured stderr call --------------------------------------------
100%|██████████| 4/4 [00:00<00:00, 43.20it/s]
100%|██████████| 4/4 [00:00<00:00, 17.19it/s]
______________________________________ test_calculate_adjoint_sources _______________________________________

comm = <lasif.components.communicator.Communicator object at 0x1383f58d0>

    def test_calculate_adjoint_sources(comm):
        events = lasif.api.list_events(comm, output=True)
        file = (
            comm.project.paths["adjoint_sources"]
            / "ITERATION_1"
            / events[0]
            / "auxiliary_adjoint.npy"
        )
        should_be = np.load(file)
        lasif.api.calculate_adjoint_sources_multiprocessing(comm, "1", "A", weight_set="sw_1")
        output = (
            comm.project.paths["adjoint_sources"]
            / "ITERATION_1"
            / events[0]
            / "adjoint_source_auxiliary.h5"
        )
        with pyasdf.ASDFDataSet(output) as ds:
            adj = ds.auxiliary_data.AdjointSources.HT_ALN.Channel__HHZ.data[()]
>       np.testing.assert_array_almost_equal(should_be, adj)
E       AssertionError: 
E       Arrays are not almost equal to 6 decimals
E       
E       (shapes (30002,), (30001,) mismatch)
E        x: array([0., 0., 0., ..., 0., 0., 0.])
E        y: array([0., 0., 0., ..., 0., 0., 0.])

/Users/yanghaote2/Documents/code/LASIF_2.0/lasif/tests/components/test_adjoint_sources_component.py:103: AssertionError
------------------------------------------- Captured stdout call --------------------------------------------

===========================================================
Starting adjoint source calculation for event 1 of 2...
===========================================================

Writing adjoint sources...
1 Adjoint sources are in your file.
Finalizing adjoint sources...

===========================================================
Starting adjoint source calculation for event 2 of 2...
===========================================================

Writing adjoint sources...
1 Adjoint sources are in your file.
Finalizing adjoint sources...
------------------------------------------- Captured stderr call --------------------------------------------
100%|██████████| 4/4 [00:00<00:00, 47.66it/s]
100%|██████████| 4/4 [00:00<00:00, 17.33it/s]
___________________________________ test_config_file_creation_and_parsing ___________________________________

tmpdir = local('/private/var/folders/_4/17zvg8wd3vbf51txxcqystc00000gq/T/pytest-of-yanghaote2/pytest-3/test_config_file_creation_and_0')

    def test_config_file_creation_and_parsing(tmpdir):
        """
        Tests the creation of a default config file and the reading of the file.
        """
        # Create a new project.
        pr = Project(
            project_root_path=pathlib.Path(str(tmpdir)).absolute(),
            init_project="TestProject",
        )
        del pr
    
        # Init it once again.
        pr = Project(pathlib.Path(str(tmpdir)).absolute())
    
        # Assert the config file will test the creation of the default file and the
        # reading.
        assert pr.lasif_config["project_name"] == "TestProject"
        assert pr.lasif_config["description"] == ""
        assert pr.lasif_config["download_settings"]["channel_priorities"] == [
            "BH?",
            "LH[Z,N,E]",
            "HH[Z,N,E]",
            "EH[Z,N,E]",
            "MH[Z,N,E]",
        ]
        assert pr.lasif_config["download_settings"]["location_priorities"] == [
            "",
            "00",
            "10",
            "20",
            "01",
            "02",
        ]
        assert pr.lasif_config["download_settings"]["networks"] == "None"
    
        assert (
            pr.lasif_config["download_settings"]["interstation_distance_in_m"]
            == 1000.0
        )
        assert (
            pr.lasif_config["download_settings"]["seconds_after_event"] == 3600.0
        )
        assert (
            pr.lasif_config["download_settings"]["seconds_before_event"] == 300.0
        )
>       assert not pr.salvus_settings["attenuation"]
E       assert not True

/Users/yanghaote2/Documents/code/LASIF_2.0/lasif/tests/components/test_project_component.py:80: AssertionError
========================================== short test summary info ==========================================
FAILED lasif/tests/components/test_adjoint_sources_component.py::test_get_misfit_for_event - AssertionError: 
FAILED lasif/tests/components/test_adjoint_sources_component.py::test_calculate_adjoint_sources - AssertionError: 
FAILED lasif/tests/components/test_project_component.py::test_config_file_creation_and_parsing - assert not True
================================ 3 failed, 190 passed, 14 skipped in 24.60s =================================

Fancy Adjoint source plots

Have the plots for the time frequency adjoint source fancier. A bit more like they used to be. I'm submitting this as an issue just so I won't forget :)

Refactoring of `absorbing_boundaries_in_km` into `simulation_settings` was incomplete

In a recent commit the absorbing_boundaries_in_km was refactored from salvus_settings into simulation_settings. This was reflected in the following line change of the create_salvus_forward_simulation method in the salvus_utils module.

mesh, comm.project.simulation_settings["absorbing_boundaries_in_km"]

However, a few lines further, this variable is used again, and taken from the old dictionary:

width_in_meters=comm.project.salvus_settings[
"absorbing_boundaries_in_km"
]

This raises an exception when the used mesh is not global. Simple refactor would be sufficient, but I'll put that burden on the original muppet who introduced the bug, @solvithrastar .

Segmentation fault (core dumped)

Generating input files for event 1 of 116 -- 2410946_2007test
Segmentation fault (core dumped)

hey cool guys, here I confronted with segmentation fault running the lasif generate_input_files ..., have you any ideas about that? Thanks!

MPI: undefined symbol error

Hi,

when trying to install LASIF 2.0 based on your github instructions I get the following error (in a fresh environment):

ImportError: .../miniconda3/envs/TEST/lib/python3.6/site-packages/mpi4py/MPI.cpython-36m-x86_64-linux-gnu.so: undefined symbol: MPI_Type_create_f90_integer

when carrying out

python -c "import pyasdf; pyasdf.print_sys_info()"
and/or
py.test

based on the following installation lines:

re-install it using pip

$ pip install mpi4py

Install a parallel version of hdf5

$ conda install -c spectraldns h5py-parallel

It was working fine several weeks ago - were there some changes or may it interfere with the integrated Salvus MPI I installed later on (in a separate env though)?

Cheers,
Debby

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.