diff --git a/.gitignore b/.gitignore index 0502817..cc98b98 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ #* workbench/ *egg-info/ -build* \ No newline at end of file +build* +__pycache__* \ No newline at end of file diff --git a/cloudynight/__init__.py b/cloudynight/__init__.py index e02bbcb..95c5463 100644 --- a/cloudynight/__init__.py +++ b/cloudynight/__init__.py @@ -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; @@ -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, @@ -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), @@ -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')