The mass_interp() function currently takes up most of the processing time for somewhat large maximum masses. The function interpolates the entire isoch_cut even though the next function (binarity()) discards the stars that are not single/binary systems depending on the selected binary systems.
The indexes for the selected binary systems depend on the mass_dist array exclusively, and could be obtained previous to the call to binarity(). Knowing these indexes we could interpolate the magnitude and color for the single systems without interpolating the binary system's magnitude & color, and similarly interpolate the binary magnitude & color for the binary systems without also interpolating the magnitude & color arrays for the single systems.
Not sure if this would improve the performance significantly.
The
mass_interp()
function currently takes up most of the processing time for somewhat large maximum masses. The function interpolates the entireisoch_cut
even though the next function (binarity()
) discards the stars that are not single/binary systems depending on the selected binary systems.The indexes for the selected binary systems depend on the
mass_dist
array exclusively, and could be obtained previous to the call tobinarity()
. Knowing these indexes we could interpolate the magnitude and color for the single systems without interpolating the binary system's magnitude & color, and similarly interpolate the binary magnitude & color for the binary systems without also interpolating the magnitude & color arrays for the single systems.Not sure if this would improve the performance significantly.