FESOM / tripyview

Triangular plotting for FESOM2
MIT License
4 stars 3 forks source link

Maximum allowed size exceeded in transect_zmean #130

Closed JanStreffing closed 2 weeks ago

JanStreffing commented 2 months ago

Running:

 --> compute transect_zmean:
     --> compute: Kv
          --> compute box_region: ['global']

for a ref and run each 60 years long core2 I get:


papermill.exceptions.PapermillExecutionError:
---------------------------------------------------------------------------
Exception encountered at "In [7]":
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[7], line 29
     26 else: cb_plt, cb_plt_single, cinfo0 = True, True, cinfo.copy()
     28 #__________________________________________________________________________________________________
---> 29 hfig, hax, hcb = tpv.plot_vslice(mesh, data_list, nrow=nrow0, ncol=ncol0, box_idx=box_idx,
     30                                  cinfo=cinfo0, do_rescale=do_rescale,
     31                                  do_plt=do_plt, plt_contb=plt_contb, plt_contf=plt_contf, plt_contr=plt_contr, plt_contl=plt_contl, do_enum=do_enum,
     32                                  ax_opt=dict({'fig_sizefac':2.0, 'cb_plt':cb_plt, 'cb_plt_single':cb_plt_single, 'cb_pos':'vertical', 'cb_h':'auto',}), # 'fs_label':14, 'fs_ticks':14, 'ax_dt':1.0}),
     33                                  cbl_opt=dict(), cb_label=cb_label, cbtl_opt=dict(),
     34                                  do_save=sfpath, save_dpi=save_dpi )

File /work/ab0246/a270092/software/tripyview/tripyview/sub_plot.py:1638, in plot_vslice(mesh, data, box, box_idx, box_label, boxl_opt, cinfo, nrow, ncol, proj, do_ie2n, do_rescale, do_plt, plt_opt, plt_contb, pltcb_opt, plt_contf, pltcf_opt, plt_contr, pltcr_opt, plt_contl, pltcl_opt, do_mesh, mesh_opt, do_bot, bot_opt, do_lsm, lsm_opt, lsm_res, do_grid, grid_opt, cb_label, cb_lunit, cb_ltime, cb_ldep, cb_opt, cbl_opt, cbtl_opt, ax_title, ax_opt, ax_xlim, ax_ylim, do_enum, enum_opt, enum_str, enum_x, enum_y, enum_dir, do_save, save_dpi, save_opt, nargout)
   1635     cinfo_optdefault.update({'do_dmoc':True})
   1637 if isinstance(cinfo, list):
-> 1638     cinfo_plot.append( do_setupcinfo(cinfo[ii-1], [data[jj] for jj in idsel], do_rescale, **cinfo_optdefault) )
   1639 else:
   1640     cinfo_plot.append( do_setupcinfo(cinfo, [data[jj] for jj in idsel], do_rescale, **cinfo_optdefault) )

File /work/ab0246/a270092/software/tripyview/tripyview/sub_plot.py:5736, in do_setupcinfo(cinfo, data, do_rescale, mesh, tri, do_vec, do_index, do_moc, do_dmoc, do_hbstf, box_idx)
   5734 print(cdmin,cdmax,cdref)
   5735 #compute levels in decimal units
-> 5736 cinfo['cmap'],cinfo['clevel'],cinfo['cref'] = colormap_c2c(cdmin,cdmax,cdref,cinfo['cnum'],cinfo['cstr'])
   5738 # transfer levels back to normal units
   5739 cinfo['clevel'] = np.power(10.0,cinfo['clevel'])

File /work/ab0246/a270092/software/tripyview/tripyview/sub_colormap.py:48, in colormap_c2c(cmin, cmax, cref, cnumb, cname, cstep, do_slog, do_rescal, rescal_ref)
     44     cstep    = cstep_all[cstep_i]
     46 #___________________________________________________________________________
     47 # calculate colormap levels
---> 48 clevel   = np.concatenate((np.sort(np.arange(cref-cstep,cmin-cstep,-cstep)),np.arange(cref,cmax+cstep,cstep)))
     49 if np.abs(clevel.min())>1.0e-15:
     50     #clevel   = np.around(clevel, -np.int32(np.floor(np.log10(np.abs( clevel.min() ))-2) ) )
     51     clevel   = np.around(clevel, -np.int32(np.floor(np.log10(np.abs( cstep ))-2) ) )

ValueError: Maximum allowed size exceeded
JanStreffing commented 2 months ago

I'm guessing it's the np.arrange that we are asking to arrange with too small of a cstep.

patrickscholz commented 2 weeks ago

usually this is something when the definition of cmin, cmax and crange=[cmin,cmax,cref] is wrong that means either cmin>cmax or cmin>cref or cmax<cref. I now introduced some error messages that should hint the user to that problem!