MickaelRigault / ztfquery

Access ZTF data from Python
Apache License 2.0
37 stars 18 forks source link

Problem getting target data #24

Closed annayqho closed 4 years ago

annayqho commented 4 years ago

When I run m = marshal.MarshalAccess() m.load_target_sources()

I get the error below.


JSONDecodeError Traceback (most recent call last)

in () ----> 1 m.load_target_sources() ~/anaconda/envs/penquins/lib/python3.6/site-packages/ztfquery/marshal.py in load_target_sources(self, program, getredshift, getclassification, setit, auth) 504 'getredshift': int(getredshift), 'getclassification': int(getclassification)}) 505 --> 506 df = pandas.DataFrame.from_dict(json.loads(r.text)) 507 if getclassification: 508 df["classification"] = df["classification"].astype("str") ~/anaconda/envs/penquins/lib/python3.6/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 352 parse_int is None and parse_float is None and 353 parse_constant is None and object_pairs_hook is None and not kw): --> 354 return _default_decoder.decode(s) 355 if cls is None: 356 cls = JSONDecoder ~/anaconda/envs/penquins/lib/python3.6/json/decoder.py in decode(self, s, _w) 337 338 """ --> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 340 end = _w(s, end).end() 341 if end != len(s): ~/anaconda/envs/penquins/lib/python3.6/json/decoder.py in raw_decode(self, s, idx) 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err: --> 357 raise JSONDecodeError("Expecting value", s, err.value) from None 358 return obj, end JSONDecodeError: Expecting value: line 2 column 1 (char 1)
MickaelRigault commented 4 years ago

Try adding a group you are part of to see.,

like m.load_target_sources("Infant Supernovae")

MickaelRigault commented 4 years ago

For me it works image

So,

  1. update your version of ztfquery, maybe a bug was fixed that I forgot about
  2. do this to check you have access to 'Redshift Completeness Factor'
    m.load_user_programs()
    m.programs
  3. if none works, make sure there is no typo.?

Keep me informed

MickaelRigault commented 4 years ago

any update?

annayqho commented 4 years ago

Yes it seems to be working now! Thanks!