def _m3_a8_profile(opts, node_class):
    """ Create a node_class profile from namespace object """
    profile = node_class(profilename=opts.name, power=opts.power_mode)
    profile.set_consumption(period=opts.period, average=opts.average, power
        =opts.power, voltage=opts.voltage, current=opts.current)
    profile.set_radio(mode=opts.mode, channels=opts.channels, period=opts.
        rperiod, num_per_channel=opts.num_per_channel)
    return profile
