Skip to content

Commit

Permalink
comments updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Dec 31, 2019
1 parent 6c128dc commit a69bf1a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#*
workbench/
*egg-info/
build*
build*
__pycache__*
35 changes: 20 additions & 15 deletions cloudynight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,38 @@ class ConfExample():
"""Allsky camera configuration class."""

def __init__(self):

# define base directory structure
# each directory gets `AllskyCamera.night` appended
# [here, directories are defined relative to the scripts/ directory]

# directory structure setup (note that data actually sits in
# subdirectories that are, e.g., separated by nights)

# define base directory
self.DIR_BASE = os.path.join(
' ', *os.path.abspath(__file__).split('/')[:-2]).strip()
# location of module base (for example data)

# raw data directory root
self.DIR_RAW = os.path.join(self.DIR_BASE, 'example_data')

# archive root (will contain thumbnail images for webapp)
self.DIR_ARCHIVE = os.path.join(self.DIR_BASE, 'workbench')

# data directory location on host machine (where to pull FITS files from)
self.CAMHOST_NAME = ''
self.CAMHOST_BASEDIR = ''

# FITS file prefix and suffix used by allsky images
# FITS file prefix and suffix of allsky images
self.FITS_PREFIX = ''
self.FITS_SUFFIX = 'fits.bz2'

# SEP parameters
self.SEP_SIGMA = 1.5
self.SEP_MAXFLAG = 7
self.SEP_MINAREA = 3
self.SEP_DEBLENDN = 32
self.SEP_DEBLENDV = 0.005
self.SEP_BKGBOXSIZE = 15
self.SEP_BKGXRANGE = 3
self.SEP_BKGYRANGE = 5
self.SEP_SIGMA = 1.5 # sigma threshold
self.SEP_MAXFLAG = 7 # maximum source flag considered
self.SEP_MINAREA = 3 # minimum number of pixels per source
self.SEP_DEBLENDN = 32 # number of deblending steps
self.SEP_DEBLENDV = 0.005 # deblending parameter
self.SEP_BKGBOXSIZE = 15 # edge size of box for deriving background
self.SEP_BKGXRANGE = 3 # number of background boxes in x
self.SEP_BKGYRANGE = 5 # number of background boxes in y

# max solar elevation for processing (deg)
self.MAX_SOLAR_ELEVATION = -6;
Expand All @@ -69,15 +71,16 @@ def __init__(self):
self.MASK_FILENAME = os.path.abspath(os.path.join(self.DIR_RAW,
'mask.fits'))

# database URL and credentials
# database URL and credentials for database user `writer`
self.DB_URL = 'http://127.0.0.1:8000/'
self.DB_USER = 'writer'
self.DB_PWD = 'writecloud'

# url for retrieving training data
# uris for retrieving data
self.TRAINDATA_URL = 'http://127.0.0.1:8000/getAllLabeled/'
self.UNTRAINDATA_URL = 'http://127.0.0.1:8000/getAllUnlabeled/'

# lightGBM model optimal parameters
self.LGBMODEL_PARAMETERS = {
'max_depth': 5,
'n_estimators': 500,
Expand All @@ -87,6 +90,7 @@ def __init__(self):
'reg_alpha': 10,
'reg_lambda': 100}

# lightgbm model parameter ranges for randomized search
self.LGBMODEL_PARAMETER_DISTRIBUTIONS = {
'max_depth': randint(low=3, high=47),
'n_estimators': randint(low=100, high=1400),
Expand All @@ -97,6 +101,7 @@ def __init__(self):
'reg_alpha': [1, 5, 10, 50, 100],
'reg_lambda': [1, 5, 10, 50, 100, 500, 1000]}

# location of trained model file
self.LGBMODEL_FILE = os.path.join(self.DIR_ARCHIVE,
'lightgbm.pickle')

Expand Down

0 comments on commit a69bf1a

Please sign in to comment.