natashabatalha / PandExo

A Community Tool for Transiting Exoplanet Science with the JWST & HST
https://natashabatalha.github.io/PandExo
GNU General Public License v3.0
37 stars 39 forks source link

Index 0 is out of bounds for axis 0 with size 0 #73

Closed An1th closed 1 year ago

An1th commented 1 year ago

Hi,

image

And please the full error below.

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/tmp/ipykernel_54690/2918580075.py in <module>
    109 #personalize subarray
    110 #inst_dict["configuration"]["detector"]["subarray"] = 'sub512'
--> 111 result = jdi.run_pandexo(exo_dict, inst_dict)
    112 
    113 np.mean(result['FinalSpectrum']['spectrum_w_rand'])

~/anaconda3/lib/python3.8/site-packages/pandexo/engine/justdoit.py in run_pandexo(exo, inst, param_space, param_range, save_file, output_path, output_file, num_cores, verbose)
    377     if type(inst) == dict:
    378         if verbose: print("Running Single Case w/ User Instrument Dict")
--> 379         results =wrapper({"pandeia_input": inst , "pandexo_input":exo}, verbose=verbose)
    380         if output_file == '':
    381             output_file = 'singlerun.p'

~/anaconda3/lib/python3.8/site-packages/pandexo/engine/pandexo.py in wrapper(dictinput, verbose)
     34     if telescope=='jwst':
     35         from .jwst import compute_full_sim
---> 36         return compute_full_sim(dictinput, verbose=verbose)
     37     elif telescope=='hst':
     38         from .hst import compute_sim_hst

~/anaconda3/lib/python3.8/site-packages/pandexo/engine/jwst.py in compute_full_sim(dictinput, verbose)
    121     star_spec = create.outTrans(pandexo_input['star'])
    122     #get rstar if user calling from grid
--> 123     both_spec = create.bothTrans(star_spec, pandexo_input['planet'], star=pandexo_input['star'])
    124     out_spectrum = np.array([both_spec['wave'], both_spec['flux_out_trans']])
    125 

~/anaconda3/lib/python3.8/site-packages/pandexo/engine/create_input.py in bothTrans(out_trans, planet, star)
    253                            & (header.noTiO==planet['noTiO']) & (header.ray==planet['ray']) &
    254                            (header.flat==planet['flat'])]
--> 255         wave_planet=np.array(pd.read_sql_table(df['name'].values[0],db)['wavelength'])[::-1]
    256 
    257         r_lambda=np.array(pd.read_sql_table(df['name'].values[0],db)['radius'])*u.km

IndexError: index 0 is out of bounds for axis 0 with size 0