ratt-ru / CubiCal

A fast radio interferometric calibration suite.
GNU General Public License v2.0
18 stars 13 forks source link

xfer-from not picking up table names #202

Closed IanHeywood closed 6 years ago

IanHeywood commented 6 years ago

Trying to load and apply (with interpolation) a set of G and dE solutions derived using the on-the-fly rebinning. Solutions look sane, but:

 - 21:46:52 - gain_machine       [0.1/0.2 2.8/2.8 0.7Gb] G solutions will be initialized from 1529209968_sdp_l0_1284.full_pol_fg_wtspec_47Tuc_1k.ms/chain-field_0-ddid_None.parmdb
 - 21:46:52 - main               [0.1/0.2 2.8/2.8 0.7Gb] Exiting with exception: IOError([Errno 2] No such file or directory: '1529209968_sdp_l0_1284.full_pol_fg_wtspec_47Tuc_1k.ms/chain-field_0-ddid_None.parmdb')
 Traceback (most recent call last):
  File "/users/ianh/Software/CubiCal/cubical/main.py", line 322, in main
    global_options=GD, jones_options=jones_opts)
  File "/users/ianh/Software/CubiCal/cubical/machines/abstract_machine.py", line 520, in create_factory
    return machine_cls.Factory(machine_cls, *args, **kw)
  File "/users/ianh/Software/CubiCal/cubical/machines/jones_chain_machine.py", line 519, in __init__
    global_options, opts)
  File "/users/ianh/Software/CubiCal/cubical/machines/abstract_machine.py", line 602, in __init__
    self.init_solutions()
  File "/users/ianh/Software/CubiCal/cubical/machines/jones_chain_machine.py", line 529, in init_solutions
    Complex2x2Gains.exportable_solutions())
  File "/users/ianh/Software/CubiCal/cubical/machines/abstract_machine.py", line 682, in _init_solutions
    self._init_sols[label] = param_db.load(filename), prefix, interpolate
  File "/users/ianh/Software/CubiCal/cubical/param_db.py", line 51, in load
    db._load(filename)
  File "/users/ianh/Software/CubiCal/cubical/database/pickled_db.py", line 203, in _load
    db = self._Unpickler(filename)
  File "/users/ianh/Software/CubiCal/cubical/database/pickled_db.py", line 178, in __init__
    self.fobj = open(filename)
IOError: [Errno 2] No such file or directory: '1529209968_sdp_l0_1284.full_pol_fg_wtspec_47Tuc_1k.ms/chain-field_0-ddid_None.parmdb'

however:

$ grep xfer dE-load-and-apply.parset
xfer-from =
xfer-from = {data[ms]}/{JONES}-field_{sel[field]}-ddid_{sel[ddid]}.parmdb
xfer-from = {data[ms]}/{JONES}-field_{sel[field]}-ddid_{sel[ddid]}.parmdb

which are respectively the options in the template, the [g] and the [dE] sections.

The word 'chain' doesn't appear in the parset anywhere. Full logs and parsets available on request.

Cheers.

o-smirnov commented 6 years ago

Which branch are you on? I have pushed a fix to madmax-moreplots. It's a one-liner if you want to try it elsewhere:

oms@jakob:~/projects/CubiCal$ git diff
diff --git a/cubical/machines/jones_chain_machine.py b/cubical/machines/jones_chain_machine.py
index 26dea67..b03fb48 100644
--- a/cubical/machines/jones_chain_machine.py
+++ b/cubical/machines/jones_chain_machine.py
@@ -526,8 +526,8 @@ class JonesChain(MasterMachine):
             for opts in self.chain_options:
                 label = opts["label"]
                 self._init_solutions(label,
-                                     self.make_filename(opts["xfer-from"]) or
-                                     self.make_filename(opts["load-from"]),
+                                     self.make_filename(opts["xfer-from"], label) or
+                                     self.make_filename(opts["load-from"], label),
                                      bool(opts["xfer-from"]),
                                      self.solvable and opts["solvable"] and self.make_filename(opts["save-to"], label),
                                      Complex2x2Gains.exportable_solutions())
IanHeywood commented 6 years ago

Thanks, will give it a go. Am on 'master' in this case.

IanHeywood commented 6 years ago

It's working now, thanks. Will leave this open as I guess it needs to propagate into the master branch too.

o-smirnov commented 6 years ago

Fixed in the merge.