diff --git a/src/m_sun.cc b/src/m_sun.cc index ba6e9aa86f..2c23bcaf7d 100644 --- a/src/m_sun.cc +++ b/src/m_sun.cc @@ -190,6 +190,42 @@ void sunsAddSingleFromGridAtLocation( } +void sunsChangeGeometry(ArrayOfSun &suns, + // Inputs: + const Numeric &radius, + const Numeric &distance, + const Numeric &latitude, + const Numeric &longitude, + const Index &sun_index, + const Verbosity &) +{ + if (sun_index == -999) return; + + ARTS_USER_ERROR_IF(sun_index+1 > suns.nelem(), + "The sun index ", sun_index, " is out of range. \n" + "The sun array has only ", suns.nelem(), " elements.") + + if (radius > 0) suns[sun_index].radius = radius; + if (distance > 0) suns[sun_index].distance = distance; + + //some sanity checks + ARTS_USER_ERROR_IF(distance 90, + "The latitude of the sun should be between -90 and 90 degrees,\n" + "but is ", latitude, " degrees") + + ARTS_USER_ERROR_IF(longitude < -180 || longitude > 360, + "The longitude of the sun should be between -180 and 360 degrees,\n" + "but is ", longitude, " degrees") + + + suns[sun_index].latitude = latitude; + suns[sun_index].longitude = longitude; +} + void sunsOff(Index &suns_do, ArrayOfSun &suns, const Verbosity &){ diff --git a/src/methods.cc b/src/methods.cc index 7db87c2b34..2f3eb6bbc1 100644 --- a/src/methods.cc +++ b/src/methods.cc @@ -19770,7 +19770,29 @@ where N>=0 and the species name is something line "H2O". "The description of the sun. ", "The latitude of the sun spectrum measurement. ", "The longitude of the sun spectrum measurement. ", - "The altitude of the sun spectrum measurement. "))); + "The altitude of the sun spectrum measurement. "))); + + md_data_raw.push_back(create_mdrecord( + NAME("sunsChangeGeometry"), + DESCRIPTION( + "Change the geometry of desired sun\n"), + AUTHORS("Manfred Brath"), + OUT("suns"), + GOUT(), + GOUT_TYPE(), + GOUT_DESC(), + IN(), + GIN("radius","distance","latitude","longitude","index"), + GIN_TYPE("Numeric","Numeric","Numeric","Numeric","Index"), + GIN_DEFAULT("-999","-999","-999","-999","-999"), + GIN_DESC("The radius of the sun in meter. If set to -999, it is not changed", + "Distance from center of the planet to center of the sun in meter." + "If set to -999, it is not changed", + "Latitude of the zenith position of the sun. Must be between -90 and 90." + "If set to -999, it is not changed", + "Longitude of the zenith position of the sun. Must be between -180 and 360." + "If set to -999, it is not changed", + "The index of the sun to change. If set to -999 nothing is changed"))); md_data_raw.push_back(create_mdrecord( NAME("sunsOff"),