gs2crmod 0.11.101 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/gs2crmod.gemspec +5 -7
- data/lib/gs2crmod/calculations.rb +1 -1
- data/lib/gs2crmod/graphs.rb +17 -21
- data/lib/gs2crmod/gs2.rb +3 -3
- data/lib/gs2crmod/gsl_data.rb +20 -21
- metadata +40 -22
- checksums.yaml +0 -7
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0. | 
| 1 | 
            +
            0.12.0
         | 
    
        data/gs2crmod.gemspec
    CHANGED
    
    | @@ -2,17 +2,14 @@ | |
| 2 2 | 
             
            # DO NOT EDIT THIS FILE DIRECTLY
         | 
| 3 3 | 
             
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         | 
| 4 4 | 
             
            # -*- encoding: utf-8 -*-
         | 
| 5 | 
            -
            # stub: gs2crmod 0.11.101 ruby lib
         | 
| 6 | 
            -
            # stub: ext/extconf.rb
         | 
| 7 5 |  | 
| 8 6 | 
             
            Gem::Specification.new do |s|
         | 
| 9 7 | 
             
              s.name = "gs2crmod"
         | 
| 10 | 
            -
              s.version = "0. | 
| 8 | 
            +
              s.version = "0.12.0"
         | 
| 11 9 |  | 
| 12 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 13 | 
            -
              s.require_paths = ["lib"]
         | 
| 14 11 | 
             
              s.authors = ["Edmund Highcock", "Ferdinand van Wyk"]
         | 
| 15 | 
            -
              s.date = "2015-07- | 
| 12 | 
            +
              s.date = "2015-07-28"
         | 
| 16 13 | 
             
              s.description = "GS2 is a gyrokinetic flux tube initial value turbulence code which can be used for fusion or astrophysical plasmas. CodeRunner is a framework for the automated running and analysis of large simulations. This module allows GS2 (and its sister code AstroGK) to harness the power of the CodeRunner framework."
         | 
| 17 14 | 
             
              s.email = "edmundhighcock@sourceforge.net"
         | 
| 18 15 | 
             
              s.extensions = ["ext/extconf.rb"]
         | 
| @@ -79,12 +76,13 @@ Gem::Specification.new do |s| | |
| 79 76 | 
             
              ]
         | 
| 80 77 | 
             
              s.homepage = "http://gs2crmod.sourceforge.net"
         | 
| 81 78 | 
             
              s.licenses = ["GSLv3"]
         | 
| 79 | 
            +
              s.require_paths = ["lib"]
         | 
| 82 80 | 
             
              s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
         | 
| 83 | 
            -
              s.rubygems_version = " | 
| 81 | 
            +
              s.rubygems_version = "1.8.23"
         | 
| 84 82 | 
             
              s.summary = "Module to allow CodeRunner to run and analyse the GS2 and AstroGK codes."
         | 
| 85 83 |  | 
| 86 84 | 
             
              if s.respond_to? :specification_version then
         | 
| 87 | 
            -
                s.specification_version =  | 
| 85 | 
            +
                s.specification_version = 3
         | 
| 88 86 |  | 
| 89 87 | 
             
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         | 
| 90 88 | 
             
                  s.add_runtime_dependency(%q<coderunner>, [">= 0.15.5"])
         | 
| @@ -279,7 +279,7 @@ def calculate_frequencies | |
| 279 279 | 
             
            		logi(f)
         | 
| 280 280 | 
             
            		@frequency_at_ky_at_kx||= FloatHash.new
         | 
| 281 281 | 
             
            		ky_values = []
         | 
| 282 | 
            -
            		regex = Regexp.new( "^.* | 
| 282 | 
            +
            		regex = Regexp.new( "^.*ky=\\s*(?<aky>#{f})\s*kx=\\s*(?<akx>#{f}).*omav=\\s*(?<re>#{f})\\s*(?<gr>#{f})")
         | 
| 283 283 | 
             
            		final_timestep_list.scan(regex) do
         | 
| 284 284 | 
             
            			aky = eval($~[:aky])
         | 
| 285 285 | 
             
            			akx = eval($~[:akx])
         | 
    
        data/lib/gs2crmod/graphs.rb
    CHANGED
    
    | @@ -21,8 +21,8 @@ def auto_axiskits(name, options) | |
| 21 21 | 
             
                # </MJL>
         | 
| 22 22 | 
             
                'phi2_by_ky_over_time' => ['Phi^2 by ky', ''],
         | 
| 23 23 | 
             
                'phi2_by_kx_over_time' => ['Phi^2 by ky', ''],  
         | 
| 24 | 
            -
                ' | 
| 25 | 
            -
                ' | 
| 24 | 
            +
                'es_heat_flux_by_ky_over_time' => ['Heat flux by ky', ''],
         | 
| 25 | 
            +
                'es_heat_flux_by_kx_over_time' => ['Heat flux by kx', ''],  
         | 
| 26 26 | 
             
                'phi2_by_mode_over_time' => ["Phi^2 by mode", ''],
         | 
| 27 27 | 
             
                'tpar2_by_mode_over_time' => ["(delta T_parallel)^2 by mode", '%'],
         | 
| 28 28 | 
             
                'tperp2_by_mode_over_time' => ["(delta T_perp)^2 by mode", '%'],
         | 
| @@ -47,8 +47,8 @@ def auto_axiskits(name, options) | |
| 47 47 | 
             
                'spectrum_over_kx_avg' => ["Spectrum Averaged Over Time", '', 1],
         | 
| 48 48 | 
             
                'spectrum_over_ky' => ["Spectrum at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", '', 1],
         | 
| 49 49 | 
             
                'spectrum_over_ky_avg' => ["Spectrum Averaged Over Time", '', 1],
         | 
| 50 | 
            -
                ' | 
| 51 | 
            -
                ' | 
| 50 | 
            +
                'es_heat_flux_over_kx' => ["Heat Flux at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", 'Q_gB', 1],
         | 
| 51 | 
            +
                'es_heat_flux_over_ky' => ["Heat Flux at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", 'Q_gB', 1],
         | 
| 52 52 | 
             
                'es_heat_flux_over_ky_over_kx' => ["Heat flux at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", '', 2],
         | 
| 53 53 | 
             
                'spectrum_over_kpar' => ["Spectrum at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", '', 1],
         | 
| 54 54 | 
             
                'spectrum_over_ky_over_kx' => ["Spectrum at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", '', 2],
         | 
| @@ -267,7 +267,6 @@ module GraphKits | |
| 267 267 | 
             
            			kit = GraphKit.autocreate({x: axiskit('t', options), y: phiax})
         | 
| 268 268 | 
             
            			kit.data[0].title = "Phi^2 total: #{kxy} = #{options[kxy]}"	
         | 
| 269 269 | 
             
            			if options[:t_index]
         | 
| 270 | 
            -
            # 				p 'hello'
         | 
| 271 270 | 
             
            				array_element = options[:t_index_window] ? options[:t_index] - options[:t_index_window][0] : options[:t_index] - 1
         | 
| 272 271 | 
             
            # 				p phiax.data.size, array_element
         | 
| 273 272 | 
             
            # 				p options[:t_index], options[:t_index_window]
         | 
| @@ -345,7 +344,7 @@ module GraphKits | |
| 345 344 |  | 
| 346 345 | 
             
            	alias :eigenfunction_graphkit :efn_graphkit
         | 
| 347 346 |  | 
| 348 | 
            -
            	def  | 
| 347 | 
            +
            	def es_heat_flux_vs_ky_vs_kx_graphkit(options={})
         | 
| 349 348 | 
             
            		case options[:command]
         | 
| 350 349 | 
             
            		when :help
         | 
| 351 350 | 
             
            			return  "Graph of electrostatic contribution to heat flux at a given time vs kx and ky"
         | 
| @@ -362,7 +361,7 @@ module GraphKits | |
| 362 361 | 
             
            		end
         | 
| 363 362 | 
             
            	end
         | 
| 364 363 |  | 
| 365 | 
            -
            	def  | 
| 364 | 
            +
            	def es_heat_flux_vs_kx_graphkit(options={})
         | 
| 366 365 | 
             
            		case options[:command]
         | 
| 367 366 | 
             
            		when :help
         | 
| 368 367 | 
             
            			return "Heat flux vs kx"
         | 
| @@ -372,7 +371,7 @@ module GraphKits | |
| 372 371 | 
             
            			return es_heat_flux_vs_kxy_graphkit(options.absorb({direction: :kx}))
         | 
| 373 372 | 
             
            		end
         | 
| 374 373 | 
             
            	end
         | 
| 375 | 
            -
            	def  | 
| 374 | 
            +
            	def es_heat_flux_vs_ky_graphkit(options={})
         | 
| 376 375 | 
             
            		case options[:command]
         | 
| 377 376 | 
             
            		when :help
         | 
| 378 377 | 
             
            			return "Heat flux vs ky"
         | 
| @@ -391,7 +390,7 @@ module GraphKits | |
| 391 390 | 
             
            			return [:ky_index, :species_index]
         | 
| 392 391 | 
             
            		else
         | 
| 393 392 | 
             
            			kxy = options[:direction]||options[:kxy] 
         | 
| 394 | 
            -
            			kit = GraphKit.autocreate({x: axiskit(kxy.to_s, options), y: axiskit(" | 
| 393 | 
            +
            			kit = GraphKit.autocreate({x: axiskit(kxy.to_s, options), y: axiskit("es_heat_flux_over_#{kxy}", options)})
         | 
| 395 394 | 
             
            			kit.title  = "Heat flux vs #{kxy} for species #{options[:species_index]}"
         | 
| 396 395 | 
             
            			kit.file_name = options[:graphkit_name] + options[:t_index].to_s
         | 
| 397 396 | 
             
            			kit.data[0].with = 'lp'
         | 
| @@ -2012,25 +2011,25 @@ module GraphKits | |
| 2012 2011 | 
             
                  end
         | 
| 2013 2012 | 
             
            # </MJL>
         | 
| 2014 2013 |  | 
| 2015 | 
            -
            	def  | 
| 2014 | 
            +
            	def es_heat_flux_by_mode_vs_time_graphkit(options={})
         | 
| 2016 2015 | 
             
            		options[:direction] = :mode
         | 
| 2017 | 
            -
            		 | 
| 2016 | 
            +
            		es_heat_flux_by_kxy_or_mode_vs_time_graphkit(options)
         | 
| 2018 2017 | 
             
            	end
         | 
| 2019 2018 |  | 
| 2020 | 
            -
            	def  | 
| 2019 | 
            +
            	def es_heat_flux_by_kx_vs_time_graphkit(options={})
         | 
| 2021 2020 | 
             
            		options[:direction] = :kx
         | 
| 2022 | 
            -
            		 | 
| 2021 | 
            +
            		es_heat_flux_by_kxy_or_mode_vs_time_graphkit(options)
         | 
| 2023 2022 | 
             
            	end
         | 
| 2024 2023 |  | 
| 2025 | 
            -
            	def  | 
| 2024 | 
            +
            	def es_heat_flux_by_ky_vs_time_graphkit(options={})
         | 
| 2026 2025 | 
             
            		options[:direction] = :ky
         | 
| 2027 | 
            -
            		 | 
| 2026 | 
            +
            		es_heat_flux_by_kxy_or_mode_vs_time_graphkit(options)
         | 
| 2028 2027 | 
             
            	end
         | 
| 2029 2028 |  | 
| 2030 | 
            -
            	def  | 
| 2029 | 
            +
            	def es_heat_flux_by_kxy_or_mode_vs_time_graphkit(options={})
         | 
| 2031 2030 | 
             
            		case options[:command]
         | 
| 2032 2031 | 
             
            		when :help
         | 
| 2033 | 
            -
            			return  "' | 
| 2032 | 
            +
            			return  "'es_heat_flux_by_ky_vs_time' or 'es_heat_flux_by_kx_vs_time': Electrostatic Heat Flux vs Time for a given kx or ky, integrated over the other direction"
         | 
| 2034 2033 | 
             
            		when :options
         | 
| 2035 2034 | 
             
            			return  [:ky, :ky_index, :kx, :kx_index, :species_index]
         | 
| 2036 2035 | 
             
            		else
         | 
| @@ -2038,7 +2037,7 @@ module GraphKits | |
| 2038 2037 | 
             
            			nt_options = options.dup # 'no time' options
         | 
| 2039 2038 | 
             
            			#nt_options.delete(:t_index) if nt_options[:t_index]
         | 
| 2040 2039 | 
             
            			#nt_options.delete(:frame_index) if nt_options[:frame_index]
         | 
| 2041 | 
            -
            			phiax = axiskit(" | 
| 2040 | 
            +
            			phiax = axiskit("es_heat_flux_by_#{kxy}_over_time", nt_options)	
         | 
| 2042 2041 | 
             
            			kit = GraphKit.autocreate({x: axiskit('t', options), y: phiax})
         | 
| 2043 2042 | 
             
            			kit.data[0].title = "ES Heat Flux: #@run_name #{kxy} = #{options[kxy]}"	
         | 
| 2044 2043 | 
             
            			kit.log_axis = 'y'
         | 
| @@ -2081,7 +2080,6 @@ module GraphKits | |
| 2081 2080 | 
             
            			kit = GraphKit.autocreate({x: axiskit('t', options), y: phiax})
         | 
| 2082 2081 | 
             
            			kit.data[0].title = "Phi^2 total: #{kxy} = #{options[kxy]}"	
         | 
| 2083 2082 | 
             
            			if options[:t_index]
         | 
| 2084 | 
            -
            # 				p 'hello'
         | 
| 2085 2083 | 
             
            				array_element = options[:t_index_window] ? options[:t_index] - options[:t_index_window][0] : options[:t_index] - 1
         | 
| 2086 2084 | 
             
            # 				p phiax.data.size, array_element
         | 
| 2087 2085 | 
             
            # 				p options[:t_index], options[:t_index_window]
         | 
| @@ -2133,7 +2131,6 @@ module GraphKits | |
| 2133 2131 | 
             
            			kit = GraphKit.autocreate({x: axiskit('t', options), y: tparax})
         | 
| 2134 2132 | 
             
            			kit.data[0].title = "Tpar^2 total: #{kxy} = #{options[kxy]}"	
         | 
| 2135 2133 | 
             
            			if options[:t_index]
         | 
| 2136 | 
            -
            # 				p 'hello'
         | 
| 2137 2134 | 
             
            				array_element = options[:t_index_window] ? options[:t_index] - options[:t_index_window][0] : options[:t_index] - 1
         | 
| 2138 2135 | 
             
            # 				p tparax.data.size, array_element
         | 
| 2139 2136 | 
             
            # 				p options[:t_index], options[:t_index_window]
         | 
| @@ -2175,7 +2172,6 @@ module GraphKits | |
| 2175 2172 | 
             
            			kit = GraphKit.autocreate({x: axiskit('t', options), y: tperpax})
         | 
| 2176 2173 | 
             
            			kit.data[0].title = "Tperp^2 total: #{kxy} = #{options[kxy]}"	
         | 
| 2177 2174 | 
             
            			if options[:t_index]
         | 
| 2178 | 
            -
            # 				p 'hello'
         | 
| 2179 2175 | 
             
            				array_element = options[:t_index_window] ? options[:t_index] - options[:t_index_window][0] : options[:t_index] - 1
         | 
| 2180 2176 | 
             
            # 				p tparax.data.size, array_element
         | 
| 2181 2177 | 
             
            # 				p options[:t_index], options[:t_index_window]
         | 
    
        data/lib/gs2crmod/gs2.rb
    CHANGED
    
    | @@ -1273,9 +1273,9 @@ folder = File.dirname(File.expand_path(__FILE__)) # i.e. the directory this file | |
| 1273 1273 | 
             
                    [(kit = hflux_tot_vs_time_graphkit; kit.file_name = "hflux_tot_vs_time.eps"; kit), "Total heat flux $Q_{tot}$ as a function of time."],
         | 
| 1274 1274 | 
             
                    [(kit = es_heat_flux_vs_time_graphkit(species_index:1); kit.file_name = "es_heat_1_vs_time.eps"; kit), "Heat flux of species 1 versus time."],
         | 
| 1275 1275 | 
             
                    if @nspec > 1 then [(kit = es_heat_flux_vs_time_graphkit(species_index:2); kit.file_name = "es_heat_2_vs_time.eps"; kit), "Heat flux of species 2 versus time."] end,
         | 
| 1276 | 
            -
                    [(kit =  | 
| 1277 | 
            -
                    if @nspec > 1 then [(kit =  | 
| 1278 | 
            -
                    [(kit =  | 
| 1276 | 
            +
                    [(kit = es_heat_flux_vs_ky_graphkit(species_index:1); kit.gp.logscale="y" ; kit.file_name = "es_heat_1_vs_ky.eps"; kit), "Heat flux of species 1 as a function of $k_y$."],
         | 
| 1277 | 
            +
                    if @nspec > 1 then [(kit = es_heat_flux_vs_ky_graphkit(species_index:2); kit.gp.logscale="y" ; kit.file_name = "es_heat_2_vs_ky.eps"; kit), "Heat flux of species 2 as a function of $k_y$."] end,
         | 
| 1278 | 
            +
                    [(kit = es_heat_flux_vs_ky_vs_kx_graphkit; kit.gp.view="map" ; kit.file_name = "es_heat_vs_ky_vs_kx.eps"; kit), "2D total heat flux spectrum as a function of $k_x$ and $k_y$."],
         | 
| 1279 1279 | 
             
                    [(kit = phi_real_space_graphkit(n0:1, thetamin:get_list_of(:theta).length/2, thetamax:get_list_of(:theta).length/2, gs2_coordinate_factor:1.0); kit.gp.view="map" ; kit.file_name = "phi_real_space.eps"; kit), "Potential fluctuations at the final time step vs GS2 $x$ and $y$ at the outboard midplane."],
         | 
| 1280 1280 | 
             
                    [(kit = density_real_space_graphkit(n0:1, species_index:1, thetamin:get_list_of(:theta).length/2, thetamax:get_list_of(:theta).length/2, gs2_coordinate_factor:1.0); kit.gp.view="map" ; kit.file_name = "density_real_space.eps"; kit), "Density fluctuations for species 1 at the final time step vs GS2 $x$ and $y$ at the outboard midplane."],
         | 
| 1281 1281 | 
             
                    if @nspec > 1 then [(kit = density_real_space_graphkit(n0:1, species_index:2, thetamin:get_list_of(:theta).length/2, thetamax:get_list_of(:theta).length/2, gs2_coordinate_factor:1.0); kit.gp.view="map" ; kit.file_name = "density_real_space.eps"; kit), "Density fluctuations for species 2 at the final time step vs GS2 $x$ and $y$ at the outboard midplane."] end,
         | 
    
        data/lib/gs2crmod/gsl_data.rb
    CHANGED
    
    | @@ -304,7 +304,7 @@ module GSLVectors | |
| 304 304 | 
             
                  return fix_norm(dphi/gsl_vector('dt'), 0, options)
         | 
| 305 305 | 
             
                end
         | 
| 306 306 |  | 
| 307 | 
            -
            # <MJL edits on 2013-09-19>
         | 
| 307 | 
            +
              # <MJL edits on 2013-09-19>
         | 
| 308 308 | 
             
                              # The real frequency of the fluctuations, read from the .out file, indexed by time and normalised to vth_1/a.
         | 
| 309 309 | 
             
                              # :ky_index or :kx_index must be specified in options.
         | 
| 310 310 |  | 
| @@ -354,7 +354,7 @@ module GSLVectors | |
| 354 354 | 
             
                                 raise "No real frequencies found in the .out file for the desired k" if (omega_reals.size==0)
         | 
| 355 355 | 
             
                                 GSL::Vector.alloc(omega_reals)
         | 
| 356 356 | 
             
                            end
         | 
| 357 | 
            -
            # </MJL>
         | 
| 357 | 
            +
              # </MJL>
         | 
| 358 358 |  | 
| 359 359 |  | 
| 360 360 | 
             
                # The size of each time step,  indexed by time, normalised to a/v_th1.
         | 
| @@ -412,16 +412,16 @@ module GSLVectors | |
| 412 412 | 
             
                  return GSL::Vector.alloc(gsl_vector('ky').to_a.map{|ky| frequency_at_ky_at_kx[ky].values[options[:kx_index]-1]})
         | 
| 413 413 | 
             
              end
         | 
| 414 414 |  | 
| 415 | 
            -
              def  | 
| 415 | 
            +
              def es_heat_flux_by_kx_over_time_gsl_vector(options)
         | 
| 416 416 | 
             
                options[:direction] = :kx
         | 
| 417 | 
            -
                 | 
| 417 | 
            +
                es_heat_flux_by_kxy_over_time_gsl_vector(options)
         | 
| 418 418 | 
             
              end
         | 
| 419 | 
            -
              def  | 
| 419 | 
            +
              def es_heat_flux_by_ky_over_time_gsl_vector(options)
         | 
| 420 420 | 
             
                options[:direction] = :ky
         | 
| 421 | 
            -
                 | 
| 421 | 
            +
                es_heat_flux_by_kxy_over_time_gsl_vector(options)
         | 
| 422 422 | 
             
              end
         | 
| 423 423 |  | 
| 424 | 
            -
              def  | 
| 424 | 
            +
              def es_heat_flux_by_kxy_over_time_gsl_vector(options)
         | 
| 425 425 | 
             
                Dir.chdir(@directory) do
         | 
| 426 426 | 
             
                  kxy = options[:direction]
         | 
| 427 427 | 
             
                  #kxy_index = kxy + :_index
         | 
| @@ -430,7 +430,7 @@ module GSLVectors | |
| 430 430 | 
             
                  if kxy==:ky
         | 
| 431 431 | 
             
                    lkx = list(:kx)
         | 
| 432 432 | 
             
                    es_heat_av = (lkx.keys.map do |kx_index|
         | 
| 433 | 
            -
                      es_heat =  netcdf_file.var(' | 
| 433 | 
            +
                      es_heat =  netcdf_file.var('es_heat_flux_by_mode').get({'start' => [kx_index-1,options[:ky_index]-1,options[:species_index]-1, 0], 'end' => [kx_index-1,options[:ky_index]-1,options[:species_index]-1, -1]})
         | 
| 434 434 | 
             
                      #ep phi.shape
         | 
| 435 435 | 
             
                      es_heat.reshape(*es_heat.shape.values_at(3))
         | 
| 436 436 | 
             
                    end).sum / lkx.size
         | 
| @@ -438,7 +438,7 @@ module GSLVectors | |
| 438 438 | 
             
                  else
         | 
| 439 439 | 
             
                    lky = list(:ky)
         | 
| 440 440 | 
             
                    es_heat_av = (lky.keys.map do |ky_index|
         | 
| 441 | 
            -
                      es_heat =  netcdf_file.var(' | 
| 441 | 
            +
                      es_heat =  netcdf_file.var('es_heat_flux_by_mode').get({'start' => [options[:kx_index]-1,ky_index-1,options[:species_index]-1, 0], 'end' => [options[:kx_index]-1,ky_index-1,options[:species_index]-1, -1]})
         | 
| 442 442 | 
             
                      #ep phi.shape
         | 
| 443 443 | 
             
                      es_heat.reshape(*es_heat.shape.values_at(3))
         | 
| 444 444 | 
             
                    end).sum / lky.size
         | 
| @@ -447,25 +447,25 @@ module GSLVectors | |
| 447 447 |  | 
| 448 448 | 
             
                end
         | 
| 449 449 | 
             
              end
         | 
| 450 | 
            -
              private : | 
| 450 | 
            +
              private :es_heat_flux_by_kxy_over_time_gsl_vector
         | 
| 451 451 |  | 
| 452 | 
            -
              def  | 
| 452 | 
            +
              def es_heat_flux_over_kx_gsl_vector(options)
         | 
| 453 453 | 
             
                options[:direction] = :kx
         | 
| 454 | 
            -
                 | 
| 454 | 
            +
                es_heat_flux_over_kxy_gsl_vector(options)
         | 
| 455 455 | 
             
              end
         | 
| 456 | 
            -
              def  | 
| 456 | 
            +
              def es_heat_flux_over_ky_gsl_vector(options)
         | 
| 457 457 | 
             
                options[:direction] = :ky
         | 
| 458 | 
            -
                 | 
| 458 | 
            +
                es_heat_flux_over_kxy_gsl_vector(options)
         | 
| 459 459 | 
             
              end
         | 
| 460 460 |  | 
| 461 461 | 
             
              #This function will output the heat flux as a function of kx or ky.
         | 
| 462 462 | 
             
              #Default behaviour will be to average the heat flux over the time domain.
         | 
| 463 | 
            -
              def  | 
| 463 | 
            +
              def es_heat_flux_over_kxy_gsl_vector(options)
         | 
| 464 464 | 
             
                Dir.chdir(@directory) do
         | 
| 465 465 | 
             
                  kxy = options[:direction]
         | 
| 466 466 | 
             
                  raise "Please provide species_index " unless options[:species_index]
         | 
| 467 467 | 
             
                  if kxy==:ky
         | 
| 468 | 
            -
                    es_heat = (netcdf_file.var(' | 
| 468 | 
            +
                    es_heat = (netcdf_file.var('es_heat_flux_by_mode').get({'start' => [0,0,options[:species_index]-1, 0], 'end' => [-1,-1,options[:species_index]-1, -1]})) #index = [kx,ky,spec,t]
         | 
| 469 469 | 
             
                    #Need to average over time and sum over kx
         | 
| 470 470 | 
             
                    shape = es_heat.shape
         | 
| 471 471 | 
             
                    es_heat_av = []; temp = [];
         | 
| @@ -477,7 +477,7 @@ module GSLVectors | |
| 477 477 | 
             
                    end
         | 
| 478 478 | 
             
                    return es_heat_av.to_gslv
         | 
| 479 479 | 
             
                  else
         | 
| 480 | 
            -
                    es_heat = (netcdf_file.var(' | 
| 480 | 
            +
                    es_heat = (netcdf_file.var('es_heat_flux_by_mode').get({'start' => [0,0,options[:species_index]-1, 0], 'end' => [-1,-1,options[:species_index]-1, -1]})) #index = [kx,ky,spec,t]
         | 
| 481 481 | 
             
                    shape = es_heat.shape
         | 
| 482 482 | 
             
                    es_heat_av = []; temp = [];
         | 
| 483 483 | 
             
                    for ix in 0...shape[0]
         | 
| @@ -1039,12 +1039,11 @@ module GSLVectors | |
| 1039 1039 | 
             
                #This is v_ZF = kxfac*IFT(i k_x phi_imag), where kxfac = (qinp/rhoc)*grho(rhoc).
         | 
| 1040 1040 | 
             
                def zf_velocity_over_x_gsl_vector(options)
         | 
| 1041 1041 | 
             
                  Dir.chdir(@directory) do
         | 
| 1042 | 
            -
                    raise CRFatal.new("Need to specify a theta_index.") unless options[:theta_index]
         | 
| 1043 1042 | 
             
                    raise CRFatal.new("Need either qinp or pk and epsl specified in order to calculate kxfac.
         | 
| 1044 1043 | 
             
                                      If using numerical equil use the option :kxfac to override calculation.") unless @qinp or (@pk and @epsl or options[:kxfac])
         | 
| 1045 1044 |  | 
| 1046 1045 | 
             
                    kx = gsl_vector(:kx).to_box_order
         | 
| 1047 | 
            -
                    grho = gsl_vector('grho')[ | 
| 1046 | 
            +
                    grho = gsl_vector('grho')[get_list_of(:theta).length/2]
         | 
| 1048 1047 |  | 
| 1049 1048 | 
             
                    phi = GSL::Vector.alloc(kx.size)
         | 
| 1050 1049 | 
             
                    for it in 0...gsl_vector(:t).size
         | 
| @@ -1172,7 +1171,7 @@ module GSLVectorComplexes | |
| 1172 1171 | 
             
                Dir.chdir(@directory) do
         | 
| 1173 1172 | 
             
                    raise CRFatal.new("write_eigenfunc is not enabled so this function won't work") unless @write_eigenfunc
         | 
| 1174 1173 | 
             
                    options.convert_to_index(self, :t)
         | 
| 1175 | 
            -
                    a = netcdf_file.var(' | 
| 1174 | 
            +
                    a = netcdf_file.var('phi_igomega_by_mode').get({
         | 
| 1176 1175 | 
             
                      'start' => [0,0,0, options[:t_index] - 1],
         | 
| 1177 1176 | 
             
                      'end' => [-1,-1,0, options[:t_index] - 1]
         | 
| 1178 1177 | 
             
                    })
         | 
| @@ -1217,7 +1216,7 @@ module GSLMatrices | |
| 1217 1216 | 
             
                  options.convert_to_index(:t) if options[:t] or options[:t_element]
         | 
| 1218 1217 | 
             
                  options[:t_index] ||= list(:t).keys.max
         | 
| 1219 1218 | 
             
                  #es_heat_by_k index order (in Fortran) is kx, ky, t
         | 
| 1220 | 
            -
                  es_heat_narray = netcdf_file.var(" | 
| 1219 | 
            +
                  es_heat_narray = netcdf_file.var("es_heat_flux_by_mode").get('start' => [0, 0, 0, options[:t_index] - 1], 'end' => [-1, -1, 0, options[:t_index] - 1])
         | 
| 1221 1220 | 
             
                  es_heat_narray.reshape!(*es_heat_narray.shape.slice(0..1))
         | 
| 1222 1221 |  | 
| 1223 1222 | 
             
                  gm =  es_heat_narray.to_gm.move_cols_from_box_order
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,8 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: gs2crmod
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.12.0
         | 
| 5 | 
            +
              prerelease: 
         | 
| 5 6 | 
             
            platform: ruby
         | 
| 6 7 | 
             
            authors:
         | 
| 7 8 | 
             
            - Edmund Highcock
         | 
| @@ -9,53 +10,60 @@ authors: | |
| 9 10 | 
             
            autorequire: 
         | 
| 10 11 | 
             
            bindir: bin
         | 
| 11 12 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2015-07- | 
| 13 | 
            +
            date: 2015-07-28 00:00:00.000000000 Z
         | 
| 13 14 | 
             
            dependencies:
         | 
| 14 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 16 | 
             
              name: coderunner
         | 
| 16 17 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 18 | 
            +
                none: false
         | 
| 17 19 | 
             
                requirements:
         | 
| 18 | 
            -
                - -  | 
| 20 | 
            +
                - - ! '>='
         | 
| 19 21 | 
             
                  - !ruby/object:Gem::Version
         | 
| 20 22 | 
             
                    version: 0.15.5
         | 
| 21 23 | 
             
              type: :runtime
         | 
| 22 24 | 
             
              prerelease: false
         | 
| 23 25 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 26 | 
            +
                none: false
         | 
| 24 27 | 
             
                requirements:
         | 
| 25 | 
            -
                - -  | 
| 28 | 
            +
                - - ! '>='
         | 
| 26 29 | 
             
                  - !ruby/object:Gem::Version
         | 
| 27 30 | 
             
                    version: 0.15.5
         | 
| 28 31 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 29 32 | 
             
              name: rubyhacks
         | 
| 30 33 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 34 | 
            +
                none: false
         | 
| 31 35 | 
             
                requirements:
         | 
| 32 | 
            -
                - -  | 
| 36 | 
            +
                - - ! '>='
         | 
| 33 37 | 
             
                  - !ruby/object:Gem::Version
         | 
| 34 38 | 
             
                    version: 0.1.2
         | 
| 35 39 | 
             
              type: :runtime
         | 
| 36 40 | 
             
              prerelease: false
         | 
| 37 41 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 42 | 
            +
                none: false
         | 
| 38 43 | 
             
                requirements:
         | 
| 39 | 
            -
                - -  | 
| 44 | 
            +
                - - ! '>='
         | 
| 40 45 | 
             
                  - !ruby/object:Gem::Version
         | 
| 41 46 | 
             
                    version: 0.1.2
         | 
| 42 47 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 43 48 | 
             
              name: ruby-netcdf
         | 
| 44 49 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 50 | 
            +
                none: false
         | 
| 45 51 | 
             
                requirements:
         | 
| 46 | 
            -
                - -  | 
| 52 | 
            +
                - - ! '>='
         | 
| 47 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 48 54 | 
             
                    version: 0.7.1
         | 
| 49 55 | 
             
              type: :runtime
         | 
| 50 56 | 
             
              prerelease: false
         | 
| 51 57 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                none: false
         | 
| 52 59 | 
             
                requirements:
         | 
| 53 | 
            -
                - -  | 
| 60 | 
            +
                - - ! '>='
         | 
| 54 61 | 
             
                  - !ruby/object:Gem::Version
         | 
| 55 62 | 
             
                    version: 0.7.1
         | 
| 56 63 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 57 64 | 
             
              name: shoulda
         | 
| 58 65 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 66 | 
            +
                none: false
         | 
| 59 67 | 
             
                requirements:
         | 
| 60 68 | 
             
                - - '='
         | 
| 61 69 | 
             
                  - !ruby/object:Gem::Version
         | 
| @@ -63,6 +71,7 @@ dependencies: | |
| 63 71 | 
             
              type: :development
         | 
| 64 72 | 
             
              prerelease: false
         | 
| 65 73 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 74 | 
            +
                none: false
         | 
| 66 75 | 
             
                requirements:
         | 
| 67 76 | 
             
                - - '='
         | 
| 68 77 | 
             
                  - !ruby/object:Gem::Version
         | 
| @@ -70,57 +79,65 @@ dependencies: | |
| 70 79 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 71 80 | 
             
              name: rdoc
         | 
| 72 81 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 82 | 
            +
                none: false
         | 
| 73 83 | 
             
                requirements:
         | 
| 74 | 
            -
                - -  | 
| 84 | 
            +
                - - ~>
         | 
| 75 85 | 
             
                  - !ruby/object:Gem::Version
         | 
| 76 86 | 
             
                    version: '3.12'
         | 
| 77 87 | 
             
              type: :development
         | 
| 78 88 | 
             
              prerelease: false
         | 
| 79 89 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 90 | 
            +
                none: false
         | 
| 80 91 | 
             
                requirements:
         | 
| 81 | 
            -
                - -  | 
| 92 | 
            +
                - - ~>
         | 
| 82 93 | 
             
                  - !ruby/object:Gem::Version
         | 
| 83 94 | 
             
                    version: '3.12'
         | 
| 84 95 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 85 96 | 
             
              name: bundler
         | 
| 86 97 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 98 | 
            +
                none: false
         | 
| 87 99 | 
             
                requirements:
         | 
| 88 | 
            -
                - -  | 
| 100 | 
            +
                - - ! '>'
         | 
| 89 101 | 
             
                  - !ruby/object:Gem::Version
         | 
| 90 102 | 
             
                    version: 1.0.0
         | 
| 91 103 | 
             
              type: :development
         | 
| 92 104 | 
             
              prerelease: false
         | 
| 93 105 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 106 | 
            +
                none: false
         | 
| 94 107 | 
             
                requirements:
         | 
| 95 | 
            -
                - -  | 
| 108 | 
            +
                - - ! '>'
         | 
| 96 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 97 110 | 
             
                    version: 1.0.0
         | 
| 98 111 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 99 112 | 
             
              name: jeweler
         | 
| 100 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 114 | 
            +
                none: false
         | 
| 101 115 | 
             
                requirements:
         | 
| 102 | 
            -
                - -  | 
| 116 | 
            +
                - - ! '>='
         | 
| 103 117 | 
             
                  - !ruby/object:Gem::Version
         | 
| 104 118 | 
             
                    version: 1.8.4
         | 
| 105 119 | 
             
              type: :development
         | 
| 106 120 | 
             
              prerelease: false
         | 
| 107 121 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 122 | 
            +
                none: false
         | 
| 108 123 | 
             
                requirements:
         | 
| 109 | 
            -
                - -  | 
| 124 | 
            +
                - - ! '>='
         | 
| 110 125 | 
             
                  - !ruby/object:Gem::Version
         | 
| 111 126 | 
             
                    version: 1.8.4
         | 
| 112 127 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 113 128 | 
             
              name: minitest
         | 
| 114 129 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 130 | 
            +
                none: false
         | 
| 115 131 | 
             
                requirements:
         | 
| 116 | 
            -
                - -  | 
| 132 | 
            +
                - - ~>
         | 
| 117 133 | 
             
                  - !ruby/object:Gem::Version
         | 
| 118 134 | 
             
                    version: '4'
         | 
| 119 135 | 
             
              type: :development
         | 
| 120 136 | 
             
              prerelease: false
         | 
| 121 137 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 138 | 
            +
                none: false
         | 
| 122 139 | 
             
                requirements:
         | 
| 123 | 
            -
                - -  | 
| 140 | 
            +
                - - ~>
         | 
| 124 141 | 
             
                  - !ruby/object:Gem::Version
         | 
| 125 142 | 
             
                    version: '4'
         | 
| 126 143 | 
             
            description: GS2 is a gyrokinetic flux tube initial value turbulence code which can
         | 
| @@ -136,7 +153,7 @@ extra_rdoc_files: | |
| 136 153 | 
             
            - README.md
         | 
| 137 154 | 
             
            - README.rdoc
         | 
| 138 155 | 
             
            files:
         | 
| 139 | 
            -
            -  | 
| 156 | 
            +
            - .document
         | 
| 140 157 | 
             
            - Gemfile
         | 
| 141 158 | 
             
            - LICENSE.txt
         | 
| 142 159 | 
             
            - README.md
         | 
| @@ -193,25 +210,26 @@ files: | |
| 193 210 | 
             
            homepage: http://gs2crmod.sourceforge.net
         | 
| 194 211 | 
             
            licenses:
         | 
| 195 212 | 
             
            - GSLv3
         | 
| 196 | 
            -
            metadata: {}
         | 
| 197 213 | 
             
            post_install_message: 
         | 
| 198 214 | 
             
            rdoc_options: []
         | 
| 199 215 | 
             
            require_paths:
         | 
| 200 216 | 
             
            - lib
         | 
| 201 217 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 218 | 
            +
              none: false
         | 
| 202 219 | 
             
              requirements:
         | 
| 203 | 
            -
              - -  | 
| 220 | 
            +
              - - ! '>='
         | 
| 204 221 | 
             
                - !ruby/object:Gem::Version
         | 
| 205 222 | 
             
                  version: 1.9.1
         | 
| 206 223 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 224 | 
            +
              none: false
         | 
| 207 225 | 
             
              requirements:
         | 
| 208 | 
            -
              - -  | 
| 226 | 
            +
              - - ! '>='
         | 
| 209 227 | 
             
                - !ruby/object:Gem::Version
         | 
| 210 228 | 
             
                  version: '0'
         | 
| 211 229 | 
             
            requirements: []
         | 
| 212 230 | 
             
            rubyforge_project: 
         | 
| 213 | 
            -
            rubygems_version:  | 
| 231 | 
            +
            rubygems_version: 1.8.23
         | 
| 214 232 | 
             
            signing_key: 
         | 
| 215 | 
            -
            specification_version:  | 
| 233 | 
            +
            specification_version: 3
         | 
| 216 234 | 
             
            summary: Module to allow CodeRunner to run and analyse the GS2 and AstroGK codes.
         | 
| 217 235 | 
             
            test_files: []
         | 
    
        checksums.yaml
    DELETED
    
    | @@ -1,7 +0,0 @@ | |
| 1 | 
            -
            ---
         | 
| 2 | 
            -
            SHA1:
         | 
| 3 | 
            -
              metadata.gz: c7e94515190d1b62a7db69e4c7070e76565330ff
         | 
| 4 | 
            -
              data.tar.gz: 58c57e1fee6e4f6c6fc2b00bfa1fdae0c000958d
         | 
| 5 | 
            -
            SHA512:
         | 
| 6 | 
            -
              metadata.gz: 5c6b3065b8aadf887e06caabc6282f7ee61a44adf933b56a26c833cb354f3b422aba08c2001e275ef1a33b6cd121c53bad44c335a10446fcf99592ace9be8f66
         | 
| 7 | 
            -
              data.tar.gz: 77daa27fae195f0471cd329539b55ba750fb03e7b86a74fc1bcae348da12f8971b6921f80f8fc8fe7f7f696a12cf0a954267b480040045658e48d0cecaa9fef5
         |