ratt-ru / solarkat

MeerKAT as a solar telescope
MIT License
1 stars 0 forks source link

-continue keyword in wsclean does not work in stimela? #23

Open Victoria-Samboco opened 1 year ago

Victoria-Samboco commented 1 year ago

Hi @o-smirnov . There's a wsclean parameter called -continue that we can use to continue a previous deconvolution run, and -reuse-psf and -reuse-dirty to skip imaging of those two and directly clean existing images, but it does not work in stimela, I've added it to a cab as you recommended before for the -wgridder-accuracy parameter but still returning an error:

2023-02-23 12:06:27 STIMELA ERROR: pre-validation of recipe 'boom' failed
─────────────────────────────────── detailed error report follows ───────────────────────────────────
        ⚠ pre-validation of recipe 'boom' failed
        └── step 'clean_image_sun' failed prevalidation
            └── step 'image' failed prevalidation
                ├── TypeError: Field names must not be keywords: 'continue'
                └── Traceback:
                    ├──   File 
                    │   "/home/samboco/Virtual_enviroments/stimela_env/lib/python3.8/site-packages/st
                    │   imela/kitchen/recipe.py", line 669, in prevalidate_steps
                    │       step_params = step.prevalidate(subst)
                    ├──   File 
                    │   "/home/samboco/Virtual_enviroments/stimela_env/lib/python3.8/site-packages/st
                    │   imela/kitchen/step.py", line 269, in prevalidate
                    │       params = self.validated_params = self.cargo.prevalidate(self.params, 
                    │   subst, root=root)
                    ├──   File 
                    │   "/home/samboco/Virtual_enviroments/stimela_env/lib/python3.8/site-packages/sc
                    │   abha/cargo.py", line 345, in prevalidate
                    │       params = validate_parameters(params, self.inputs_outputs, 
                    │   defaults=self.defaults, subst=subst, fqname=self.fqname,
                    ├──   File 
                    │   "/home/samboco/Virtual_enviroments/stimela_env/lib/python3.8/site-packages/sc
                    │   abha/validate.py", line 178, in validate_parameters
                    │       dcls = dataclasses.make_dataclass("Parameters", fields)
                    └──   File "/usr/lib/python3.8/dataclasses.py", line 1219, in make_dataclass
                            raise TypeError(f'Field names must not be keywords: {name!r}')

How I can deal with it?

o-smirnov commented 1 year ago

Same as last time, if some keyword is missing, you can temporarily add it like so:

cabs:
  wsclean:
    inputs:
      continue:
        dtype: bool
Victoria-Samboco commented 1 year ago

Same as last time, if some keyword is missing, you can temporarily add it like so:

cabs:
  wsclean:
    inputs:
      continue:
        dtype: bool

yes, thats what I did here, like this, but it continues with the same error

cabs:
  wsclean:
    inputs:
      wgridder-accuracy:
        dtype: float
      continue:
        dtype: bool
o-smirnov commented 1 year ago

Ah wait Field names must not be keywords: 'continue', that's a Python limitation we're hitting. I'll have to add a workaround to Stimela. In the meantime, try renaming it like so:

cabs:
  wsclean:
    inputs:
      do_continue:
        dtype: bool
        nom_de_guerre: continue

...and use do_continue in your params.

Victoria-Samboco commented 1 year ago

Ah wait Field names must not be keywords: 'continue', that's a Python limitation we're hitting. I'll have to add a workaround to Stimela. In the meantime, try renaming it like so:

cabs:
  wsclean:
    inputs:
      do_continue:
        dtype: bool
        nom_de_guerre: continue

...and use do_continue in your params.

Okay, its working now, thanks.