Skip to content

Commit

Permalink
Innate 0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
vital committed Jun 28, 2024
1 parent 237295c commit fb39636
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
release = '06/25/2024'

# The full version, including alpha/beta/rc tags
release = '0.1.11'
release = '0.1.12'

# -- Moving documentation building data functions ----------------------------

Expand Down
28 changes: 22 additions & 6 deletions examples/tutorials/3_eqn_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,27 @@
data_file = '../data/emissivity_grids.nc'
emissivities = innate.DataSet.from_file(data_file)

# Additional approximation techniques can be accessed from the interpolation (interpl) and regression
# (reg) objects as provided by the input dataset file. For example, the current dataset includes a parametrization for the
# 2D grids:

emissivities['O3_5007A'].approx.reg.eqn(12250, 122)

# Which produces the same results as above.
# In 2D datasets it is possible to perform these validations with a visual approach using the plottting function:

emissivities['O3_5007A'].plot.matrix_diagnostic(ax_cfg={'title': '$O^{2+} 500.7nm$'})

# We can compare this plot with another transitions

emissivities['He1_7065A'].plot.matrix_diagnostic(ax_cfg={'title': '$He^{+} 706.5nm$'})

# We can see the second set of emissivities have high discrepancy at high density low temperature. This means we should
# review the approximation technique if these conditions are found.


# menu. from the programing manner.
temp, den = 12250, 122
variables = (temp, den)
print('Regression Equation', emissivities['O3_5007A'].approx.reg.eqn(variables))
print('Regression Equation', emissivities['O3_5007A'].approx.reg.eqn(12250, 122))


# Compare with the original data
O3, H1 = pn.Atom('O', 3), pn.RecAtom('H', 1)
emiss_ratio = O3.getEmissivity(temp, den, wave=5007)/H1.getEmissivity(temp, den, wave=4861)
print('True value', np.log10(emiss_ratio))
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "innate-stable"
version = "0.1.11"
version = "0.1.12"
readme = "README.rst"
requires-python = ">=3.10"
license = {file = "COPYING"}
Expand Down
2 changes: 1 addition & 1 deletion src/innate/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
version = '0.1.11'
version = '0.1.12'

[parameter_labels]

Expand Down
2 changes: 1 addition & 1 deletion src/innate/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def matrix_diagnostic(self, output_address=None, num_points=15, technique='rgi',
in_ax.imshow(grid, aspect=0.05, extent=(x_range.min(), x_range.max(), y_range.min(), y_range.max()))

# Plot discrepancy below
idx_interest = percentage_difference < 0.05
idx_interest = percentage_difference < 5
in_ax.scatter(X[idx_interest], Y[idx_interest], c="None", edgecolors='black', linewidths=0.35, label='Error below 1%')

if np.sum(idx_interest == False) > 0:
Expand Down

0 comments on commit fb39636

Please sign in to comment.