Class: VORuby::Services::Gestalt::FootPrintService
- Defined in:
- lib/voruby/services/gestalt/footprint.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
Class Method Summary collapse
- .from_wsdl(wsdl = 'http://nvogre.phyast.pitt.edu:8080/axis2/services/GestaltService?wsdl', debug = false) ⇒ Object
- .plot_limits(ra, dec, radius, buffer = 1.0) ⇒ Object
Instance Method Summary collapse
- #deleteAllTables(map_names) ⇒ Object
- #deleteTables(map_name) ⇒ Object
-
#initialize(driver, debug = false) ⇒ FootPrintService
constructor
A new instance of FootPrintService.
- #makeCircleMap(ra, dec, radius, multiple_tables = false) ⇒ Object
- #makePlot(map_names, ramin, ramax, decmin, decmax, fill = false, color = 1) ⇒ Object
Constructor Details
#initialize(driver, debug = false) ⇒ FootPrintService
Returns a new instance of FootPrintService.
10 11 12 13 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 10 def initialize(driver, debug=false) @driver = driver @driver.wiredump_dev = $stderr if debug end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
8 9 10 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 8 def driver @driver end |
Class Method Details
.from_wsdl(wsdl = 'http://nvogre.phyast.pitt.edu:8080/axis2/services/GestaltService?wsdl', debug = false) ⇒ Object
15 16 17 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 15 def self.from_wsdl(wsdl='http://nvogre.phyast.pitt.edu:8080/axis2/services/GestaltService?wsdl', debug=false) return FootPrintService.new(SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver, debug) end |
.plot_limits(ra, dec, radius, buffer = 1.0) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 71 def self.plot_limits(ra, dec, radius, buffer=1.0) ra = [ra] if !ra.is_a?(Array) dec = [dec] if !dec.is_a?(Array) radius = [radius] if !radius.is_a?(Array) min_ra_ind = ra.index(ra.min) min_ra = ra.min - (radius[min_ra_ind] + buffer) max_ra_ind = ra.index(ra.max) max_ra = ra.max + (radius[max_ra_ind] + buffer) min_dec_ind = dec.index(dec.min) min_dec = dec.min - (radius[min_dec_ind] + buffer) max_dec_ind = dec.index(dec.max) max_dec = dec.max + (radius[max_dec_ind] + buffer) return [min_ra, max_ra, min_dec, max_dec] end |
Instance Method Details
#deleteAllTables(map_names) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 45 def deleteAllTables(map_names) responses = [] map_names.each do |map_name| responses.push(self.deleteTables(map_name)) end return responses end |
#deleteTables(map_name) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 36 def deleteTables(map_name) params = {} params['in0'] = map_name # Successful deletion is 0 for some reason... return true if @driver.deleteTables(params.to_soap_map)['deleteTablesReturn'] == '0' return false end |
#makeCircleMap(ra, dec, radius, multiple_tables = false) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 19 def makeCircleMap(ra, dec, radius, multiple_tables=false) ra = [ra] if !ra.is_a?(Array) dec = [dec] if !dec.is_a?(Array) radius = [radius] if !radius.is_a?(Array) params = {} params['in0'] = ra params['in1'] = dec params['in2'] = radius params['in3'] = multiple_tables map_names = @driver.makeCircleMap(params.to_soap_map)['makeCircleMapReturn'] map_names = [map_names] if !map_names.is_a?(Array) return map_names end |
#makePlot(map_names, ramin, ramax, decmin, decmax, fill = false, color = 1) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/voruby/services/gestalt/footprint.rb', line 54 def makePlot(map_names, ramin, ramax, decmin, decmax, fill=false, color=1) params = {} params['in0'] = ramin params['in1'] = ramax params['in2'] = decmin params['in3'] = decmax params['in4'] = fill params['in5'] = color if !map_names.is_a?(Array) params['in6'] = [map_names] else params['in6'] = map_names end return @driver.makePlot(params.to_soap_map)['makePlotReturn'] end |