LANL-Seismoacoustics / infraGA

Methods to simulate propagation of infrasound in the limit of geometric acoustics
Other
22 stars 7 forks source link

Plotting error #10

Open aileenfisher opened 1 month ago

aileenfisher commented 1 month ago

Getting an error using the following commands with ToyAtmo.met and example.cnfg:

infraga sph prop --atmo-file ToyAtmo.met --config-file example.cnfg
infraga plot map --arrivals ToyAtmo.arrivals.dat --plot-option amplitude --title 'Toy Atmo arrival amplitudes' --figure-out ToyAtmo.arrivals.png

So I added print statement at line 775 in plotting.py:

lat_tick, lon_tick = int((lat_max - lat_min) / 5), int((lon_max - lon_min) / 5) print('######################', lat_min, lat_tick, lat_max) #AJF

in order to track down this error I was getting:

(infraga_env) bash-4.2$ infraga plot map --arrivals ToyAtmo.arrivals.dat --plot-option amplitude --title 'Toy Atmo arrival amplitudes' --figure-out ToyAtmo.arrivals.png

/data/studies/apps/infraGA/infraga/plotting.py:79: SyntaxWarning: invalid escape sequence '\d'
  grnd_ht = float(re.findall("\d+\.\d+",line)[0])

Qt: Session management error: None of the authentication protocols specified are supported

###################### 29.0 0 30.0

/data/studies/apps/infraGA/infraga/plotting.py:779: RuntimeWarning: divide by zero encountered in scalar divide
  gl.ylocator = mticker.FixedLocator(np.arange(lat_min - np.ceil(lat_tick / 2), lat_max + lat_tick, lat_tick))
Traceback (most recent call last):
  File "/data/studies/apps/miniconda3/envs/infraga_env/bin/infraga", line 33, in <module>
    sys.exit(load_entry_point('infraga', 'console_scripts', 'infraga')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/studies/apps/miniconda3/envs/infraga_env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/studies/apps/miniconda3/envs/infraga_env/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/data/studies/apps/miniconda3/envs/infraga_env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/studies/apps/miniconda3/envs/infraga_env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/studies/apps/miniconda3/envs/infraga_env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/studies/apps/miniconda3/envs/infraga_env/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/studies/apps/infraGA/infraga/plotting.py", line 779, in plot_map
    gl.ylocator = mticker.FixedLocator(np.arange(lat_min - np.ceil(lat_tick / 2), lat_max + lat_tick, lat_tick))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Maximum allowed size exceeded

So the best I can figure, it's rounding down to lat_tick=0 in this equation:

lat_tick, lon_tick = int((lat_max - lat_min) / 5), int((lon_max - lon_min) / 5)

when lat_max=30 and lat_min=29 and for some reason (I don't know why) that's not aceptable. If I force lat_tick=1, I get past that ValueError.

aileenfisher commented 1 month ago

Also in the --help figure-name should be figure-out

(infraga_env) bash-4.2$ infraga plot map --help
/data/studies/apps/infraGA/infraga/plotting.py:79: SyntaxWarning: invalid escape sequence '\d'
  grnd_ht = float(re.findall("\d+\.\d+",line)[0])
Usage: infraga plot map [OPTIONS]

  Visualize arrivals or ray paths computed using infraga spherical methods on
  a Cartopy map

  Examples:
       infraga plot map --arrivals ToyAtmo.arrivals.dat --plot-option amplitude --title 'Toy Atmo arrival amplitudes' --figure-name ToyAtmo.arrivals.png
       infraga plot map --arrivals ToyAtmo.arrivals.dat --plot-option celerity --title 'Toy Atmo arrival celerity' --figure-name ToyAtmo.celerities.png
       infraga plot map --ray-paths ToyAtmo.raypaths.dat --title 'Toy Atmo ray paths' --figure-name ToyAtmo.raypaths.png