SWIFTSIM / velociraptor-python

Python tools for using velociraptor catalogues, with SWIFT integration
GNU Lesser General Public License v3.0
0 stars 8 forks source link

Filter out NaN values when computing lines #88

Closed bwvdnbro closed 2 years ago

bwvdnbro commented 2 years ago

unyt.matplotlib_support seems to be unable to deal with plots where all data values are NaN. You can end up in that scenario when you compute a log median line for data that only has NaN or 0 x values (which apparently really happens for some of the pipeline plots).

The solution is to filter out all NaN values before computing the median line (or any other line for that matter).

@james-trayford could you check that this fixes your issue and does not break any of the plots in the pipeline?

james-trayford commented 2 years ago

Works great, thanks @bwvdnbro!