Module: Cdss::GroundWater
Instance Method Summary collapse
-
#get_geophysical_log_picks(wellid:) ⇒ Array<LogPick>
Fetches geophysical log picks for a specific well.
-
#get_geophysical_log_wells(county: nil, designated_basin: nil, division: nil, management_district: nil, water_district: nil, wellid: nil) ⇒ Array<Well>
Fetches groundwater geophysical log wells based on filters.
-
#get_water_level_wells(county: nil, designated_basin: nil, division: nil, management_district: nil, water_district: nil, wellid: nil) ⇒ Array<Well>
Fetches groundwater water level wells based on filters.
-
#get_well_measurements(wellid:, start_date: nil, end_date: nil) ⇒ Array<Reading>
Fetches water level measurements for a specific well.
Methods included from Utils
#batch_dates, #build_query, #fetch_paginated_data, #format_date, #format_query_param, #parse_timestamp, #safe_float, #safe_integer
Instance Method Details
#get_geophysical_log_picks(wellid:) ⇒ Array<LogPick>
Fetches geophysical log picks for a specific well
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/cdss/ground_water.rb', line 97 def get_geophysical_log_picks(wellid:) raise ArgumentError, "wellid is required" if wellid.nil? query = { format: "json", dateFormat: "spaceSepToSeconds", wellId: wellid } fetch_paginated_data( endpoint: "/groundwater/geophysicallogs/geoplogpicks/", query: query ) { |data| Parser.parse_log_picks(data) } end |
#get_geophysical_log_wells(county: nil, designated_basin: nil, division: nil, management_district: nil, water_district: nil, wellid: nil) ⇒ Array<Well>
Fetches groundwater geophysical log wells based on filters
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cdss/ground_water.rb', line 71 def get_geophysical_log_wells(county: nil, designated_basin: nil, division: nil, management_district: nil, water_district: nil, wellid: nil) query = { format: "json", dateFormat: "spaceSepToSeconds", county: county&.upcase&.gsub(" ", "+"), designatedBasin: designated_basin&.upcase&.gsub(" ", "+"), division: division, managementDistrict: management_district&.upcase&.gsub(" ", "+"), waterDistrict: water_district, wellId: wellid } fetch_paginated_data( endpoint: "/groundwater/geophysicallogs/wells/", query: query ) { |data| Parser.parse_geophysical_wells(data) } end |
#get_water_level_wells(county: nil, designated_basin: nil, division: nil, management_district: nil, water_district: nil, wellid: nil) ⇒ Array<Well>
Fetches groundwater water level wells based on filters.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cdss/ground_water.rb', line 18 def get_water_level_wells(county: nil, designated_basin: nil, division: nil, management_district: nil, water_district: nil, wellid: nil) query = { format: "json", dateFormat: "spaceSepToSeconds", county: county&.upcase&.gsub(" ", "+"), designatedBasin: designated_basin&.upcase&.gsub(" ", "+"), division: division, managementDistrict: management_district&.upcase&.gsub(" ", "+"), waterDistrict: water_district, wellId: wellid } fetch_paginated_data( endpoint: "/groundwater/waterlevels/wells/", query: query ) { |data| Parser.parse_wells(data) } end |
#get_well_measurements(wellid:, start_date: nil, end_date: nil) ⇒ Array<Reading>
Fetches water level measurements for a specific well
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cdss/ground_water.rb', line 45 def get_well_measurements(wellid:, start_date: nil, end_date: nil) query = { format: "json", dateFormat: "spaceSepToSeconds", wellId: wellid, "min-measurementDate": start_date&.strftime("%m-%d-%Y"), "max-measurementDate": end_date&.strftime("%m-%d-%Y") } fetch_paginated_data( endpoint: "/groundwater/waterlevels/wellmeasurements/", query: query ) { |data| Parser.parse_well_measurements(data) } end |