KeyError: "Extension 'cknegrid' not found." #1009
Closed
JohaMR
started this conversation in
Implementation
Replies: 1 comment
-
this is a known issue (#998) that we are working hard to fix since it seems to be affecting many people, please see #998 (comment) and continue all discussion there so that we keep everything in one place. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am implementing this example from the library [https://phoebe-project.org/docs/2.4/tutorials/LC_estimators] and it gives me the following error:
KeyError Traceback (most recent call last)
Cell In[3], line 24
21 b.set_value_all('atm', 'blackbody')
23 #compute the model
---> 24 b.run_compute(irrad_method='none')
26 # extract the arrays from the model that we'll use as observables in the next step
27 times = b.get_value('times', context='model', dataset='lc01')
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/parameters/parameters.py:424, in send_if_client..send_if_client(self, *args, **kwargs)
421 return ret
423 else:
--> 424 return fctn(self, *args, **kwargs)
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/frontend/bundle.py:11968, in Bundle.run_compute(self, compute, model, solver, detach, dataset, times, return_changes, **kwargs)
11963 self.compute_ld_coeffs(compute=compute, skip_checks=True, set_value=True, **{k:v for k,v in kwargs.items() if k in computeparams.qualifiers})
11964 # NOTE that if pblum_method != 'phoebe', then system will be None
11965 # otherwise the system will be create which we can pass on to the backend
11966 # the phoebe backend can then skip initializing the system at least on the master proc
11967 # (workers will need to recreate the mesh)
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/frontend/bundle.py:10750, in Bundle.compute_pblums(self, compute, model, pblum, pblum_abs, pblum_scale, pbflux, set_value, unit, **kwargs)
10748 self.compute_ld_coeffs(compute=compute, set_value=True, skip_checks=True, **{k:v for k,v in kwargs.items() if k not in ['ret_structured_dicts', 'pblum_mode', 'pblum_method', 'skip_checks']})
10749 # TODO: make sure this accepts all compute parameter overrides (distortion_method, etc)
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/frontend/bundle.py:10393, in Bundle._compute_intrinsic_system_at_t0(self, compute, datasets, compute_l3, compute_l3_frac, compute_extrinsic, **kwargs)
10391 logger.debug("creating system with compute={} kwargs={}".format(system_compute, kwargs))
10392 try:
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/backend/backends.py:996, in PhoebeBackend._compute_intrinsic_system_at_t0(self, b, compute, dynamics_method, hier, meshablerefs, datasets, reset, lc_only, **kwargs)
993 # kinds = [b.get_dataset(dataset=ds).kind for ds in datasets]
995 system.update_positions(t0, x0, y0, z0, vx0, vy0, vz0, etheta0, elongan0, eincl0, ignore_effects=True)
--> 996 system.populate_observables(t0, ['lc' for dataset in datasets], datasets, ignore_effects=True)
999 if reset:
1000 logger.debug("rank:{}/{} PhoebeBackend._create_system_and_compute_pblums: resetting system".format(mpi.myrank, mpi.nprocs))
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/backend/universe.py:319, in System.populate_observables(self, time, kinds, datasets, ignore_effects)
317 for kind, dataset in zip(kinds, datasets):
318 for starref, body in self.items():
--> 319 body.populate_observable(time, kind, dataset, ignore_effects=ignore_effects)
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/backend/universe.py:1078, in Body.populate_observable(self, time, kind, dataset, ignore_effects, **kwargs)
1070 if time==self.time and dataset in self.populated_at_time and 'pblum' not in kind:
1071 # then we've already computed the needed columns
1072
1073 # TODO: handle the case of intensities already computed by
1074 # /different/ dataset (ie RVs computed first and filling intensities
1075 # and then lc requesting intensities with SAME passband/atm)
1076 return
-> 1078 new_mesh_cols = getattr(self, 'populate{}'.format(kind.lower()))(dataset, ignore_effects=ignore_effects, **kwargs)
1080 for key, col in new_mesh_cols.items():
1082 self.mesh.update_columns_dict({'{}:{}'.format(key, dataset): col})
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/backend/universe.py:1807, in Star._populate_lc(self, dataset, ignore_effects, **kwargs)
1803 pblum = kwargs.get('pblum', 4*np.pi)
1805 if lc_method=='numerical':
-> 1807 pb = passbands.get_passband(passband)
1809 if ldatm != 'none' and '{}:ldint'.format(ldatm) not in pb.content:
1810 if ld_mode == 'lookup':
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/atmospheres/passbands.py:3241, in get_passband(passband, content, reload, update_if_necessary, download_local, download_gzipped)
3239 if reload or _pbtable.get(passband, {}).get('pb', None) is None:
3240 logger.info("loading {} passband from {} (including all tables)".format(passband, _pbtable[passband]['fname']))
-> 3241 pb = Passband.load(_pbtable[passband]['fname'], load_content=True)
3242 _pbtable[passband]['pb'] = pb
3244 return _pbtable[passband]['pb']
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/phoebe/atmospheres/passbands.py:483, in Passband.load(cls, archive, load_content)
481 if 'ck2004:Inorm' in self.content:
482 self._ck2004_axes = (np.array(list(hdul['ck_teffs'].data['teff'])), np.array(list(hdul['ck_loggs'].data['logg'])), np.array(list(hdul['ck_abuns'].data['abun'])))
--> 483 self._ck2004_energy_grid = hdul['cknegrid'].data
484 self._ck2004_photon_grid = hdul['cknpgrid'].data
486 if 'ck2004:Imu' in self.content:
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/astropy/io/fits/hdu/hdulist.py:392, in HDUList.getitem(self, key)
387 # Originally this used recursion, but hypothetically an HDU with
388 # a very large number of HDUs could blow the stack, so use a loop
389 # instead
390 try:
391 return self._try_while_unread_hdus(
--> 392 super().getitem, self._positive_index_of(key)
393 )
394 except IndexError as e:
395 # Raise a more helpful IndexError if the file was not fully read.
396 if self._read_all:
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/astropy/io/fits/hdu/hdulist.py:858, in HDUList._positive_index_of(self, key)
844 def _positive_index_of(self, key):
845 """
846 Same as index_of, but ensures always returning a positive index
847 or zero.
(...)
856 inefficient.
857 """
--> 858 index = self.index_of(key)
860 if index >= 0:
861 return index
File /mnt/c/Users/HP/phoebe-env/lib/python3.12/site-packages/astropy/io/fits/hdu/hdulist.py:840, in HDUList.index_of(self, key)
837 break
839 if found is None:
--> 840 raise KeyError(f"Extension {key!r} not found.")
841 else:
842 return found
KeyError: "Extension 'cknegrid' not found."
I don't know how to fix it, I've tried the following code but it doesn't work.
Beta Was this translation helpful? Give feedback.
All reactions