Skip to content

Commit

Permalink
check LHS point in generation
Browse files Browse the repository at this point in the history
  • Loading branch information
grburgess committed Jul 26, 2023
1 parent 2c4cf97 commit 4d510de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 11 additions & 5 deletions ronswanson/database.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import collections
from collections import OrderedDict
from dataclasses import dataclass
from typing import Dict, List, Optional, Union
from pathlib import Path
import collections
from typing import Dict, List, Optional, Union

import astropy.units as u
import h5py
import numpy as np
import plotly.graph_objects as go
from astromodels import TemplateModel, TemplateModelFactory
from astromodels.functions.template_model import TemplateFile
from astromodels.utils.logging import silence_console_log
from astromodels.utils import get_user_data_path
from astromodels.utils.logging import silence_console_log
from joblib import Parallel, delayed
from tqdm.auto import tqdm

from ronswanson.grids import Parameter, ParameterGrid
Expand All @@ -19,8 +21,6 @@

from .utils.logging import setup_logger

from joblib import Parallel, delayed

log = setup_logger(__name__)


Expand Down Expand Up @@ -166,6 +166,12 @@ def energy_grid(self) -> np.ndarray:

return self._energy_grid

@property
def energy_grid_nu(self) -> np.ndarray:

return (self._energy_grid * u.keV).to("Hz", equivalencies = u.spectral())


@property
def meta_data(self) -> Optional[Dict[str, np.ndarray]]:

Expand Down
3 changes: 3 additions & 0 deletions ronswanson/simulation_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ def _compute_lhs_sampling(self):

u_bounds = pg.min_max_values[:, 1]

log.info(f"LHS min values: {l_bounds}")
log.info(f"LHS max values: {u_bounds}")

if self._lhs_unit_file is None:

log.info("Sampling LHS points")
Expand Down

0 comments on commit 4d510de

Please sign in to comment.