# Adjusting skymap produced by makeDiscreteSkyMap.py

**URL:** <https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529>\
**Category:** Support\
**Created:** [May 1, 2022, 4:36pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529 "2022-05-01T16:36:33Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![fraserw](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/fraserw/32/877_2.png) [@fraserw](https://www.rubin.community/u/fraserw)\
**Post date:** [May 1, 2022, 4:36pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/1 "2022-05-01T16:36:33Z")

</div>

Is there a way to adjust the skyMap produced by the lsstpipe task makeDiscreteSkyMap?

I’m running it through the command line task, with the usual TAN projection, and passing it a list of visit numbers as --id ccd=XX visit=YYYYYYY^ZZZZZZ etc. The input images are all of a single CCD, and nearly coaligned to the precision of the telescope tracking.

The task produces a single 2x2 patch map, with center equal to the image centre. This results in warps with mostly blank image bordering ~1/4 of the input image.

Each patch could easily fit a full CCD image. Is there a way to force makeDiscreteSkyMap to produce a 1x1 patch map instead of the 2x2 it defaults to?

Edit - the reason I want this is because for some footprints, the imageDifference task fails because it cannot find enough kernel sources in the small 1/4-ccd templates. I suspect this problem would not occur for a template containing the full ccd.

Thanks

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [May 2, 2022, 1:19pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/2 "2022-05-02T13:19:03Z")

</div>

You could create a discrete skymap of your own design using `makeSkyMap.py` and a configuration file like the following:

```auto
config.skyMap["discrete"].raList = [1.234] # degrees
config.skyMap["discrete"].decList = [-5.678] # degrees
config.skyMap["discrete"].radiusList = [0.5] # degrees
config.skyMap["discrete"].pixelScale = 0.168 # arcsec
config.skyMap.name = "discrete"

```

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [May 2, 2022, 1:26pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/3 "2022-05-02T13:26:31Z")

</div>

Oh, and the size of the patches can be controlled via:

```auto
config.skyMap["discrete"].patchBuilder.patchInnerDimensions = (2000, 2000) # pixels

```

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [May 2, 2022, 1:34pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/4 "2022-05-02T13:34:04Z")

</div>

As noted by @erykoff on Slack, you could also run `makeDiscreteSkyMap.py` (that effectively sets the `raList`, `decList` and `radiusList` to cover the data) with adjusted `patchInnerDimensions`.

---

<div class="post-metadata">

**Author:** ![fraserw](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/fraserw/32/877_2.png) [@fraserw](https://www.rubin.community/u/fraserw)\
**Post date:** [May 2, 2022, 2:54pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/5 "2022-05-02T14:54:55Z")

</div>

> [@price](#):
>
> ```auto
> config.skyMap["discrete"].patchBuilder.patchInnerDimensions = (2000, 2000) # pixels
> 
> ```

Thanks for the tips @price .

I am getting the error:

```auto
makeSkyMap.py /arc/projects/NewHorizons/HSC_21_June-lsst/ --rerun /arc/projects/NewHorizons/HSC_21_June-lsst//rerun/03447_warpCompare_004 --clobber-config --configfile configs/testing_makeSkyMap_config.py

root INFO: Loading config overrride file '/opt/lsst/software/stack/stack/miniconda3-4.7.10-4d7b902/Linux64/obs_subaru/19.0.0+2/config/makeSkyMap.py'
root INFO: Loading config overrride file '/opt/lsst/software/stack/stack/miniconda3-4.7.10-4d7b902/Linux64/obs_subaru/19.0.0+2/config/hsc/makeSkyMap.py'
usage: makeSkyMap.py input [options]
makeSkyMap.py: error: cannot load config file 'configs/testing_makeSkyMap_config.py': 'DiscreteSkyMapConfig' object has no attribute 'patchBuilder'

```

know the solution?

---

<div class="post-metadata">

**Author:** ![fraserw](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/fraserw/32/877_2.png) [@fraserw](https://www.rubin.community/u/fraserw)\
**Post date:** [May 2, 2022, 2:55pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/6 "2022-05-02T14:55:07Z")

</div>

Will try this one out. Thanks!

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [May 2, 2022, 3:49pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/7 "2022-05-02T15:49:59Z")

</div>

Oh, the `patchBuilder` part didn’t get added until after the 23.0 release. If you’re using LSST 23.0 then the spelling is `config.skyMap["discrete"].patchInnerDimensions`.

---

<div class="post-metadata">

**Author:** ![fraserw](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/fraserw/32/877_2.png) [@fraserw](https://www.rubin.community/u/fraserw)\
**Post date:** [May 2, 2022, 4:21pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/8 "2022-05-02T16:21:23Z")

</div>

Awesome. Thanks @price that got it working.

---

<div class="post-metadata">

**Author:** ![timj](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/timj/32/10_2.png) [@timj](https://www.rubin.community/u/timj)\
**Post date:** [May 2, 2022, 4:33pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/9 "2022-05-02T16:33:35Z")

</div>

> [@price](#):
>
> could also run `makeDiscreteSkyMap.py`

I assume this is a gen2 butler and pipeline system then? In gen3 the equivalent is `butler make-discrete-skymap`.

---

<div class="post-metadata">

**Author:** ![fraserw](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/fraserw/32/877_2.png) [@fraserw](https://www.rubin.community/u/fraserw)\
**Post date:** [May 2, 2022, 4:36pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/10 "2022-05-02T16:36:33Z")

</div>

Yep gen 2. We’ve avoided moving to gen 3 for the sake of maintaining consistency across the many years of this particular project.

---

<div class="post-metadata">

**Author:** ![timj](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/timj/32/10_2.png) [@timj](https://www.rubin.community/u/timj)\
**Post date:** [May 4, 2022, 3:50pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/11 "2022-05-04T15:50:59Z")

</div>

> [@fraserw](#):
>
> We’ve avoided moving to gen 3 for the sake of maintaining consistency

We have demonstrated parity between gen2 and gen3 pipelines.

You are likely locked into using v23 to keep gen2 support since we are currently removing chunks of gen2 functionality each week.

---

<div class="post-metadata">

**Author:** ![fraserw](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/fraserw/32/877_2.png) [@fraserw](https://www.rubin.community/u/fraserw)\
**Post date:** [May 4, 2022, 4:09pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/12 "2022-05-04T16:09:04Z")

</div>

Thanks @timj. I am aware of equivalency. I meant consistency of our codes. aka. Not having to reinvent the wheel mid-project.

---

<div class="post-metadata">

**Author:** ![jjkavelaars](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/jjkavelaars/32/2301_2.png) [@jjkavelaars](https://www.rubin.community/u/jjkavelaars)\
**Post date:** [March 20, 2026, 5:45am UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/13 "2026-03-20T05:45:59Z")

</div>

Hi. This method of setting the patch centres does not appear to work anymore? I get this error when setting my config up:

````auto
config.skyMap["discrete"].decList=[4.50]
config.skyMap["discrete"].radiusList=[0.0919]```
I get the error:
TypeError: 'BaseSkyMapConfig' object is not subscriptable

Which maybe indicates that the value of config.skyMap now referse to BaseSkyMapConfig setting when I attempt to run the command like so:

```butler --log-level VERBOSE make-discrete-skymap BUTLER HSC --collections F26FEB01_50_20260219 --skymap-id F26FEB01_50 --config-file makeSkyMap_config.py ```

What error am I making? This is using pipeline version : `d_2025_10_22` 
Thanks,
JJ
````

---

<div class="post-metadata">

**Author:** ![sfu](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/sfu/32/3060_2.png) [@sfu](https://www.rubin.community/u/sfu)\
**Post date:** [March 21, 2026, 6:19pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/14 "2026-03-21T18:19:31Z")

</div>

Hi @jjkavelaars , thank you for the question. Like you mentioned, the reason could be the version difference. I’m wondering if DM experts could help answer this? @timj @price  
Also, could you try a standard release (perhaps an older one), rather than a daily/weekly release?

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [March 21, 2026, 7:10pm UTC](https://www.rubin.community/t/adjusting-skymap-produced-by-makediscreteskymap-py/6529/15 "2026-03-21T19:10:40Z")

</div>

I don’t know what `butler make-discrete-skymap` does, but here’s how I made a discrete skymap myself recently. I put in `mySkyMap.py`:

```auto
config.skyMap = "discrete"
config.skyMap["discrete"].raList=[123.456789]
config.skyMap["discrete"].decList=[87.654321]
config.skyMap["discrete"].radiusList=[0.123]

```

And ran:

```auto
butler register-skymap /path/to/butler -C mySkyMap.py -c name=mySkyMap

```
