# Error with lsst-v12.0: 'AstrometryConfig' object has no attribute 'solver'

**URL:** <https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899>\
**Category:** Support\
**Created:** [June 30, 2016, 1:54pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899 "2016-06-30T13:54:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![YvanCalas](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/yvancalas/32/92_2.png) [@YvanCalas](https://www.rubin.community/u/YvanCalas)\
**Post date:** [June 30, 2016, 1:54pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/1 "2016-06-30T13:54:37Z")

</div>

Hi,

I am trying to use [processCcd.py](http://processCcd.py) with lsst-v12.0 stack stored on cvmfs (/cvmfs/lsst.in2p3.fr/software/linux-x86\_64/lsst-v12.0).

I am using the obs\_cfht package (`git clone https://github.com/lsst/obs_cfht`) and I have executed the following command lines successfully:

```
source ${STACK_PATH}/loadLSST.bash
setup pipe_tasks
cd /processing/my_packages/obs_cfht/ && setup -k -r .
scons
eups declare --nolocks -r . obs_cfht cfhtprod
setup obs_cfht cfhtprod
cd /processing/input/CFHT-Deep/
eups declare -r /processing/input/CFHT-Deep -m none astrometry_net_data CFHT_Deep
setup -k astrometry_net_data CFHT_Deep
cd /processing
ingestImages.py input input/rawDownload/*.fz --mode link

```

However I get the following error message thereafter:

```
# > processCcd.py input --output ${OUTPUT_DIR} --id visit=803022 ccd=13 --configfile ${VOLUME_DIR}/input/processConfig.py
: Loading config overrride file '/processing/my_packages/obs_cfht/config/processCcd.py'
Traceback (most recent call last):
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pipe_tasks/12.0/bin/processCcd.py", line 25, in <module>
    ProcessCcdTask.parseAndRun()
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pipe_base/12.0/python/lsst/pipe/base/cmdLineTask.py", line 450, in parseAndRun
    parsedCmd = argumentParser.parse_args(config=config, args=args, log=log, override=cls.applyOverrides)
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pipe_base/12.0/python/lsst/pipe/base/argumentParser.py", line 436, in parse_args
    self._applyInitialOverrides(namespace)
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pipe_base/12.0/python/lsst/pipe/base/argumentParser.py", line 599, in _applyInitialOverrides
    namespace.config.load(filePath)
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pex_config/12.0/python/lsst/pex/config/config.py", line 532, in load
    self.loadFromStream(stream=code, root=root)
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pex_config/12.0/python/lsst/pex/config/config.py", line 552, in loadFromStream
    exec stream in {}, local
  File "/processing/my_packages/obs_cfht/config/processCcd.py", line 43, in <module>
    'i2': 'i',
  File "/cvmfs/lsst.in2p3.fr/software/linux-x86_64/lsst-v12.0/Linux64/pex_config/12.0/python/lsst/pex/config/configurableField.py", line 103, in __getattr__
    return getattr(self._value, name)
AttributeError: 'AstrometryConfig' object has no attribute 'solver'

```

I do not understand why [processCcd.py](http://processCcd.py) is not working as expected. Any help would be appreciated 😉

Thanks,

Yvan

---

<div class="post-metadata">

**Author:** ![swinbank](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/swinbank/32/24_2.png) [@swinbank](https://www.rubin.community/u/swinbank)\
**Post date:** [June 30, 2016, 2:19pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/2 "2016-06-30T14:19:16Z")

</div>

This seems to be because of changes made to obs\_cfht after the release of v12 of the stack. Can you try reverting to a slightly older version of obs\_cfht? I think that [abdb9b9](https://github.com/lsst/obs_cfht/commit/abdb9b900a91084f8edfcf8e4a9d96e103107fd2) should work. That is, after cloning from GitHub, but before building and setting up obs\_cfht, run

```
git checkout abdb9b9

```

in your obs\_cfht directory.

---

<div class="post-metadata">

**Author:** ![rowen](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/rowen/32/52_2.png) [@rowen](https://www.rubin.community/u/rowen)\
**Post date:** [June 30, 2016, 2:44pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/3 "2016-06-30T14:44:35Z")

</div>

> [@YvanCalas](#):
>
> /processing/my\_packages/obs\_cfht/config/processCcd.py

What is in this file? I suggest you try running the same command except remove `--configfile ${VOLUME_DIR}/input/processConfig.py` and add `--show config`. if that passes then your config override file has an outdated setting, one that may be clear from the displayed config.

---

<div class="post-metadata">

**Author:** ![YvanCalas](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/yvancalas/32/92_2.png) [@YvanCalas](https://www.rubin.community/u/YvanCalas)\
**Post date:** [June 30, 2016, 2:48pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/4 "2016-06-30T14:48:25Z")

</div>

I now have another error message:

```
# processCcd.py input --output ${OUTPUT_DIR} --id visit=803022 ccd=13 --configfile ${VOLUME_DIR}/input/processConfig.py

: Loading config overrride file '/processing/my_packages/obs_cfht/config/processCcd.py'
: Config override file does not exist: '/processing/my_packages/obs_cfht/config/megacam/processCcd.py'
usage: processCcd.py input [options]
processCcd.py: error: cannot load config file '/processing/input/processConfig.py': No module named extensions.psfex.psfexPsfDeterminer

```

My `processConfig.py` contains the following lines:

```
# Apply the brighter fatter correction
config.isr.doBrighterFatter=False

config.charImage.repair.cosmicray.nCrPixelMax=1000000

#from lsst.meas.astrom.anetAstrometry import ANetAstrometryTask
#config.calibrate.astrometry.retarget(ANetAstrometryTask)
#config.calibrate.astrometry.solver.sipOrder=3

config.charImage.astrometry.wcsFitter.order=3
#config.charImage.astrometry.matcher.maxMatchDistArcSec=3.0

#config.calibrate.astrometry.refObjLoader.filterMap = { 'i2': 'i',
# }
config.charImage.astrometry.refObjLoader.filterMap = { 'i2': 'i'}

import lsst.meas.extensions.psfex.psfexPsfDeterminer
config.charImage.measurePsf.psfDeterminer.name='psfex'

#config.calibrate.photoCal.fluxField='base_CircularApertureFlux_6_0_flux'
#config.calibrate.photoCal.magLimit=22.0
#config.calibrate.photoCal.photoCatName="e2v"
#config.calibrate.photoCal.applyColorTerms=True
#config.calibrate.photoCal.badFlags=['base_PixelFlags_flag_edge', 'base_PixelFlags_flag_interpolated', 'base_PixelFlags_flag_saturated', 'base_PixelFlags_flag_crCenter']

import lsst.pipe.tasks.colorterms
config.calibrate.photoCal.colorterms.data['e2v'].data['i2']=lsst.pipe.tasks.colorterms.Colorterm()
config.calibrate.photoCal.colorterms.data['e2v'].data['i2'].c2=0.0
config.calibrate.photoCal.colorterms.data['e2v'].data['i2'].c1=0.085
config.calibrate.photoCal.colorterms.data['e2v'].data['i2'].c0=0.0
config.calibrate.photoCal.colorterms.data['e2v'].data['i2'].primary='i'
config.calibrate.photoCal.colorterms.data['e2v'].data['i2'].secondary='r'

# The following should be included for u filter in order to lower the source detection threshold
# config.charImage.detectAndMeasure.detection.includeThresholdMultiplier=1.0

# use Chebyshev background estimation
config.charImage.background.useApprox=True
config.charImage.detectAndMeasure.detection.background.binSize=128
config.charImage.detectAndMeasure.detection.background.useApprox=True
config.charImage.background.binSize = 128
config.charImage.background.undersampleStyle = 'REDUCE_INTERP_ORDER'
config.charImage.detectAndMeasure.detection.background.binSize = 128
config.charImage.detectAndMeasure.detection.background.undersampleStyle='REDUCE_INTERP_ORDER'
config.charImage.detectAndMeasure.detection.background.binSize = 128
config.charImage.detectAndMeasure.detection.background.undersampleStyle = 'REDUCE_INTERP_ORDER'

#config.charImage.detectAndMeasure.deblend.minFootprintAxisRatio=0.0
#config.charImage.detectAndMeasure.deblend.maxFootprintSize=0
```

---

<div class="post-metadata">

**Author:** ![swinbank](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/swinbank/32/24_2.png) [@swinbank](https://www.rubin.community/u/swinbank)\
**Post date:** [June 30, 2016, 2:54pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/5 "2016-06-30T14:54:03Z")

</div>

> [@rowen](#):
>
> What is in this file?

Given the (quoted) contents of line 43, I’m guessing it’s the [default obs\_cfht override](https://github.com/lsst/obs_cfht/blob/master/config/processCcd.py#L43).

---

<div class="post-metadata">

**Author:** ![YvanCalas](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/yvancalas/32/92_2.png) [@YvanCalas](https://www.rubin.community/u/YvanCalas)\
**Post date:** [June 30, 2016, 3:07pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/6 "2016-06-30T15:07:26Z")

</div>

Ok so it seems to work now. What I did:

`# processCcd.py input --output /processing/output_one_ccd/ --show config > /processing/input/processConfig.py`

and:

```
# processCcd.py input --output /processing/output_one_ccd/ --id visit=803022 ccd=13 --configfile /processing/input/processConfig.py
: Loading config overrride file '/processing/my_packages/obs_cfht/config/processCcd.py'
: Config override file does not exist: '/processing/my_packages/obs_cfht/config/megacam/processCcd.py'
: input=/processing/input
: calib=None
: output=/processing/output_one_ccd
CameraMapper: Loading registry registry from /processing/output_one_ccd/_parent/registry.sqlite3
CameraMapper: Unable to locate calibRegistry registry in root: /processing/output_one_ccd/calibRegistry.sqlite3
CameraMapper: Unable to locate calibRegistry registry in current dir: ./calibRegistry.sqlite3
CameraMapper: Loading Posix registry from /processing/output_one_ccd
CameraMapper: Loading registry registry from /processing/output_one_ccd/_parent/registry.sqlite3
CameraMapper: Unable to locate calibRegistry registry in root: /processing/output_one_ccd/calibRegistry.sqlite3
CameraMapper: Unable to locate calibRegistry registry in current dir: ./calibRegistry.sqlite3
CameraMapper: Loading Posix registry from /processing/output_one_ccd
processCcd: Processing {'taiObs': '2005-07-14T07:26:21.14', 'extension': 14, 'object': 'D3', 'visit': 803022, 'filter': 'r', 'state': 'p', 'runId': '05AL01', 'date': '2005-07-14', 'ccd': 13, 'expTime': 300.238}
[....]
processCcd.calibrate.photoCal: Magnitude zero point: 32.139278 +/- 0.000487 from 40 stars
processCcd.calibrate: Photometric zero-point: 32.139278

```

So if I understand correctly, I have to revert to an older version of obs\_cfht and I have to generate the [processConfig.py](http://processConfig.py) configuration file before to execute [processCcd.py](http://processCcd.py) with a given visit and ccd id.

Am I correct?

---

<div class="post-metadata">

**Author:** ![swinbank](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/swinbank/32/24_2.png) [@swinbank](https://www.rubin.community/u/swinbank)\
**Post date:** [June 30, 2016, 3:07pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/7 "2016-06-30T15:07:41Z")

</div>

Weird. The error is

> [@YvanCalas](#):
>
> `No module named extensions.psfex.psfexPsfDeterminer`

but your config file doesn’t ask for that to be loaded: it says

> [@](#):
>
> `import lsst.meas.extensions.psfex.psfexPsfDeterminer`

which looks fine. Indeed, I just tried your config on my system, and it works fine.

Are you sure there wasn’t a copy and paste error somewhere? 🙂

---

<div class="post-metadata">

**Author:** ![swinbank](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/swinbank/32/24_2.png) [@swinbank](https://www.rubin.community/u/swinbank)\
**Post date:** [June 30, 2016, 3:12pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/8 "2016-06-30T15:12:32Z")

</div>

> [@YvanCalas](#):
>
> So if I understand correctly, I have to revert to an older version of obs\_cfht and I have to generate the processConfig.py configuration file before to execute processCcd.py with a given visit and ccd id.

Revert to an older version of obs\_cfht: yes.

Generating `processConfig.py` depends on what you want to achieve. If you’re just using the default configuration, there’s no need to dump it to a file with `--show config` then load that when you start processing: `processCcd.py` will run with that default configuration without your intervention.

On the other hand, if you want to modify the configuration, then you could dump it to a file like that and use it as a template. If you do that, then yes, it’s possible the configuration options will change for different versions of the stack and/or pipe\_tasks, so you might find it safest to dump a fresh copy of the configuration when the versions change.

Note, though, that your config file only needs to specify the parameters _that you need to override_. A minimal override file is less likely to be affected by changes than one in which you list absolutely everything, even the defaults.

---

<div class="post-metadata">

**Author:** ![YvanCalas](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/yvancalas/32/92_2.png) [@YvanCalas](https://www.rubin.community/u/YvanCalas)\
**Post date:** [June 30, 2016, 4:10pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/9 "2016-06-30T16:10:39Z")

</div>

Ok understood. I will create an empty [processCcd.py](http://processCcd.py) file and add configuration options later if needed (I have no idea of the meaning of those parameters). This way, I will keep the --configfile option as a reminder 😛

One last question: is there a way to know which version of obs\_cfht is compatible with a given version of the stack?

---

<div class="post-metadata">

**Author:** ![rowen](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/rowen/32/52_2.png) [@rowen](https://www.rubin.community/u/rowen)\
**Post date:** [June 30, 2016, 4:22pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/10 "2016-06-30T16:22:04Z")

</div>

Our usual recommendation is to run without overrides unless you are sure you need them. Otherwise it means you are using a unique configuration nobody else understands, which makes it hard to help you if you run into problems.

As to version compatibility…good question and I don’t have the answer. obs\_cfht is not yet part of the standard distribution (though I think there are plans to change that). I hope there is a better way, but one thing that ought to work is to check the obs\_cfht history in git and pick master that matches the date of the release.

---

<div class="post-metadata">

**Author:** ![swinbank](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/swinbank/32/24_2.png) [@swinbank](https://www.rubin.community/u/swinbank)\
**Post date:** [June 30, 2016, 4:30pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/11 "2016-06-30T16:30:53Z")

</div>

I’m not aware of a better way to find a compatible version that the one Russell suggests. This is a known problem ([DM-5661](https://jira.lsstcorp.org/browse/DM-5661)): I hope we’ll be able to fix it soon.

---

<div class="post-metadata">

**Author:** ![YvanCalas](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/yvancalas/32/92_2.png) [@YvanCalas](https://www.rubin.community/u/YvanCalas)\
**Post date:** [June 30, 2016, 4:51pm UTC](https://www.rubin.community/t/error-with-lsst-v12-0-astrometryconfig-object-has-no-attribute-solver/899/12 "2016-06-30T16:51:30Z")

</div>

Ok thanks a lot @swinbank and @rowen for your help and for your advices 🙂
