<commit_before>################################################################################
##########            CSUSB Astronomy Data Reduction Script           ##########
################################################################################

################################################################################
#
# - To use this script directly without needing to specify specific
#   directories, place it in a directory with all of the following folders:
#
# //===========================================\\
# || Directory  | Contents                     ||
# ||------------+------------------------------||
# || ./lights/  | Raw light images             ||
# || ./darks/   | Dark images                  ||
# || ./flats/   | Flat images                  ||
# || ./mdarks/  | Master dark images output    ||
# || ./mflats/  | Master flat images output    ||
# || ./output/  | Corrected light image output ||
# \\===========================================//
#
#   Then run the program using python3
#
# - For information about running the script with a different directory
#   structure, run the program with either the "-h" or "--help" options
#
# - Contact "<NAME> <<EMAIL>>"
#   with any questions, comments, and/or improvements
# 
################################################################################

import argparse
from astropy.io import fits
import datetime
from enum import Enum
import getopt
import glob
import logging
import numpy
import os
import sys

PROGRAM_NAME = "Astronomy Data Reduction Script"
VERSION = 2
PATCH = 1
VERSION_STR = str(VERSION) + "." + str(PATCH)

CURRENT_DATE_TIME = datetime.datetime.now().strftime("%y-%m-%dT%H:%M:%S")

#
# Flags
#
VERBOSE = False

#
# Setup logging
#
logger = logging.getLogger(PROGRAM_NAME + " Log")
fh = logging.FileHandler(CURRENT_DATE_TIME + "-reduce.log")
ch = logging.StreamHandler()
log_format_file = logging.Formatter("%(asctime)s::%(levelname)s -- %(message)s")
log_format_console = logging.Formatter("%(levelname)s -- %(message)s")
fh.setFormatter(log_format_file)
ch.setFormatter(log_format_console)
logger.setLevel(logging.DEBUG)
ch.setLevel(logging.WARNING)
logger.addHandler(ch)
logger.addHandler(fh)
logger.info("================================================")
logger.info(PROGRAM_NAME + " Log")
logger.info(CURRENT_DATE_TIME)
logger.info("================================================")

#
# ImageType enum
#
class ImageType(Enum):
	UNKNOWN = -1
	RAW = 0
	CORRECTED = 1
	FLAT = 2
	MFLAT = 3
	DARK = 4
	MDARK = 5

#
# AstroImage<commit_msg>Fixed log filename<commit_after>################################################################################
##########            CSUSB Astronomy Data Reduction Script           ##########
################################################################################

################################################################################
#
# - To use this script directly without needing to specify specific
#   directories, place it in a directory with all of the following folders:
#
# //===========================================\\
# || Directory  | Contents                     ||
# ||------------+------------------------------||
# || ./lights/  | Raw light images             ||
# || ./darks/   | Dark images                  ||
# || ./flats/   | Flat images                  ||
# || ./mdarks/  | Master dark images output    ||
# || ./mflats/  | Master flat images output    ||
# || ./output/  | Corrected light image output ||
# \\===========================================//
#
#   Then run the program using python3
#
# - For information about running the script with a different directory
#   structure, run the program with either the "-h" or "--help" options
#
# - Contact "<NAME> <<EMAIL>>"
#   with any questions, comments, and/or improvements
# 
################################################################################

import argparse
from astropy.io import fits
import datetime
from enum import Enum
import getopt
import glob
import logging
import numpy
import os
import sys

PROGRAM_NAME = "Astronomy Data Reduction Script"
VERSION = 2
PATCH = 1
VERSION_STR = str(VERSION) + "." + str(PATCH)

CURRENT_DATE_TIME = datetime.datetime.now().strftime("%y-%m-%dT%H:%M:%S")

#
# Flags
#
VERBOSE = False

#
# Setup logging
#
logger = logging.getLogger(PROGRAM_NAME + " Log")
fh = logging.FileHandler("reduce-" + CURRENT_DATE_TIME.replace("-", "").replace("T", "at").replace(":", "") + ".log")
ch = logging.StreamHandler()
log_format_file = logging.Formatter("%(asctime)s::%(levelname)s -- %(message)s")
log_format_console = logging.Formatter("%(levelname)s -- %(message)s")
fh.setFormatter(log_format_file)
ch.setFormatter(log_format_console)
logger.setLevel(logging.DEBUG)
ch.setLevel(logging.WARNING)
logger.addHandler(ch)
logger.addHandler(fh)
logger.info("================================================")
logger.info(PROGRAM_NAME + " Log")
logger.info(CURRENT_DATE_TIME)
logger.info("================================================")

#
# ImageType enum
#
class ImageType(Enum):
	UNKNOWN = -1
	RAW = 0
	CORRECTED = 1
	FLAT = 2
	MFLAT = 3
	DARK = 4
	MDARK = 5

#
# AstroImage
{'fraction_non_alphanumeric': 0.3266370484836778, 'fraction_numerical': 0.0038632412594166504, 'mean_word_length': 4.086444007858546, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1134089', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1339, 'n_words': 360}