lvmsurveysim.schedule¶
Observing plan¶
- class lvmsurveysim.schedule.plan.ObservingPlan(start=None, end=None, format='jd', observatory='APO', summer_shutdown=None, twilight_alt=15, good_weather=None)[source]¶
Creates an observing plan.
- Parameters
start (float or path-like) – Either the JD of the start date.
end (float) – The JD of the end date.
format (str) – The format of the start and end date. Must be a format that
astropy.time.Time
can understand.observatory (str) – The observatory, either
'APO'
or'LCO'
.summer_shutdown (list) – A list of JDs that correspond to summer shutdown. Those JDs will be excluded from the range between
(start, end)
.twilight_alt (float) – The altitude in degrees at which to consider that the twilight has began or finished. A positive value although it corresponds to a depression below the horizon.
good_weather (float) – The fraction of good weather nights. Nights with bad weather will be randomised and indicated in the plan.
- Variables
data (Table) – A
Table
with the schedule information including twilight times, Moon position, and Moon phase.
TileDB¶
Scheduler¶
Simulator¶
OpsDB¶
- class lvmsurveysim.schedule.opsdb.LVMOpsBaseModel(*args, **kwargs)[source]¶
Base class for LVM’s peewee ORM models.
- DoesNotExist¶
alias of
LVMOpsBaseModelDoesNotExist
- class lvmsurveysim.schedule.opsdb.Metadata(*args, **kwargs)[source]¶
Peewee ORM class for LVM Survey Database Metadata
- DoesNotExist¶
alias of
MetadataDoesNotExist
- class lvmsurveysim.schedule.opsdb.Observation(*args, **kwargs)[source]¶
Peewee ORM class for LVM Survey Observation records
- DoesNotExist¶
alias of
ObservationDoesNotExist
- class lvmsurveysim.schedule.opsdb.OpsDB[source]¶
Interface the operations database for LVM. Makes the rest of the LVM Operations software agnostic to peewee or any other ORM we might be using one day.
- classmethod create_tables(drop=False)[source]¶
Create the database tables needed for the LVM Ops DB. Should be called only once for the lifetime of the database. Optionally, drop existing tables before creation.
- classmethod drop_tables(models)[source]¶
Delete the tables. Should not be called during Operations. Development only.
- classmethod get_db()[source]¶
Return the database instance. Should not be called outside this class.
- classmethod get_metadata(key, default_value=None)[source]¶
Get the value associated with a key from the Metadata table. Return the value, or
default_value
if not found.
- classmethod init(dbpath=None)[source]¶
Intialize the database connection. Must be called exactly once upon start of the program.
- classmethod load_tiledb(targets=None, fits=False, path=None)[source]¶
Load a tile database from the opsdb, or optionally read from FITS table file. Default is read from SQL operations database.
- Parameters
targets (TargetList or path-like) – Optional, the
TargetList
object associated with the tile database or a path to the target list to load. IfNone
, theTARGFILE
value stored in the database file will be used to find abd load the correct target list.fits (boolean) – Optional, load from a FITS table rather than SQL
path (str or Path) – Optional, the path and basename of the tile fits file, no extension. Expects to find ‘path.fits’.
- Returns
~lvmsurveysim.schedule.TileDB – TileDB instance
- classmethod record_observation(TileID, obstype, jd, lst, hz, obs_alt, lunation)[source]¶
Record an LVM Observation in the database.
- classmethod save_tiledb(tiledb, fits=False, path=None, overwrite=False)[source]¶
Saves a tile table to the operations database, optionally into a FITS table.
The default is to update the tile database in SQL. No parameters are needed in this case.
- Parameters
tiledb (
TileDB
) – The instance of a tile database to savefits (bool) – Optional, save to FITS table instead of database.
path (str or Path) – Optional, the path and basename of the fits file, no extension. Expects to find ‘path.fits’.
overwrite (bool) – Optional, overwrite the FITS file if it already exists. Default False