-
Notifications
You must be signed in to change notification settings - Fork 5
Add units to UnitConv classes. #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add units to UnitConv classes. #98
Conversation
|
Should we add a get_units(field) method or are we content with the get_unitconv(field).eng/phys_units syntax? |
|
@willrogers I think this should be good to merge now. |
utils/load_unitconv.m
Outdated
| sext_families = findmemberof('SEXT'); | ||
|
|
||
| % Unit conversions for lattice fields | ||
| fprintf(f_units, '%d,%s,poly,%d,%s,%s\n', 0, 'energy', 0, 'Mev', 'Mev'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be MeV and GeV (GeV being whichever is the smaller number)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch I will correct the physics units to Gev.
utils/load_unitconv.m
Outdated
| end | ||
| id = write_linear_data(data.field(2) / data.current(2), 0); | ||
| fprintf(f_units, '%d,%s,poly,%d\n', renamedIndexes(hcor_index), 'x_kick', id); | ||
| fprintf(f_units, '%d,%s,poly,%d,%s,%s\n', renamedIndexes(hcor_index), 'x_kick', id, 'rads^-2', 'A'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where rads^-2 came from. The value is in radians, but for simplicity we are treating radians as dimensionless: https://en.wikipedia.org/wiki/Radian#Dimensional_analysis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, should it be 'rads', 'A' or '', 'A'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'', 'A'
Ready to merge