Closed lllx125 closed 4 months ago
I wrote setunits() for some global variables.
I added initialization for variables in global.jl
I think it would be better to initialize variables in global.jl to 0 because I will be creating them in setunits() anyway. Also, there is 1 line that r_p = r_e * m_electron / m_proton, if m_proton =0 there will be runtime error
Looks really good. My last quibble (which I should have mentioned earlier) is that your metric-prefix changing functions (k(), M(), etc.) aren't very informative... naming them the 4 or five character prefix name (kilo(), Mega(), etc.) might be better.
I'm also curious as to why your global mass unit is amu, as opposed to eV/c^2, which is what all the base masses are in.
I'm also curious as to why your global mass unit is amu, as opposed to eV/c^2, which is what all the base masses are in. Looks really good. My last quibble (which I should have mentioned earlier) is that your metric-prefix changing functions (k(), M(), etc.) aren't very informative... naming them the 4 or five character prefix name (kilo(), Mega(), etc.) might be better.
I can change both of these. I thought the isotope masses were in amu, and that is the majority of the data. Should setunits() also convert the isotope data?
Unless there was a good reason not to, I would favor having isotope masses in AMU since it makes it easier for someone doing a deep dive in the code to compare against the literature.
Okay, this means you'll have to handle isotope masses differently from the other masses, Lixing. That shouldn't be too hard, because all the isotope masses are contained in a special type called 'AtomicSpecies' which has a dictionary member that contains all the iso masses for that element. If you look at the type definition in src/ParticleTypes.jl you might get some insight into how to differentiate the isotope masses from the regular mass constants
I made the new SetUnit.jl, with new structures for units. the function setunits() is not implemented but I wrote tests at the bottom and its results. The function and the units worked as desired. Once the file for global variable need to be declared is created, it would be easy to include other units and implement the body of the function setunits().