# Easily searching for multiple wavelengths of data

**URL:** <https://community.openastronomy.org/t/easily-searching-for-multiple-wavelengths-of-data/489>\
**Category:** SunPy\
**Tags:** sunpy, question\
**Created:** [October 23, 2022, 7:15pm UTC](https://community.openastronomy.org/t/easily-searching-for-multiple-wavelengths-of-data/489 "2022-10-23T19:15:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dstansby](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/dstansby/32/328_2.png) [@dstansby](https://community.openastronomy.org/u/dstansby)\
**Post date:** [October 23, 2022, 7:15pm UTC](https://community.openastronomy.org/t/easily-searching-for-multiple-wavelengths-of-data/489/1 "2022-10-23T19:15:34Z")

</div>

I’m trying to download a full set of data from SDO/AIA, with one map for each wavelength it observses at (that is optically thin). My current code looks like:

```python
from astropy import time as time
from astropy import units as u
from sunpy.net import Fido, attrs
from sunpy.map import Map
import numpy as np

channels = ["94", "131", "171", "193", "211", "335"]
wlens = [int(c) * u.angstrom for c in channels]

results = Fido.search(
    attrs.Time("2014-01-01 00:00:00", "2014-01-01 00:00:11"),
    attrs.Instrument("AIA"),
    attrs.Wavelength(wlens[0])
    | attrs.Wavelength(wlens[1])
    | attrs.Wavelength(wlens[2])
    | attrs.Wavelength(wlens[3])
    | attrs.Wavelength(wlens[4])
    | attrs.Wavelength(wlens[5]),
)

```

But the long chaining of OR operators (`|`) doesn’t look very nice - I was wondering if there was an easier and simpler way to write this code to chain together all the wavelengths with OR?

---

<div class="post-metadata">

**Author:** ![hayesla](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/hayesla/32/640_2.png) [@hayesla](https://community.openastronomy.org/u/hayesla)\
**Post date:** [October 24, 2022, 9:03am UTC](https://community.openastronomy.org/t/easily-searching-for-multiple-wavelengths-of-data/489/2 "2022-10-24T09:03:25Z")

</div>

I came across this issue a while ago, and opened this issue to add an example for using the `sunpy.net.attr.or_` which can do what you’re looking for

> <https://github.com/sunpy/sunpy/issues/6371>
>
> \### Describe the feature
> 
> The hidden feature of \`sunpy.net.attr.or\_\` could be …useful to some, should be on show somewhere
> 
> 
> e.g. 
> 
> \`\`\`python
> wavelengths = \[94\*u.angstrom, 131\*u.angstrom, 171\*u.angstrom, 193\*u.angstrom, 211\*u.angstrom\]
> aia\_search= Fido.search(a.Time("2022-02-15 21:40", "2022-02-15 23:00"), 
> a.Instrument("AIA"), 
> attr.or\_(\*\[a.Wavelength(wav) for wav in wavelengths\]))
> 
> \`\`\`
> \### Proposed solution
> 
> add it to docs

I’ll make a PR to actually make an example now
