Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSM - refactor main code for clarity and to fix some bugs
- Add error messages when length_unit or time_unit is missing from AIM - Try to be conservative with creating new variables just for the sake of more concise dictionary access - gm_units uses "g" for now, but make sure the following code will work even when we potentially generalize beyond "g". Throw an error when an expected gm_unit is encountered. - Extend run_csm to save the capacity curves in a JSON file to support post-processing. - Refactor determine_response to start with opening inputs and checking if they are valid. - Change some variable names to be more descriptive and avoid using upper case letters. - Parse the demand, capacity, and damping models early on once rather than parsing them once for each direction. We could also initialize the models early, but I am not sure they'll behave well when applied multiple times. It seemed safer to initialize them for each direction separately for the time being. Further improvements seem like low hanging fruits in that department. - Improve how roof height is loaded. Further improvements are planned by taking care of how roof height is saved in GeneralInformation. - Add scaling of roof height by considering the workflow units and the internal units of the CSM script - Now that the capacity model is loaded ahead of time, loading the default roof height from Hazus will actually work. - Add a temporary fix to scale PEER timehistories assuming [g] units rather than using the workflow units from AIM. This will be improved later. - Extend IMComputer part to also extract PGA and store it as PFA-0-1 - Add comments about the various unit conversions so that future devs might find it easier to follow what is happening. - Improve how accel_x and accel_y are loaded from response_accel - Scale the resulting spectral accelerations back to the workflow units before saving them in the EDP file.
- Loading branch information