sstcam / sstcam_nsb

Issue tracking and script storage for SSTCAM investigations of night sky background
2 stars 0 forks source link

Write config writer function #8

Closed STSpencer closed 3 years ago

STSpencer commented 3 years ago

NSB's dependence on a my_config.cfg file is badly designed. Write an automated function to avoid this step.

Note to self: Nothing like this seems to exist in the source code for NSB. my_config.cfg file needs to have format:

time = 2022/04/17 00:20:00
Lon = -70.317876
Lat = -24.681546
elevation = 2161.25
version = hess_basic
image_size = 200
alt = 46.3
az  = 206.3
healpixlevel = 11
gauss = 0.0
moon_above_horizon = 0.0
sun_below_horizon = -18.0

Most of these are just constants now, but observation time and alt/az are the ones that need to be written for #7 . For time use astropy TimeDelta objects to create array of astropy time instances c.f.:

import numpy as np
t[0] + dt * np.linspace(0.,1.,12)
<Time object: scale='utc' format='isot' value=['1999-01-01T00:00:00.123' '2000-01-01T06:32:43.930'
 '2000-12-31T13:05:27.737' '2001-12-31T19:38:11.544'
 '2003-01-01T02:10:55.351' '2004-01-01T08:43:39.158'
 '2004-12-31T15:16:22.965' '2005-12-31T21:49:06.772'
 '2007-01-01T04:21:49.579' '2008-01-01T10:54:33.386'
 '2008-12-31T17:27:17.193' '2010-01-01T00:00:00.000']>
STSpencer commented 3 years ago

Added by latest commit, just need to update savefits.py to use it.