Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Decode Error being raised testing orbdetpy #13

Closed
OrbitalMechanic opened this issue Mar 5, 2020 · 1 comment
Closed

JSON Decode Error being raised testing orbdetpy #13

OrbitalMechanic opened this issue Mar 5, 2020 · 1 comment

Comments

@OrbitalMechanic
Copy link

I have orbdetpy installed on a Mac Pro (2019) running Mac OS X ver. 10.15.3 (Catalina) under the Anaconda distribution (Python 3.7.6). In running the example posted on https://github.com/ut-astria/orbdetpy, and as listed below.

(base) user@Samuels-Mac-Pro examples % python run_tests.py
run_tests start : 2020-03-05 00:21:11
Simulating azel_sim_cfg.json
Simulating radec_sim_cfg.json
Simulating tle_sim_cfg.json
Simulating radar_sim_cfg.json
Simulating radec_sim_cfg.json
Simulating plate_sim_cfg.json
Fitting radec_od_cfg.json
Fitting radar_od_cfg.json
Fitting tle_od_cfg.json
Fitting azel_od_cfg.json
Fitting radec_od_cfg.json
Fitting plate_od_cfg.json
Fitting posvel_od_cfg.json
run_tests end : 2020-03-05 00:21:59

(base) user@Samuels-Mac-Pro examples % python
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

from orbdetpy.simulation import simulate_measurements
simulate_measurements("radar_sim_cfg.json", output_file = "sim_data.json")
Traceback (most recent call last):
File "", line 1, in
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/orbdetpy/simulation.py", line 62, in simulate_measurements
resp = stub.simulateMeasurements.future(build_settings(config))
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/orbdetpy/rpc/tools.py", line 102, in build_settings
inp = read_param(param)
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/orbdetpy/init.py", line 29, in read_param
data = json.loads(param)
File "/Users/user/opt/anaconda3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/Users/user/opt/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/user/opt/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

A JSON decode error occurred when I executed the command simulate_measurements("radar_sim_cfg.json", output_file = "sim_data.json").

Any thoughts on how to fix this problem?

Sam Dupree.

@Shiva-Iyer
Copy link
Member

You need to either cd into the folder that contains radar_sim_cfg.json or pass the fully qualified path name to radar_sim_cfg.json as the first argument to simulate_measurements. Otherwise it will look for that file in your current working directory which is probably not where the json file is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants