dynamics-of-stellar-systems / dynamite

dynamics, age and metallicity indicators tracing evolution
MIT License
10 stars 1 forks source link

issue with `read_orbit_base` for a Bayes LOSVD #384

Open prashjet opened 2 months ago

prashjet commented 2 months ago

A problem reading LOSVD files for a model run with Bayes LOSVD kinemetics.

Example: run maxima.py in

/gpfs/data/fs71474/sreiter/dynamite/NGC2768_bayes

provokes

ValueError: could not broadcast input array from shape (467,) into shape (1,)

What is happening? For this (orblib, aperture), we are reading an array of length 467 from the fortran binary (i.e. tmp) but expecting an array of shape 465 (i.e. this is the shape of our velhist0 array). We try to place it inside velhist0 by:

velhist0[kin_idx][j, ivmin+nv0:ivmax+nv0+1, i_ap0] = tmp

The index ivmin+nv0 is -1... i.e. it's wrapped around. This is bad.

Think of a hacky fix for this... e.g truncating the first and last bins from tmp

prashjet commented 2 months ago

The branch fix_read_losvd_hist_potential_bug has a a hacky solution: only put tmp into velhist0 if it is the right size. Any (orbit,aperture) which is affected will be left at 0 - but if few enough (orbit,aperture)'s are affected then maybe this hack will suffice for now.

@Steffi-16 - this seems to get thins running again - maybe try submitting the job on the large memory VSC partition?

prashjet commented 2 months ago

Update: the hacky bugfix did not work. The resulting orblib.losvd_histograms[0].y is all zeros. i.e. every (orbit,aperture) seems to be affected, so nothing is put into the losvd_histograms array.

prashjet commented 2 months ago

However, for reference, the size of the (all zero) losvd_histograms in memory is ~ 44 GB... explaining the problems on the laptop.