{"id":20250602,"url":"https://github.com/sheepforce/hoptics","last_synced_at":"2025-07-01T03:07:14.852Z","repository":{"id":139293447,"uuid":"90386324","full_name":"sheepforce/Hoptics","owner":"sheepforce","description":"Calculation of optical data from spectra","archived":false,"fork":false,"pushed_at":"2017-11-28T10:16:54.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T16:26:50.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheepforce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-05T14:47:19.000Z","updated_at":"2017-05-10T14:48:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec3d27da-210b-48b9-89b1-1f27a83c5035","html_url":"https://github.com/sheepforce/Hoptics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sheepforce/Hoptics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepforce%2FHoptics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepforce%2FHoptics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepforce%2FHoptics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepforce%2FHoptics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheepforce","download_url":"https://codeload.github.com/sheepforce/Hoptics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepforce%2FHoptics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262887194,"owners_count":23379768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T09:59:14.455Z","updated_at":"2025-07-01T03:07:14.829Z","avatar_url":"https://github.com/sheepforce.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HOptics -- *calculation of optical data from thin film spectra*\n## Build\nHoptics is built and installed by Stack\n\n\t\tgit clone https://github.com/sheepforce/Hoptics.git\n\t\tcd Hoptics\n\t\tstack setup\n\t\tstack install\n\n\n### Dependencies\nIn order to build Hoptics you will need the Glasgow Haskell Compiler `ghc`, the GNU Scientific Library, BLAS and some Haskell packages. They can be installed by\n\n\taptitude install libgsl-dev libopenblas-dev ghc cabal-install\n\tcabal install text hmatrix hmatrix-gsl either-unwrap attoparsec\n\n\n## Usage\nHOptics can be used to calculate the index of refraction from thin film transmission spectra or to get an averaged index of refraction for inclusion/matrix system, where the two components has been measured separately. Thin film spectra have to be a two column ascii file with whitespace as column separators.\n\n\n### Index of Refraction\nFor calculating the real and imaginary part of the index of refraction call hoptics with the transmission-spectrum as the argument `hoptics /path/to/spectrum.dat`. You will see the main menu.\n\n\tHoptics\n\t∟ Main Menu\n\n\t(1)  derive index of refraction from spectrum\n\t(2)  mix two sets of indices of refraction\n\npress `1` to get to the menu for analysing the spectra. You will see the current settings for calculation, which can be changed by entering the corresponding number an [enter].\n\n\tHOptics\n\t∟ Main Menu\n\t  ∟ analyse spectrum\n\n\t(-1) return to main menu\n\t(0)  start computation\n\t(1)  path to spectrum                                  \"spectrum.dat\"\n\t(2)  thickness of the sample [nm]                      100.0\n\t(3)  spectral range for the calculation                (45000.0,590000.0)\n\t(4)  security distance around poles and boundaries     500.0\n\t(5)  seed value for real part of index of refraction   1.0\n\t(6)  dimension on x axis                               Wavenumber\n\t(7)  integration method for Kramers Kronig             Akima\n\n - (1) change the file name of the spectrum or give it here, if it was not given a argument\n - (2) thickness of the sample in nano metres\n - (3) for the integration in the Kramers-Kronig relation these are the integration bounds in m⁻¹\n - (4) which range to ommit (in m⁻¹) in the integration around the poles, if you get GSL errors, try increasing this value\n - (5) seed value for the real part of the index of refraction\n - (6) is the dimension on the x-axis a wavelength (assumed to be given in nm) or a wavenumber (assumed to be given in cm⁻¹)\n - (7) integration method to use for Kramers-Kronig relation. `Akima` is very good choice and fast. `Naive` is slow but works for problematic cases. Accuracy of `Naive` is only accurate enough for well resolved spectra\n\nAfter the settings are made, you can hit `0`  for starting the calculation. Be patient, the integration has to be done many times. Afterwards you will find the files `${prefix}_trans.dat ${prefix}_alpha.dat ${prefix}_k.dat ${prefix}_n0.dat` in your directory. The contain the transmission spectrum in m⁻¹, the extinction coefficient in m⁻¹, the imaginary part of the index of refraction and the real part of the index of refraction.\n\n### Mixing of Indices of Refraction\nFrom the main menu press `2` to enter the menu for getting the index of refraction of a mixture of two components with know indices of refraction. Again, you can change the settings by pressing the according number\n\n\tHoptics\n\t∟ Main Menu\n\t  ∟ mix spectra\n\n\t(-1) return to main menu\n\t(0)  start computation\n\t(1)  prefix of spectrum of component 1 (inclusion)       \"spectrum1\"\n\t(2)  prefix of spectrum of component 2 (matrix)          \"spectrum2\"\n\t(3)  volume fraction of component 1                      0.5\n\t(4)  magnetic permittivity of the mixture                1.0\n\n - (1) prefix name of the spectra of the inclusion. If you have the files `sample1_n0.dat sample1_k.dat` your prefix is `sample1`\n - (2) prefix name of the spectra of the matrix\n - (3) the volume fraction of the inclusion. Should typically be \u003c0.5 as the justification for value \u003e0.5 is difficult\n - (4) relative magnettic permittivity of the mixture, assuming a diamagnetic sample\n\nAfter pressing `0` the computation starts and you will get two files labeled `${prefix1}+${prefix2}_k_MaxwellGarnet.dat ${prefix1}+${prefix2}_n0_MaxwellGarnet.dat` containing the resulting imaginary and real part of the index of refraction for the mixture.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheepforce%2Fhoptics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheepforce%2Fhoptics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheepforce%2Fhoptics/lists"}