Repository: sunpy/sunpy

Issue:
Order of arguments in `scale` input to `make_fitswcs_header` is wrong in AIA/EUVI reprojection example
In [the AIA/EUVI reprojection mosaic example](https://docs.sunpy.org/en/latest/generated/gallery/map_transformations/reprojection_aia_euvi_mosaic.html), the ordering of the `scale` argument to `make_fitswcs_header` is incorrect. The ordering should be Cartesian (lon, lat) [according to the `make_fitswcs_header` docstring](https://docs.sunpy.org/en/stable/api/sunpy.map.make_fitswcs_header.html#sunpy.map.make_fitswcs_header), but in this example, the order is according to the array index. This actually has no effect on the example output as the scale in both directions is the same (1 deg/pix), but is potentially confusing and conflicts with the function docstring.


Discussion:
I would like to take this one.

I just have to make this change `scale=[180 / shape_out[0],
 360 / shape_out[1]] * u.deg / u.pix` => `scale=[360 / shape_out[1],
 180 / shape_out[0]] * u.deg / u.pix`, right?

Am I missing something?
Same problem in this example: https://docs.sunpy.org/en/v3.0.1/generated/gallery/map_transformations/reprojection_heliographic_stonyhurst.html
> I would like to take this one.
> 
> I just have to make this change `scale=[180 / shape_out[0], 360 / shape_out[1]] * u.deg / u.pix` => `scale=[360 / shape_out[1], 180 / shape_out[0]] * u.deg / u.pix`, right?
> 
> Am I missing something?

Yep that is correct. The `shape` parameter is ordered according to array index, but the `scale` parameter is cartesian ordered.

Resolving patch:
diff --git a/examples/map_transformations/reprojection_aia_euvi_mosaic.py b/examples/map_transformations/reprojection_aia_euvi_mosaic.py
--- a/examples/map_transformations/reprojection_aia_euvi_mosaic.py
+++ b/examples/map_transformations/reprojection_aia_euvi_mosaic.py
@@ -95,8 +95,8 @@
                                        SkyCoord(0, 0, unit=u.deg,
                                                 frame="heliographic_stonyhurst",
                                                 obstime=maps[0].date),
-                                       scale=[180 / shape_out[0],
-                                              360 / shape_out[1]] * u.deg / u.pix,
+                                       scale=[360 / shape_out[1],
+                                              180 / shape_out[0]] * u.deg / u.pix,
                                        wavelength=int(maps[0].meta['wavelnth']) * u.AA,
                                        projection_code="CAR")
 out_wcs = WCS(header)
diff --git a/examples/map_transformations/reprojection_heliographic_stonyhurst.py b/examples/map_transformations/reprojection_heliographic_stonyhurst.py
--- a/examples/map_transformations/reprojection_heliographic_stonyhurst.py
+++ b/examples/map_transformations/reprojection_heliographic_stonyhurst.py
@@ -43,8 +43,8 @@
                      obstime=aia_map.date)
 header = sunpy.map.make_fitswcs_header(shape_out,
                                        frame_out,
-                                       scale=[180 / shape_out[0],
-                                              360 / shape_out[1]] * u.deg / u.pix,
+                                       scale=[360 / shape_out[1],
+                                              180 / shape_out[0]] * u.deg / u.pix,
                                        projection_code="CAR")
 
 out_wcs = WCS(header)


Test patch: