<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Bolometric Corrections
Details about the bolometric correction package can be found in the GitHub repository starspot.
Step1:  Before requesting bolometric corrections, we need to first initialize the package, which loads the appropriate bolometric corrections tables into memory to permit faster computation of corrections hereafter. The procedure for initializing the tables can be found in the README file in the starspot.color repository. First we need to initialize a log file, where various procedural steps in the code are tracked.
Step2:  Next, we need to load the appropriate tables.
Step3:  Now that we have established which set of bolometric correction tables we wish to use, it's possible to compute bolometric correction using either the Isochrone.colorize feature, or by submitting individual requests. First, let's take a look at a couple valid queries. Note that the query is submitted as bc_eval(Teff, logg, logL/Lsun, N_filers)
Step4:  The extremely large (or small) magnitudes for the 5300 K star is very strange. These issues do not occur for the same command execution in the terminal shell.
Now, what happens when we happen to request a temperature for a value outside the grid?
Step5:  Curiously, it returns values that do not appear to be out of line. It's quite possible that the code is somehow attempting to extrapolate since we use a 4-point Lagrange inteprolation, which may unknowingly provide an extrapolation beyond the defined grid space. Comparing to Phoenix model atmospheres with the Caffau et al. (2011) solar abundances for the Johnson-Cousins and 2MASS systems, our optical $BV(RI)_C$ magnitudes are systematically 1.0 mag fainter than Phoenix at 120 Myr, and our $JHK$ magnitudes are fainter by approximately 0.04 mag at the same age. 
Finally, safely deallocate memory and close the log file.
<ASSISTANT_TASK:>
Python Code:
# change directory
%cd ../../../Projects/starspot/starspot/
from color import bolcor as bc
Explanation: Bolometric Corrections
Details about the bolometric correction package can be found in the GitHub repository starspot.
End of explanation
bc.utils.log_init('table_limits.log')  # initialize bolometric correction log file
Explanation: Before requesting bolometric corrections, we need to first initialize the package, which loads the appropriate bolometric corrections tables into memory to permit faster computation of corrections hereafter. The procedure for initializing the tables can be found in the README file in the starspot.color repository. First we need to initialize a log file, where various procedural steps in the code are tracked.
End of explanation
FeH = 0.0  # dex; atmospheric [Fe/H]
aFe = 0.0  # dex; atmospheric [alpha/Fe]
brand = 'marcs'  # use theoretical corrections from MARCS atmospheres
phot_filters = ['U', 'B', 'V', 'R', 'I', 'J', 'H', 'K']  # select a subset of filters
bc.bolcorrection.bc_init(FeH, aFe, brand, phot_filters)  # initialize tables
Explanation: Next, we need to load the appropriate tables.
End of explanation
bc.bolcorrection.bc_eval(5300.0, 4.61, -0.353, len(phot_filters))  # approx. 0.9 Msun star at 120 Myr.
bc.bolcorrection.bc_eval(3000.0, 4.94, -2.65, len(phot_filters))  # approx. 0.1 Msun star at 120 Myr.
Explanation: Now that we have established which set of bolometric correction tables we wish to use, it's possible to compute bolometric correction using either the Isochrone.colorize feature, or by submitting individual requests. First, let's take a look at a couple valid queries. Note that the query is submitted as bc_eval(Teff, logg, logL/Lsun, N_filers)
End of explanation
bc.bolcorrection.bc_eval(2204.0, 4.83, -3.47, len(phot_filters))  # outside of grid -- should return garbage.
Explanation: The extremely large (or small) magnitudes for the 5300 K star is very strange. These issues do not occur for the same command execution in the terminal shell.
Now, what happens when we happen to request a temperature for a value outside the grid?
End of explanation
bc.bolcorrection.bc_clean()
bc.utils.log_close()
Explanation: Curiously, it returns values that do not appear to be out of line. It's quite possible that the code is somehow attempting to extrapolate since we use a 4-point Lagrange inteprolation, which may unknowingly provide an extrapolation beyond the defined grid space. Comparing to Phoenix model atmospheres with the Caffau et al. (2011) solar abundances for the Johnson-Cousins and 2MASS systems, our optical $BV(RI)_C$ magnitudes are systematically 1.0 mag fainter than Phoenix at 120 Myr, and our $JHK$ magnitudes are fainter by approximately 0.04 mag at the same age. 
Finally, safely deallocate memory and close the log file.
End of explanation
<END_TASK>