lib/gs2crmod/calculations.rb in gs2crmod-0.11.68 vs lib/gs2crmod/calculations.rb in gs2crmod-0.11.69
- old
+ new
@@ -749,10 +749,12 @@
def max_es_heat_amp(species_index)
@transient_es_heat_flux_amplification_at_species_at_ky[species_index-1].values.max
end
def calculate_spectral_checks
+ kx = gsl_vector('kx')
+ ky = gsl_vector('ky')
ky_spec = gsl_vector('spectrum_over_ky')
kx_spec = gsl_vector('spectrum_over_kx')
kpar_spec = gsl_vector('spectrum_over_kpar', ky_index: ky_spec.max_index + 1, kx_index: 1)
@spectrum_check = []
@@ -765,10 +767,21 @@
rescue
check= -10
end
@spectrum_check.push check
end
+
+ #Calculate peak kx, ky spectrum values and associated phi2 values
+ peak_ky_idx = ky_spec.max_index
+ @ky_spectrum_peak_ky = ky[peak_ky_idx]
+
+ #Also want to know the phi2 at the energy containing scales and for ZFs
+ #Pick phi2 at the final time step.
+ phi_vec = gsl_vector('phi2_by_ky_over_time', ky_index:peak_ky_idx)
+ @ky_spectrum_peak_phi2 = phi_vec[-1]
+ phi_vec = gsl_vector('phi2_by_ky_over_time', ky_index:1)
+ @phi2_zonal = phi_vec[-1]
end
def calculate_vspace_checks
@vspace_check = ['lpc_pitch_angle', 'vres_pitch_angle', 'lpc_energy', 'vres_energy'].map do |name|
saturated_time_average(name, {})
@@ -795,9 +808,8 @@
def sc(min)
return @spectrum_check.min >= min
end
alias :csc :calculate_spectral_checks
-
end
end