GeoscienceAustralia / eqrm

Automatically exported from code.google.com/p/eqrm
Other
5 stars 4 forks source link

error with EQRM after rolling back the capacity curve with variable parameters #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

I got an error with options below:

csm_use_variability = True
csm_variability_method = None 

Traceback (most recent call last):
  File "setdata_ScenRisk.py", line 105, in <module>
    main(locals())
  File "/nas/users/u65242/unix/eqrm/eqrm_code/analysis.py", line 436, in main
    damage) = sites.calc_total_loss(SA, eqrm_flags, overloaded_MW)
  File "/nas/users/u65242/unix/eqrm/eqrm_code/structures.py", line 262, in calc_total_loss
    csm_params=csm_params)
  File "/nas/users/u65242/unix/eqrm/eqrm_code/damage_model.py", line 77, in __init__
    self.capacity_spectrum_model = Capacity_spectrum_model(**csm_params)
  File "/nas/users/u65242/unix/eqrm/eqrm_code/capacity_spectrum_model.py", line 98, in __init__
    building_parameters,magnitudes)
  File "/nas/users/u65242/unix/eqrm/eqrm_code/capacity_spectrum_model.py", line 257, in _calculate_parameters
    csm_variability_method=csm_variability_method)
  File "/nas/users/u65242/unix/eqrm/eqrm_code/capacity_spectrum_functions.py", line 232, in calculate_capacity_parameters
    raise NotImplementedError
NotImplementedError

Original issue reported on code.google.com by duncan.g...@gmail.com on 22 Aug 2012 at 3:19

GoogleCodeExporter commented 9 years ago
This can be replicated by doing csm_use_variability = True in 
demo/setdata_ScenRisk.py

Original comment by duncan.g...@gmail.com on 22 Aug 2012 at 3:42

GoogleCodeExporter commented 9 years ago
This can also be replicated in Revision 1176.
So this is not an error due to the rolling back, specifically.  

Original comment by duncan.g...@gmail.com on 22 Aug 2012 at 5:11

GoogleCodeExporter commented 9 years ago
I made changes to the code so None means there is no sampling;
    if csm_use_variability:
        if csm_variability_method == 3:
            variate=stats.norm.rvs(size=(Au.size*number_events))
            variate.shape=(Au.size,number_events,1)
            variate=variate*sdtcap
        elif csm_variability_method == 4:
            variate=2.0*sdtcap
        elif csm_variability_method == 5:
            variate=1.0*sdtcap
        elif csm_variability_method == 6:
            variate=-1.0*sdtcap
        elif csm_variability_method == 7:
            variate=-2.0*sdtcap   
        elif csm_variability_method == None:
            variate= 0.0    
        else:
            raise NotImplementedError
        Au=Au*exp(variate)
        Ay=Au/Lambda
        Dy=(1000/(4*pi**2)*g)*Ay*(T**2)
        Du=Du+0*Au

Original comment by duncan.g...@gmail.com on 22 Aug 2012 at 5:25