class rubin_sim.site_models.CloudData(start_time, cloud_db=None, offset_year=0, scale=1000000.0)

Bases: object

Handle the cloud information.

This class deals with the cloud information that was previously produced for OpSim version 3.


The time of the start of the simulation. The cloud database will be assumed to start on Jan 01 of the same year.

cloud_dbstr, optional

The full path name for the cloud database. Default None, which will use the database stored in the module ($SIMS_CLOUDMODEL_DIR/data/cloud.db).

offset_yearfloat, optional

Offset into the cloud database by ‘offset_year’ years. Default 0.

scalefloat (1e6)

Enforce machine precision for cross-platform repeatability by scaling and rounding date values.

Methods Summary


Get the cloud for the specified time.


Read the cloud data from disk.

Methods Documentation


Get the cloud for the specified time.


Time in the simulation for which to find the current cloud coverage. The difference between this time and the start_time, plus the offset, will be used to query the cloud database for the ‘current’ conditions.


The fraction of the sky that is cloudy (measured in steps of 8ths) closest to the specified time.


Read the cloud data from disk.

The default behavior is to use the module stored database. However, an alternate database file can be provided. The alternate database file needs to have a table called Cloud with the following columns:


int : A unique index for each cloud entry.


int : The time (units=seconds) since the start of the simulation for the cloud observation.


float : The cloud coverage (in steps of 8ths) of the sky.