We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
GBMClient remote doctest fails
<!--
We know asking good questions takes effort, and we appreciate your time.
Thank you.

Please be aware that everyone has to follow our code of conduct:
https://github.com/sunpy/sunpy/blob/master/CODE_OF_CONDUCT.rst

Also that these comments are hidden when you submit this github issue.

Please have a search on our GitHub repository to see if a similar issue has already been posted.
If a similar issue is closed, have a quick look to see if you are satisfied by the resolution.
If not please go ahead and open an issue!
-->
### Description
<!-- Provide a general description of the bug. -->
One docstring test in `fermi.py` file when ran with `pytest-remotedata` fails
### Expected behavior
<!-- What did you expect to happen. -->
Test should pass outputting 3 records.
### Actual behavior
<!--
What actually happened.
Was the output confusing or poorly described?
-->
Test fails with 0 records.
### Steps to Reproduce
<!--
Please include **code** that reproduces the issue whenever possible.
The best reproductions are self-contained scripts with minimal dependencies.
-->
Run this on terminal, being in sunpy directory;
```python
!pytest --remote-data=any sunpy/net/dataretriever/sources/fermi_gbm.py
```
it fails without returning any results
```python
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /content/sunpy, inifile: setup.cfg
plugins: remotedata-0.3.2, cov-2.9.0, openfiles-0.5.0, doctestplus-0.7.0, filter-subpackage-0.1.1, asdf-2.6.0, arraydiff-0.3, astropy-header-0.1.2, hypothesis-5.16.0, mock-3.1.0, typeguard-2.7.1
collected 1 item                                                               

sunpy/net/dataretriever/sources/fermi_gbm.py F                           [100%]

=================================== FAILURES ===================================
________ [doctest] sunpy.net.dataretriever.sources.fermi_gbm.GBMClient _________
027     Both of which can be accessed through the attrs `a.Resolution <sunpy.net.attrs.Resolution>`.
028     The default data type is CSPEC unless the user defines.
029 
030     Examples
031     --------
032     >>> from sunpy.net import Fido, attrs as a
033     >>> res = Fido.search(a.Time('2015-06-21 00:00', '2015-06-23 23:59'),
034     ...                   a.Instrument.gbm, a.Detector.n3,
035     ...                   a.Resolution.ctime) #doctest: +REMOTE_DATA
036     >>> print(res) #doctest: +REMOTE_DATA
Differences (unified diff with -expected +actual):
    @@ -1,10 +1,7 @@
     Results from 1 Provider:
     <BLANKLINE>
    -3 Results from the GBMClient:
    -     Start Time           End Time      Source Instrument Wavelength
    -------------------- ------------------- ------ ---------- ----------
    -2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan
    -2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan
    -2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan
    +0 Results from the GBMClient:
    +Start Time End Time Source Instrument Wavelength
    +---------- -------- ------ ---------- ----------
     <BLANKLINE>
     <BLANKLINE>

/content/sunpy/sunpy/net/dataretriever/sources/fermi_gbm.py:36: DocTestFailure
=========================== short test summary info ============================
FAILED sunpy/net/dataretriever/sources/fermi_gbm.py::sunpy.net.dataretriever.sources.fermi_gbm.GBMClient
============================== 1 failed in 9.18s ===============================
```


### System Details
<!--
We at least need to know the sunpy version you are using.
We provide a short function (``sunpy.util.system_info()``) that will provide most of the below information.
This step is optional but strongly recommended.
-->
- SunPy Version: '2.0rc2'
- Astropy Version: '4.1.rc1'
- Python Version: '3.7.6'
- OS information: 'Linux Ubuntu 18.04 LTS'


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sunpy/net/dataretriever/sources/fermi_gbm.py`
Content:
```
1 from sunpy.net.dataretriever import GenericClient
2 from sunpy.util.scraper import Scraper
3 
4 __all__ = ['GBMClient']
5 
6 
7 class GBMClient(GenericClient):
8     """
9     Provides access to data from the Gamma-Ray Burst Monitor (GBM) instrument
10     on board the Fermi satellite.
11 
12     Although GBMs primary objective is to detect gamma-ray bursts,
13     it provides high quality high energy solar flare observations.
14 
15     The instrument consists of 12 Sodium Iodide (NaI) scintillation
16     detectors, which are sensitive to an energy range of 4keV to 1MeV.
17     At any one time, 6 of the NaI detectors are Sunward facing.
18     The detectors are numbered 'n1' to 'n11'. This client supports the user
19     to choose which detector to use through the `a.Detector <sunpy.net.attrs.Detector>` attribute.
20     The default detector is 'n5'.
21 
22     The GBM data comes in daily version files in two formats:
23 
24         * CSPEC - counts accumulated every  4.096 seconds in 128 energy channels for each detector.
25         * CTIME - counts accumulated every 0.256 seconds in 8 energy channels
26 
27     Both of which can be accessed through the attrs `a.Resolution <sunpy.net.attrs.Resolution>`.
28     The default data type is CSPEC unless the user defines.
29 
30     Examples
31     --------
32     >>> from sunpy.net import Fido, attrs as a
33     >>> res = Fido.search(a.Time('2015-06-21 00:00', '2015-06-23 23:59'),
34     ...                   a.Instrument.gbm, a.Detector.n3,
35     ...                   a.Resolution.ctime) #doctest: +REMOTE_DATA
36     >>> print(res) #doctest: +REMOTE_DATA
37     Results from 1 Provider:
38     <BLANKLINE>
39     3 Results from the GBMClient:
40          Start Time           End Time      Source Instrument Wavelength
41     ------------------- ------------------- ------ ---------- ----------
42     2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan
43     2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan
44     2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan
45     <BLANKLINE>
46     <BLANKLINE>
47     """
48 
49     def _get_url_for_timerange(self, timerange, **kwargs):
50         """
51         Returns the url for Fermi/GBM data for the given date.
52 
53         Parameters
54         ----------
55         timerange : `sunpy.time.TimeRange`
56             The time range for which to download the data.
57 
58         Returns
59         -------
60         `str`:
61             The url(s) for time of interest.
62         """
63         # Checks if detector keyword
64         # If not defaults to detector 5
65         if 'detector' in kwargs:
66             det = _check_detector(kwargs['detector'])
67         else:
68             det = 'n5'
69 
70         # Check for resolution keyword - either CSPEC or CTIME
71         # Default type is CSPEC
72         if 'resolution' in kwargs:
73             data_type = _check_type(kwargs['resolution'])
74         else:
75             data_type = 'cspec'
76 
77         gbm_pattern = ('https://heasarc.gsfc.nasa.gov/FTP/fermi/data/gbm/daily/'
78                        '%Y/%m/%d/current/glg_{data_type}_{det}_%y%m%d_v00.pha')
79         gbm_files = Scraper(gbm_pattern, data_type=data_type, det=det)
80         urls = gbm_files.filelist(timerange)
81 
82         return urls
83 
84     def _makeimap(self):
85         """
86         Helper function used to hold information about source.
87         """
88         self.map_['source'] = 'FERMI'
89         self.map_['instrument'] = 'GBM'
90         self.map_['physobs'] = 'flux'
91         self.map_['provider'] = 'NASA'
92 
93     @classmethod
94     def _can_handle_query(cls, *query):
95         """
96         Answers whether a client can service the query.
97 
98         Parameters
99         ----------
100         query : `list`
101             A list of of query objects.
102 
103         Returns
104         -------
105         `bool`
106             `True` if this client can service the query, otherwise `False`.
107         """
108         chkattr = ['Time', 'Instrument', 'Detector', 'Resolution']
109         chklist = [x.__class__.__name__ in chkattr for x in query]
110         for x in query:
111             if x.__class__.__name__ == 'Instrument' and x.value.lower() == 'gbm':
112                 return all(chklist)
113         return False
114 
115     @classmethod
116     def register_values(cls):
117         from sunpy.net import attrs
118         adict = {attrs.Instrument: [('GBM', 'Gamma-Ray Burst Monitor on board the Fermi satellite.')],
119                  attrs.Physobs: [('CSPEC', 'counts accumulated every 4.096 seconds in 128 energy channels for each detector.'),
120                                  ('CTIME', 'counts accumulated every 0.256 seconds in 8 energy channels')],
121                  attrs.Detector: [
122             (f"N{x}", f"GBM Detector short name for the detector NAI_{x:02}") for x in range(12)],
123             attrs.Resolution: [
124             ("CSPEC", "CSPEC 128 channel spectra every 4.096 seconds."),
125             ("CTIME", "CTIME provides 8 channel spectra every 0.256 seconds")]
126         }
127         return adict
128 
129 
130 def _check_detector(detector, **kwargs):
131     """
132     checks to see if detector is in right format.
133     """
134     detector_numbers = [str(i) for i in range(12)]
135     detector_list = ['n' + i for i in detector_numbers]
136     if detector.lower() in detector_list:
137         return detector
138     elif detector in detector_numbers:
139         return 'n' + detector
140     else:
141         raise ValueError('Detector number needs to be a string. Available detectors are n0-n11')
142 
143 
144 def _check_type(datatype, **kwargs):
145     """
146     checks is datatype is either "CSPEC" or "CTIME".
147     """
148     if not isinstance(datatype, str):
149         raise ValueError(f'{datatype} is not str - either cspec or ctime')
150 
151     if datatype.lower() != 'cspec' and datatype.lower() != 'ctime':
152         raise ValueError(f'{datatype} not value datatype - either cspec or ctime')
153     else:
154         return datatype.lower()
155
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sunpy/net/dataretriever/sources/fermi_gbm.py b/sunpy/net/dataretriever/sources/fermi_gbm.py
--- a/sunpy/net/dataretriever/sources/fermi_gbm.py
+++ b/sunpy/net/dataretriever/sources/fermi_gbm.py
@@ -119,7 +119,7 @@
                  attrs.Physobs: [('CSPEC', 'counts accumulated every 4.096 seconds in 128 energy channels for each detector.'),
                                  ('CTIME', 'counts accumulated every 0.256 seconds in 8 energy channels')],
                  attrs.Detector: [
-            (f"N{x}", f"GBM Detector short name for the detector NAI_{x:02}") for x in range(12)],
+            (f"n{x}", f"GBM Detector short name for the detector NAI_{x:02}") for x in range(12)],
             attrs.Resolution: [
             ("CSPEC", "CSPEC 128 channel spectra every 4.096 seconds."),
             ("CTIME", "CTIME provides 8 channel spectra every 0.256 seconds")]

{"golden_diff": "diff --git a/sunpy/net/dataretriever/sources/fermi_gbm.py b/sunpy/net/dataretriever/sources/fermi_gbm.py\n--- a/sunpy/net/dataretriever/sources/fermi_gbm.py\n+++ b/sunpy/net/dataretriever/sources/fermi_gbm.py\n@@ -119,7 +119,7 @@\n                  attrs.Physobs: [('CSPEC', 'counts accumulated every 4.096 seconds in 128 energy channels for each detector.'),\n                                  ('CTIME', 'counts accumulated every 0.256 seconds in 8 energy channels')],\n                  attrs.Detector: [\n-            (f\"N{x}\", f\"GBM Detector short name for the detector NAI_{x:02}\") for x in range(12)],\n+            (f\"n{x}\", f\"GBM Detector short name for the detector NAI_{x:02}\") for x in range(12)],\n             attrs.Resolution: [\n             (\"CSPEC\", \"CSPEC 128 channel spectra every 4.096 seconds.\"),\n             (\"CTIME\", \"CTIME provides 8 channel spectra every 0.256 seconds\")]\n", "issue": "GBMClient remote doctest fails\n<!--\r\nWe know asking good questions takes effort, and we appreciate your time.\r\nThank you.\r\n\r\nPlease be aware that everyone has to follow our code of conduct:\r\nhttps://github.com/sunpy/sunpy/blob/master/CODE_OF_CONDUCT.rst\r\n\r\nAlso that these comments are hidden when you submit this github issue.\r\n\r\nPlease have a search on our GitHub repository to see if a similar issue has already been posted.\r\nIf a similar issue is closed, have a quick look to see if you are satisfied by the resolution.\r\nIf not please go ahead and open an issue!\r\n-->\r\n### Description\r\n<!-- Provide a general description of the bug. -->\r\nOne docstring test in `fermi.py` file when ran with `pytest-remotedata` fails\r\n### Expected behavior\r\n<!-- What did you expect to happen. -->\r\nTest should pass outputting 3 records.\r\n### Actual behavior\r\n<!--\r\nWhat actually happened.\r\nWas the output confusing or poorly described?\r\n-->\r\nTest fails with 0 records.\r\n### Steps to Reproduce\r\n<!--\r\nPlease include **code** that reproduces the issue whenever possible.\r\nThe best reproductions are self-contained scripts with minimal dependencies.\r\n-->\r\nRun this on terminal, being in sunpy directory;\r\n```python\r\n!pytest --remote-data=any sunpy/net/dataretriever/sources/fermi_gbm.py\r\n```\r\nit fails without returning any results\r\n```python\r\n============================= test session starts ==============================\r\nplatform linux -- Python 3.6.9, pytest-5.4.2, py-1.8.1, pluggy-0.13.1\r\nrootdir: /content/sunpy, inifile: setup.cfg\r\nplugins: remotedata-0.3.2, cov-2.9.0, openfiles-0.5.0, doctestplus-0.7.0, filter-subpackage-0.1.1, asdf-2.6.0, arraydiff-0.3, astropy-header-0.1.2, hypothesis-5.16.0, mock-3.1.0, typeguard-2.7.1\r\ncollected 1 item                                                               \r\n\r\nsunpy/net/dataretriever/sources/fermi_gbm.py F                           [100%]\r\n\r\n=================================== FAILURES ===================================\r\n________ [doctest] sunpy.net.dataretriever.sources.fermi_gbm.GBMClient _________\r\n027     Both of which can be accessed through the attrs `a.Resolution <sunpy.net.attrs.Resolution>`.\r\n028     The default data type is CSPEC unless the user defines.\r\n029 \r\n030     Examples\r\n031     --------\r\n032     >>> from sunpy.net import Fido, attrs as a\r\n033     >>> res = Fido.search(a.Time('2015-06-21 00:00', '2015-06-23 23:59'),\r\n034     ...                   a.Instrument.gbm, a.Detector.n3,\r\n035     ...                   a.Resolution.ctime) #doctest: +REMOTE_DATA\r\n036     >>> print(res) #doctest: +REMOTE_DATA\r\nDifferences (unified diff with -expected +actual):\r\n    @@ -1,10 +1,7 @@\r\n     Results from 1 Provider:\r\n     <BLANKLINE>\r\n    -3 Results from the GBMClient:\r\n    -     Start Time           End Time      Source Instrument Wavelength\r\n    -------------------- ------------------- ------ ---------- ----------\r\n    -2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\r\n    -2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\r\n    -2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\r\n    +0 Results from the GBMClient:\r\n    +Start Time End Time Source Instrument Wavelength\r\n    +---------- -------- ------ ---------- ----------\r\n     <BLANKLINE>\r\n     <BLANKLINE>\r\n\r\n/content/sunpy/sunpy/net/dataretriever/sources/fermi_gbm.py:36: DocTestFailure\r\n=========================== short test summary info ============================\r\nFAILED sunpy/net/dataretriever/sources/fermi_gbm.py::sunpy.net.dataretriever.sources.fermi_gbm.GBMClient\r\n============================== 1 failed in 9.18s ===============================\r\n```\r\n\r\n\r\n### System Details\r\n<!--\r\nWe at least need to know the sunpy version you are using.\r\nWe provide a short function (``sunpy.util.system_info()``) that will provide most of the below information.\r\nThis step is optional but strongly recommended.\r\n-->\r\n- SunPy Version: '2.0rc2'\r\n- Astropy Version: '4.1.rc1'\r\n- Python Version: '3.7.6'\r\n- OS information: 'Linux Ubuntu 18.04 LTS'\r\n\n", "before_files": [{"content": "from sunpy.net.dataretriever import GenericClient\nfrom sunpy.util.scraper import Scraper\n\n__all__ = ['GBMClient']\n\n\nclass GBMClient(GenericClient):\n    \"\"\"\n    Provides access to data from the Gamma-Ray Burst Monitor (GBM) instrument\n    on board the Fermi satellite.\n\n    Although GBMs primary objective is to detect gamma-ray bursts,\n    it provides high quality high energy solar flare observations.\n\n    The instrument consists of 12 Sodium Iodide (NaI) scintillation\n    detectors, which are sensitive to an energy range of 4keV to 1MeV.\n    At any one time, 6 of the NaI detectors are Sunward facing.\n    The detectors are numbered 'n1' to 'n11'. This client supports the user\n    to choose which detector to use through the `a.Detector <sunpy.net.attrs.Detector>` attribute.\n    The default detector is 'n5'.\n\n    The GBM data comes in daily version files in two formats:\n\n        * CSPEC - counts accumulated every  4.096 seconds in 128 energy channels for each detector.\n        * CTIME - counts accumulated every 0.256 seconds in 8 energy channels\n\n    Both of which can be accessed through the attrs `a.Resolution <sunpy.net.attrs.Resolution>`.\n    The default data type is CSPEC unless the user defines.\n\n    Examples\n    --------\n    >>> from sunpy.net import Fido, attrs as a\n    >>> res = Fido.search(a.Time('2015-06-21 00:00', '2015-06-23 23:59'),\n    ...                   a.Instrument.gbm, a.Detector.n3,\n    ...                   a.Resolution.ctime) #doctest: +REMOTE_DATA\n    >>> print(res) #doctest: +REMOTE_DATA\n    Results from 1 Provider:\n    <BLANKLINE>\n    3 Results from the GBMClient:\n         Start Time           End Time      Source Instrument Wavelength\n    ------------------- ------------------- ------ ---------- ----------\n    2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\n    2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\n    2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\n    <BLANKLINE>\n    <BLANKLINE>\n    \"\"\"\n\n    def _get_url_for_timerange(self, timerange, **kwargs):\n        \"\"\"\n        Returns the url for Fermi/GBM data for the given date.\n\n        Parameters\n        ----------\n        timerange : `sunpy.time.TimeRange`\n            The time range for which to download the data.\n\n        Returns\n        -------\n        `str`:\n            The url(s) for time of interest.\n        \"\"\"\n        # Checks if detector keyword\n        # If not defaults to detector 5\n        if 'detector' in kwargs:\n            det = _check_detector(kwargs['detector'])\n        else:\n            det = 'n5'\n\n        # Check for resolution keyword - either CSPEC or CTIME\n        # Default type is CSPEC\n        if 'resolution' in kwargs:\n            data_type = _check_type(kwargs['resolution'])\n        else:\n            data_type = 'cspec'\n\n        gbm_pattern = ('https://heasarc.gsfc.nasa.gov/FTP/fermi/data/gbm/daily/'\n                       '%Y/%m/%d/current/glg_{data_type}_{det}_%y%m%d_v00.pha')\n        gbm_files = Scraper(gbm_pattern, data_type=data_type, det=det)\n        urls = gbm_files.filelist(timerange)\n\n        return urls\n\n    def _makeimap(self):\n        \"\"\"\n        Helper function used to hold information about source.\n        \"\"\"\n        self.map_['source'] = 'FERMI'\n        self.map_['instrument'] = 'GBM'\n        self.map_['physobs'] = 'flux'\n        self.map_['provider'] = 'NASA'\n\n    @classmethod\n    def _can_handle_query(cls, *query):\n        \"\"\"\n        Answers whether a client can service the query.\n\n        Parameters\n        ----------\n        query : `list`\n            A list of of query objects.\n\n        Returns\n        -------\n        `bool`\n            `True` if this client can service the query, otherwise `False`.\n        \"\"\"\n        chkattr = ['Time', 'Instrument', 'Detector', 'Resolution']\n        chklist = [x.__class__.__name__ in chkattr for x in query]\n        for x in query:\n            if x.__class__.__name__ == 'Instrument' and x.value.lower() == 'gbm':\n                return all(chklist)\n        return False\n\n    @classmethod\n    def register_values(cls):\n        from sunpy.net import attrs\n        adict = {attrs.Instrument: [('GBM', 'Gamma-Ray Burst Monitor on board the Fermi satellite.')],\n                 attrs.Physobs: [('CSPEC', 'counts accumulated every 4.096 seconds in 128 energy channels for each detector.'),\n                                 ('CTIME', 'counts accumulated every 0.256 seconds in 8 energy channels')],\n                 attrs.Detector: [\n            (f\"N{x}\", f\"GBM Detector short name for the detector NAI_{x:02}\") for x in range(12)],\n            attrs.Resolution: [\n            (\"CSPEC\", \"CSPEC 128 channel spectra every 4.096 seconds.\"),\n            (\"CTIME\", \"CTIME provides 8 channel spectra every 0.256 seconds\")]\n        }\n        return adict\n\n\ndef _check_detector(detector, **kwargs):\n    \"\"\"\n    checks to see if detector is in right format.\n    \"\"\"\n    detector_numbers = [str(i) for i in range(12)]\n    detector_list = ['n' + i for i in detector_numbers]\n    if detector.lower() in detector_list:\n        return detector\n    elif detector in detector_numbers:\n        return 'n' + detector\n    else:\n        raise ValueError('Detector number needs to be a string. Available detectors are n0-n11')\n\n\ndef _check_type(datatype, **kwargs):\n    \"\"\"\n    checks is datatype is either \"CSPEC\" or \"CTIME\".\n    \"\"\"\n    if not isinstance(datatype, str):\n        raise ValueError(f'{datatype} is not str - either cspec or ctime')\n\n    if datatype.lower() != 'cspec' and datatype.lower() != 'ctime':\n        raise ValueError(f'{datatype} not value datatype - either cspec or ctime')\n    else:\n        return datatype.lower()\n", "path": "sunpy/net/dataretriever/sources/fermi_gbm.py"}], "after_files": [{"content": "from sunpy.net.dataretriever import GenericClient\nfrom sunpy.util.scraper import Scraper\n\n__all__ = ['GBMClient']\n\n\nclass GBMClient(GenericClient):\n    \"\"\"\n    Provides access to data from the Gamma-Ray Burst Monitor (GBM) instrument\n    on board the Fermi satellite.\n\n    Although GBMs primary objective is to detect gamma-ray bursts,\n    it provides high quality high energy solar flare observations.\n\n    The instrument consists of 12 Sodium Iodide (NaI) scintillation\n    detectors, which are sensitive to an energy range of 4keV to 1MeV.\n    At any one time, 6 of the NaI detectors are Sunward facing.\n    The detectors are numbered 'n1' to 'n11'. This client supports the user\n    to choose which detector to use through the `a.Detector <sunpy.net.attrs.Detector>` attribute.\n    The default detector is 'n5'.\n\n    The GBM data comes in daily version files in two formats:\n\n        * CSPEC - counts accumulated every  4.096 seconds in 128 energy channels for each detector.\n        * CTIME - counts accumulated every 0.256 seconds in 8 energy channels\n\n    Both of which can be accessed through the attrs `a.Resolution <sunpy.net.attrs.Resolution>`.\n    The default data type is CSPEC unless the user defines.\n\n    Examples\n    --------\n    >>> from sunpy.net import Fido, attrs as a\n    >>> res = Fido.search(a.Time('2015-06-21 00:00', '2015-06-23 23:59'),\n    ...                   a.Instrument.gbm, a.Detector.n3,\n    ...                   a.Resolution.ctime) #doctest: +REMOTE_DATA\n    >>> print(res) #doctest: +REMOTE_DATA\n    Results from 1 Provider:\n    <BLANKLINE>\n    3 Results from the GBMClient:\n         Start Time           End Time      Source Instrument Wavelength\n    ------------------- ------------------- ------ ---------- ----------\n    2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\n    2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\n    2015-06-21 00:00:00 2015-06-23 23:59:00  FERMI        GBM        nan\n    <BLANKLINE>\n    <BLANKLINE>\n    \"\"\"\n\n    def _get_url_for_timerange(self, timerange, **kwargs):\n        \"\"\"\n        Returns the url for Fermi/GBM data for the given date.\n\n        Parameters\n        ----------\n        timerange : `sunpy.time.TimeRange`\n            The time range for which to download the data.\n\n        Returns\n        -------\n        `str`:\n            The url(s) for time of interest.\n        \"\"\"\n        # Checks if detector keyword\n        # If not defaults to detector 5\n        if 'detector' in kwargs:\n            det = _check_detector(kwargs['detector'])\n        else:\n            det = 'n5'\n\n        # Check for resolution keyword - either CSPEC or CTIME\n        # Default type is CSPEC\n        if 'resolution' in kwargs:\n            data_type = _check_type(kwargs['resolution'])\n        else:\n            data_type = 'cspec'\n\n        gbm_pattern = ('https://heasarc.gsfc.nasa.gov/FTP/fermi/data/gbm/daily/'\n                       '%Y/%m/%d/current/glg_{data_type}_{det}_%y%m%d_v00.pha')\n        gbm_files = Scraper(gbm_pattern, data_type=data_type, det=det)\n        urls = gbm_files.filelist(timerange)\n\n        return urls\n\n    def _makeimap(self):\n        \"\"\"\n        Helper function used to hold information about source.\n        \"\"\"\n        self.map_['source'] = 'FERMI'\n        self.map_['instrument'] = 'GBM'\n        self.map_['physobs'] = 'flux'\n        self.map_['provider'] = 'NASA'\n\n    @classmethod\n    def _can_handle_query(cls, *query):\n        \"\"\"\n        Answers whether a client can service the query.\n\n        Parameters\n        ----------\n        query : `list`\n            A list of of query objects.\n\n        Returns\n        -------\n        `bool`\n            `True` if this client can service the query, otherwise `False`.\n        \"\"\"\n        chkattr = ['Time', 'Instrument', 'Detector', 'Resolution']\n        chklist = [x.__class__.__name__ in chkattr for x in query]\n        for x in query:\n            if x.__class__.__name__ == 'Instrument' and x.value.lower() == 'gbm':\n                return all(chklist)\n        return False\n\n    @classmethod\n    def register_values(cls):\n        from sunpy.net import attrs\n        adict = {attrs.Instrument: [('GBM', 'Gamma-Ray Burst Monitor on board the Fermi satellite.')],\n                 attrs.Physobs: [('CSPEC', 'counts accumulated every 4.096 seconds in 128 energy channels for each detector.'),\n                                 ('CTIME', 'counts accumulated every 0.256 seconds in 8 energy channels')],\n                 attrs.Detector: [\n            (f\"n{x}\", f\"GBM Detector short name for the detector NAI_{x:02}\") for x in range(12)],\n            attrs.Resolution: [\n            (\"CSPEC\", \"CSPEC 128 channel spectra every 4.096 seconds.\"),\n            (\"CTIME\", \"CTIME provides 8 channel spectra every 0.256 seconds\")]\n        }\n        return adict\n\n\ndef _check_detector(detector, **kwargs):\n    \"\"\"\n    checks to see if detector is in right format.\n    \"\"\"\n    detector_numbers = [str(i) for i in range(12)]\n    detector_list = ['n' + i for i in detector_numbers]\n    if detector.lower() in detector_list:\n        return detector\n    elif detector in detector_numbers:\n        return 'n' + detector\n    else:\n        raise ValueError('Detector number needs to be a string. Available detectors are n0-n11')\n\n\ndef _check_type(datatype, **kwargs):\n    \"\"\"\n    checks is datatype is either \"CSPEC\" or \"CTIME\".\n    \"\"\"\n    if not isinstance(datatype, str):\n        raise ValueError(f'{datatype} is not str - either cspec or ctime')\n\n    if datatype.lower() != 'cspec' and datatype.lower() != 'ctime':\n        raise ValueError(f'{datatype} not value datatype - either cspec or ctime')\n    else:\n        return datatype.lower()\n", "path": "sunpy/net/dataretriever/sources/fermi_gbm.py"}]}