Skip to content

swap path for csv#670

Merged
pgbrodrick merged 2 commits into
isofit:devfrom
brentwilder:dev
Apr 24, 2025
Merged

swap path for csv#670
pgbrodrick merged 2 commits into
isofit:devfrom
brentwilder:dev

Conversation

@brentwilder

Copy link
Copy Markdown
Contributor

closes #576 , by saving the refractive index of water Excel file to a CSV.

I've opened up a similar pull request in ISOFIT-Data that brings in this new file.

@jammont jammont left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! Looks great, greatly appreciate submitting a PR to isofit-data as well

Comment thread isofit/inversion/inverse_simple.py Outdated
# __file__ should live at isofit/isofit/inversion/
isofit_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
path_k = os.path.join(isofit_path, "data", "iop", "k_liquid_water_ice.xlsx")
path_k = os.path.join(isofit_path, "data", "iop", "k_liquid_water_ice.csv")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line looks to be out of date and won't actually find the file correctly (no fault of this PR). If you could, please change from:

isofit_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
path_k = os.path.join(isofit_path, "data", "iop", "k_liquid_water_ice.csv")

to

from isofit.data import env
path_k = env.path("data", "iop", "k_liquid_water_ice.csv")

the import goes at the top of the file

@brentwilder

Copy link
Copy Markdown
Contributor Author

Thank you James for your comments on the data path. I tested EWT utility for both the original and updated CSV file and got near identical results (mean residual ~1e-8). I believe the data just needs to be merged in before this can be.

@pgbrodrick pgbrodrick merged commit 31f1dad into isofit:dev Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing install dependency: openpyxl

3 participants