Repository: sunpy/sunpy

Issue:
Map complains about missing observer even if it shoudn't
If you construct a Map in heliographic Stonyhurst coordinates:

```python
arr = np.empty([720, 1024])
header = sunpy.map.make_fitswcs_header(arr,
                                       SkyCoord(0, 0, unit=u.deg,
                                                frame="heliographic_stonyhurst",
                                                obstime=maps[0].date),
                                       scale=[0.25,0.25]*u.deg/u.pix,
                                       projection_code="CAR")
outmap = sunpy.map.Map((arr, header))
outmap.peek()
```
you get the following warning:
```
WARNING: SunpyUserWarning: Missing metadata for observer: assuming Earth-based observer.The following sets of keys were checked:
('hgln_obs', 'hglt_obs', 'dsun_obs')
('crln_obs', 'crlt_obs', 'dsun_obs') [sunpy.map.mapbase]
```
This is a nonsense, when the coordinate frame is HGS we don't need an observer. The only question is how we know when we need one and when we don't? (Given the frame of the map could be ICRS or something i.e. ALMA data). @ayshih ?


Discussion:
doesn't`.peek` automatically do a `draw_limb()` , hence you require an observer to know the size of the limb? 

if you do a `.plot()` you shouldn't get any warnings
I don't think `peek()` defaults to `draw_limb=True`.

For clarity, this Map is a HGS lon/lat plot like a synpotic map or similar, so draw_limb wouldn't be very useful anyway.
oh yes sorry! 🤦‍♂ 
The warning is produced because the `Map.wcs` property retrieves the observer coordinate, even if that information isn't later used: https://github.com/sunpy/sunpy/blob/b9a76781e62123fa49718fc706e425a2c5b8037e/sunpy/map/mapbase.py#L278
@ayshih The question is how we determine reliably if `self.coordinate_frame` needs an observer?
Since we know from the CTYPEs whether the WCS object should be for an observer-based frame, can't we just retrieve the observer coordinate only when it's relevant?

```python
        ctypes = {c[:4] for c in w2.wcs.ctype}
        if {'HPLN', 'HPLT'} <= ctypes or {'SOLX', 'SOLY'} <= ctypes:
            w2.heliographic_observer = self.observer_coordinate
```

Resolving patch:
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -275,7 +275,6 @@ def wcs(self):
         w2.wcs.pc = self.rotation_matrix
         w2.wcs.cunit = self.spatial_units
         w2.wcs.dateobs = self.date.iso
-        w2.heliographic_observer = self.observer_coordinate
         w2.rsun = self.rsun_meters
 
         # Astropy WCS does not understand the SOHO default of "solar-x" and
@@ -288,6 +287,13 @@ def wcs(self):
         if w2.wcs.ctype[1].lower() in ("solar-y", "solar_y"):
             w2.wcs.ctype[1] = 'HPLT-TAN'
 
+        # GenericMap.coordinate_frame is implemented using this method, so we
+        # need to do this only based on .meta.
+        ctypes = {c[:4] for c in w2.wcs.ctype}
+        # Check that the ctypes contains one of these two pairs of axes.
+        if {'HPLN', 'HPLT'} <= ctypes or {'SOLX', 'SOLY'} <= ctypes:
+            w2.heliographic_observer = self.observer_coordinate
+
         return w2
 
     @property


Test patch:
diff --git a/sunpy/map/tests/test_mapbase.py b/sunpy/map/tests/test_mapbase.py
--- a/sunpy/map/tests/test_mapbase.py
+++ b/sunpy/map/tests/test_mapbase.py
@@ -108,6 +108,11 @@ def test_wcs(aia171_test_map):
     assert set(wcs.wcs.cunit) == {u.Unit(a) for a in aia171_test_map.spatial_units}
 
 
+def test_no_observer_wcs(heliographic_test_map):
+    assert isinstance(heliographic_test_map.wcs, astropy.wcs.WCS)
+    assert not hasattr(heliographic_test_map.wcs, "heliographic_observer")
+
+
 def test_dtype(generic_map):
     assert generic_map.dtype == np.float64