Repository: sunpy/sunpy

Issue:
Add a rigid rotation model to the `diff_rot()`
I think it'd be useful to provide a rigid rotation model to `sunpy.physics.differential_rotation.diff_rot()`.  While, strictly speaking, it wouldn't have any differential rotation, it would allow a user to use the same machinery (e.g., `RotatedSunFrame`) with and without differential rotation to see what the differences are.  The sidereal rotation rate is available at `sunpy.sun.contants.sidereal_rotation_rate`.


Discussion:
Hi 👋 I would be able to work on it, just so I understand it properly, we want to add an extra rotation type `rot_type`, namely `"rigid"`, which would calculate the longitude by:
Longitude = sidereal_rotation_rate * duration (After converting to suitable units)
Hi @asinghgaba that's right - looking at the code it seems like it should be fairly easy to add another entry to `rot_params` that has an appropriate value for the first entry, and zero values for the second two. Let us know if you have any other questions!

Resolving patch:
diff --git a/sunpy/physics/differential_rotation.py b/sunpy/physics/differential_rotation.py
--- a/sunpy/physics/differential_rotation.py
+++ b/sunpy/physics/differential_rotation.py
@@ -18,6 +18,7 @@
     on_disk_bounding_coordinates,
 )
 from sunpy.map.header_helper import get_observer_meta
+from sunpy.sun.constants import sidereal_rotation_rate
 from sunpy.time import parse_time
 from sunpy.util import expand_list
 
@@ -43,6 +44,7 @@ def diff_rot(duration: u.s, latitude: u.deg, rot_type='howard', frame_time='side
         | ``howard`` : Use values from Howard et al. (1990)
         | ``snodgrass`` : Use values from Snodgrass et. al. (1983)
         | ``allen`` : Use values from Allen's Astrophysical Quantities, and simpler equation.
+        | ``rigid`` : Use values from `~sunpy.sun.constants.sidereal_rotation_rate`.
 
     frame_time : `str`
         One of : ``'sidereal'`` or  ``'synodic'``. Choose 'type of day' time reference frame.
@@ -62,13 +64,14 @@ def diff_rot(duration: u.s, latitude: u.deg, rot_type='howard', frame_time='side
 
     where :math:`A, B, C` are constants that depend on the model:
 
-    ========= ===== ====== ====== ==========
-    Model     A     B      C      Unit
-    ========= ===== ====== ====== ==========
-    howard    2.894 -0.428 -0.370 microrad/s
-    snodgrass 2.851 -0.343 -0.474 microrad/s
-    allen     14.44 -3.0   0      deg/day
-    ========= ===== ====== ====== ==========
+    ========= ======= ====== ====== ==========
+    Model     A       B      C      Unit
+    ========= ======= ====== ====== ==========
+    howard    2.894   -0.428 -0.370 microrad/s
+    snodgrass 2.851   -0.343 -0.474 microrad/s
+    allen     14.44   -3.0   0      deg/day
+    rigid     14.1844 0      0      deg/day
+    ========= ======= ====== ====== ==========
 
     1 microrad/s is approximately 4.95 deg/day.
 
@@ -115,10 +118,11 @@ def diff_rot(duration: u.s, latitude: u.deg, rot_type='howard', frame_time='side
 
     rot_params = {'howard': [2.894, -0.428, -0.370] * u.urad / u.second,
                   'snodgrass': [2.851, -0.343, -0.474] * u.urad / u.second,
-                  'allen': [14.44, -3.0, 0] * u.deg / u.day
+                  'allen': [14.44, -3.0, 0] * u.deg / u.day,
+                  'rigid': sidereal_rotation_rate * [1, 0, 0]
                   }
 
-    if rot_type not in ['howard', 'allen', 'snodgrass']:
+    if rot_type not in ['howard', 'allen', 'snodgrass', 'rigid']:
         raise ValueError("rot_type must equal one of "
                          "{{ {} }}".format(" | ".join(rot_params.keys())))
 


Test patch:
diff --git a/sunpy/physics/tests/test_differential_rotation.py b/sunpy/physics/tests/test_differential_rotation.py
--- a/sunpy/physics/tests/test_differential_rotation.py
+++ b/sunpy/physics/tests/test_differential_rotation.py
@@ -130,6 +130,11 @@ def test_snodgrass(seconds_per_day):
     assert_quantity_allclose(rot, 135.4232 * u.deg, rtol=1e-3)
 
 
+def test_rigid(seconds_per_day):
+    rot = diff_rot(10 * seconds_per_day, [0, 30, 60] * u.deg, rot_type='rigid')
+    assert_quantity_allclose(rot, [141.844 * u.deg] * 3, rtol=1e-3)
+
+
 def test_fail(seconds_per_day):
     with pytest.raises(ValueError):
         rot = diff_rot(10 * seconds_per_day, 30 * u.deg, rot_type='garbage')