# Spectrum analyzer with Python API

**URL:** <https://forum.liquidinstruments.com/t/spectrum-analyzer-with-python-api/748>\
**Category:** Moku:Go\
**Created:** [June 27, 2023, 3:56am UTC](https://forum.liquidinstruments.com/t/spectrum-analyzer-with-python-api/748 "2023-06-27T03:56:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gautam](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@gautam](https://forum.liquidinstruments.com/u/gautam)\
**Post date:** [June 27, 2023, 3:56am UTC](https://forum.liquidinstruments.com/t/spectrum-analyzer-with-python-api/748/1 "2023-06-27T03:56:15Z")

</div>

I am trying to follow the Spectrum Analyzer example from the example API page. However, when trying to set the rbw using the `set_rbw('Minimum')` method, I get the following error:

```sh
In [12]: m.set_rbw('Minimum')
---------------------------------------------------------------------------
InvalidParameterException Traceback (most recent call last)
<ipython-input-12-6099cb782cd4> in <module>
----> 1 m.set_rbw('Minimum')

~\Anaconda3\lib\site-packages\moku\instruments\_spectrumanalyzer.py in set_rbw(self, mode, rbw_value, strict)
    179 f"slot{self.slot}/{self.operation_group}",
    180 operation,
--> 181 params)
    182
    183 def get_span(self):

~\Anaconda3\lib\site-packages\moku\session.py in func_wrapper(self, *args, **kwargs)
     15 def func_wrapper(self, *args, **kwargs):
     16 response = func(self, *args, **kwargs)
---> 17 return self.resolve(response)
     18
     19 return func_wrapper

~\Anaconda3\lib\site-packages\moku\session.py in resolve(self, response)
    164 return data.data
    165 elif data.success is False:
--> 166 self.handle_error(data.code, data.messages)
    167 else:
    168 self.handle_http_error(response)

~\Anaconda3\lib\site-packages\moku\session.py in handle_error(code, messages)
    120 raise exceptions.NoInstrumentBitstream(messages)
    121 elif code == "INVALID_PARAM":
--> 122 raise exceptions.InvalidParameterException(messages)
    123 elif code == "INVALID_REQUEST":
    124 raise exceptions.InvalidRequestException(messages)

InvalidParameterException: ['Unable to set to desired value. Coerced value: 21.153033']

```

I’m using `fw=580` - in fact, I was successfully able to use this call using an earlier version of the firmware, so maybe it has something to do with an update made to this version of the fw?
