Starfish-develop / Starfish-develop/Starfish

gridtools - parameter assertion error

Open
#76 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
78
Forks
23
PR merge metrics
No merged PRs in 30d

Description

I am trying to do the first WASP14 tutorial but have not been able to generate the hdf5 data yet.

I setup config file like the docs as shown .

# YAML configuration script

name: example_wasp14

data:
  grid_name: "PHOENIX"
  files: ["data/WASP14/WASP14-2009-06-14.hdf5"]
  instruments : ["TRES"]
  orders: [22]

outdir : output/

plotdir : plots/

# The parameters defining your raw spectral library live here.
grid:
  raw_path: "/home/jneal/Phd/data/fullphoenix/phoenix.astro.physik.uni-goettingen.de/HiResFITS/PHOENIX-ACES-AGSS-COND-2011/"
  hdf5_path: "libraries/PHOENIX_TRES_test.hdf5"
  parname: ["temp", "logg"]
  key_name: "t{0:.0f}g{1:.1f}" # Specifies how the params are stored
  # in the HDF5 file
  parrange: [[2300, 3700], [4.0, 5.5]]
  wl_range: [6300, 6360]
  buffer: 50. # AA

But when I try to run the HDF5Creator code from the docs I get an Assertion Error.

import Starfish
from Starfish.grid_tools import PHOENIXGridInterfaceNoAlpha as PHOENIX
from Starfish.grid_tools import HDF5Creator, TRES
mygrid = PHOENIX()
instrument = TRES()
creator = HDF5Creator(mygrid, Starfish.grid["hdf5_path"], instrument,
ranges=Starfish.grid["parrange"])
creator.process_grid()
FFT grid stretches from 6250.000000000003 to 6409.999999999997
wl_FFT dv is 0.23127228225041102 km/s
Total of 60 files to process.
Processing [ 2300.     4.]
Traceback (most recent call last):
  File "hdf5_create.py", line 14, in <module>
    creator.process_grid()
  File "/home/jneal/Phd/Codes/Repos/Starfish/Starfish/grid_tools.py", line 786, in process_grid
    fl, header = self.process_flux(param)
  File "/home/jneal/Phd/Codes/Repos/Starfish/Starfish/grid_tools.py", line 722, in process_flux
    flux, header = self.GridInterface.load_flux(parameters)
  File "/home/jneal/Phd/Codes/Repos/Starfish/Starfish/grid_tools.py", line 232, in load_flux
    self.check_params(parameters) # Check to make sure that the keys are
  File "/home/jneal/Phd/Codes/Repos/Starfish/Starfish/grid_tools.py", line 147, in check_params
    assert len(parameters) == len(self.param_names)
AssertionError

If I print out Starfish.grid I get
{'hdf5_path': 'libraries/PHOENIX_TRES_test.hdf5', 'buffer': 50.0, 'key_name': 't{0:.0f}g{1:.1f}', 'parrange': [[2300, 3700], [4.0, 5.5]], 'parname': ['temp', 'logg'], 'raw_path': '/home/jneal/Phd/data/fullphoenix/phoenix.astro.physik.uni-goettingen.de/HiResFITS/PHOENIX-ACES-AGSS-COND-2011/', 'wl_range': [6300, 6360]}

I assume that these are the parameters that it is counting.

How can I resolve this issue so that I can continue on with the tutorial?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the WASP14 tutorial setup using the shown YAML configuration and HDF5Creator call. Start in Starfish/grid_tools.py at HDF5Creator.process_grid, process_flux, and check_params, then compare the generated parameter values with the PHOENIX interface expectations. Done means the tutorial creates the HDF5 library without the assertion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, yaml
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.