from marvin.tools import Maps
maps = Maps('8485-1901')
ha = maps.emline_gflux_ha_6564
nii = maps.emline_gflux_nii_6585
nii_ha = nii / ha

# Mask out non-star-forming spaxels
masks, __, __ = maps.get_bpt(show_plot=False)

# Create a bitmask for non-star-forming spaxels by taking the
# complement (`~`) of the BPT global star-forming mask (where True == star-forming)
# and set bit 30 (DONOTUSE) for those spaxels.
mask_non_sf = ~masks['sf']['global'] * ha.pixmask.labels_to_value('DONOTUSE')

# Do a bitwise OR between DAP mask and non-star-forming mask.
mask = nii_ha.mask | mask_non_sf

nii_ha.plot(mask=mask, cblabel='[NII]6585 / Halpha flux ratio')