nsrdb.data_model.clouds.CloudCoords
- class CloudCoords[source]
Bases:
object
Class to correct cloud coordinates based on parallax correction and also solar position / shading.
Methods
calc_sensor_azimuth
(lat, lon, sen_zen)Calculate an array of sensor azimuth angles given observed lat/lon arrays and an array of sensor zenith angles.
check_file
(fp)Check if file has required vars for cloud coord correction
correct_coords
(lat, lon, zen, azi, cld_height)Adjust cloud coordinates for parallax correction using the viewing geometry from the sensor or for shading geometry based on the sun's position.
dist_to_latitude
(dist)Calculate change in latitude in decimal degrees given distance differences north/south in km..
dist_to_longitude
(latitude, dist)Calculate change in longitude in decimal degrees given a latitude and distance differences east/west in km.
Attributes
DEFAULT_NADIR_E
DEFAULT_NADIR_W
EARTH_RADIUS
REQUIRED
- static dist_to_latitude(dist)[source]
Calculate change in latitude in decimal degrees given distance differences north/south in km..
- Parameters:
dist (np.ndarray) – Array of change in east/west location in km.
- Returns:
delta_lat (np.ndarray) – Array of change in north/south location in decimal degrees.
- static dist_to_longitude(latitude, dist)[source]
Calculate change in longitude in decimal degrees given a latitude and distance differences east/west in km.
- Parameters:
latitude (np.ndarray) – Array of latitude values in decimal degrees.
dist (np.ndarray) – Array of change in east/west location in km.
- Returns:
delta_lon (np.ndarray) – Array of change in east/west location in decimal degrees.
- classmethod calc_sensor_azimuth(lat, lon, sen_zen)[source]
Calculate an array of sensor azimuth angles given observed lat/lon arrays and an array of sensor zenith angles. NADIR is calculated based on the minimum zenith angle and the corresponding longitude, unless the minimum zenith angle is >5deg in which case the NADIR is taken from the default east/west class attributes based on the average longitude
This is necessary because old cloud files dont have the sensor_azimuth_angle dataset.
This is based on the equations in the reference: https://keisan.casio.com/exec/system/1224587128#mistake
- Parameters:
lat (np.ndarray) – Latitude values in decimal degrees
lon (np.ndarray) – Longitude values in decimal degrees
sen_zen (np.ndarray) – Sensor zenith angle for every lat/lon value for one timestep in degrees.
- Returns:
sen_azi (np.ndarray) – Senzor azimuth angle from -180 to +180 in degrees. Array has the same shape as input lat/lon/sen_zen.
- classmethod correct_coords(lat, lon, zen, azi, cld_height, zen_threshold=85, option='parallax')[source]
Adjust cloud coordinates for parallax correction using the viewing geometry from the sensor or for shading geometry based on the sun’s position. Height data for clearsky pixels should be NaN or zero, which will return un-manipulated lat/lon values.
- Parameters:
lat (np.ndarray) – Latitude values in decimal degrees
lon (np.ndarray) – Longitude values in decimal degrees
zen (np.ndarray) – Sensor or solar zen angle for every lat/lon value for one timestep in degrees.
azi (np.ndarray) – Sensor or solar azimuth angle for every lat/lon value for one timestep in degrees.
cld_height (np.ndarray) – Cloud height in km. Clearsky pixels should have (cld_height == np.nan | 0) which will return un-manipulated lat/lon values.
zen_threshold (float | int) – Thresold over which coordinate adjustments are truncated. Coordinate solar shading adjustments approach infinity at a solar zenith angle of 90.
option (str) – Either “parallax” or “shading”.
- Returns:
lat (np.ndarray) – Latitude values in decimal degrees adjusted for either A) parallax correction based on the viewing geometry from the sensor (option == “parallax”) or B) the sun position so that clouds are mapped to the coordinates they are shading (option == “shading”).
lon (np.ndarray) – Longitude values in decimal degrees adjusted for either A) parallax correction based on the viewing geometry from the sensor (option == “parallax”) or B) the sun position so that clouds are mapped to the coordinates they are shading (option == “shading”).