US-EPA-CAMD / easey-ui

Project Management repo for EPA Clean Air Markets Division (CAMD) Business Suite of applications
MIT License
0 stars 0 forks source link

Incorrect NOXR Formula Code in Hourly NOx Rate CEMS #6040

Open esaber76 opened 5 months ago

esaber76 commented 5 months ago

The NOXR Formula Code column displays the NOx Mass Formula Code in both the Hourly NOx Rate CEMS View and the download.

Background Information:

  1. The Emission (EM) Views are defined using the camdaux DATASET, DATATABLE and DATACOLUMN tables.
  2. The DATASET table GROUP_CD column that indicates an EM View dataset when the value equals "EMVIEW". Each "EMVIEW" represents a single EM view.
  3. The DATATABLE table is the DATASET table's child and only contains one row for each "EMVIEW" dataset.
  4. The DATACOLUMN table is the DATATABLE table's child and contains a row for each column in each data table.
  5. The DATACOLUMN table contains an ALIAS column that indicates the column from which to pull data in the source data.

SQL Showing Problem in DATACOLUMN Table

select  dst.Group_Cd,
        dst.Dataset_Cd,
        --dst.Display_Name,
        --tbl.Display_Name,
        col.Column_Order,
        col.Name,
        case 
            when col.Alias = 'noxFormulaCode' 
            then 'YES'
            else ''
        end as Flagged,
        col.Alias,
        col.Display_Name
        --, col.*
  from  camdaux.DATASET dst
        join camdaux.DATATABLE tbl on tbl.Dataset_Cd = dst.Dataset_Cd
        join camdaux.DATACOLUMN col on col.DataTable_Id = tbl.DataTable_Id
 where  dst.Group_Cd = 'EMVIEW'
   and  dst.Dataset_Cd = 'NOXRATECEMS'
annalbrecht commented 4 months ago

Emissions data-- Hourly NOx Rate CEMS View and the download need to be corrected to show the correct code. It should be showing the NOXR Formula Code.

djw4erg commented 1 month ago

ECMPS Dev Application https://ecmps-dev.app.cloud.gov/emissions

renaemyers commented 1 month ago

Per Dwayne, the steps to fix this and verify it are:

  1. Check the current JSON produced by the Emission View endpoint.
    1. https://api.epa.gov/easey/dev/emissions-mgmt/swagger/#/
    2. Click the Authorize button and enter a valid API Key (PXPWlQGB3wKXotkWN1PbSwbSoM7CoWW0ZMPWYtfc ) and click the Authorize button.
    3. Navigate to the Emissions Views section and open the “GET: /emissions-mgmt/emissions/views/{viewCode}” endpoint.
    4. Click the Try It Out button.
    5. Entering the following for my example.
      1. viewCode: “NOXRATECEMS”
      2. monitorPlanId: “MDC-9FF127451AE0415ABF9BBF6A0B036A1A”
        1. For ORIS 10 (Green County), Locations CS0EBN, 1, 2
      3. stackPipeIds: “CS0EBN”
      4. reportingPeriod: “2022 Q1”
      5. attachFile: true
        1. Will produce the JSON for the emission view.
    6. Click the Execute button.
    7. Click the Donwload File button to get the response JSON. i. You many need a program to reformat the JSON to make it readable.
  2. Check the current Emissions page.
    1. https://ecmps-dev.app.cloud.gov/emissions
    2. Do not log in.
    3. Expand “Greene County” (ORIS 10) and click the Open link for Configuration “1, 2, CS0EBN”.
    4. Click on the “Greene County 1, 2, CS0EBN” tab that appears, which should open selection information.
    5. Update the following:
      1. Reporting Period(s): “2022 Q1”
      2. Locations: “CS0EBN”
      3. View Template: “Hourly NOx Rate CEMS View”
    6. Click “Apply Filter(s)”, which should display a grid.
    7. Check the “NOXR Formula Code” and “NOX Formula Code” columns.
      1. They should initially and erroneously have the same value (F-24A) for each row.
  3. The Change: On the Dev database, update ALIAS to “noxrFormulaCode” for the camdaux.DATACOLUMN row where the parent DATASET.DATASET_CD equals “NOXRATECEMS” and the DATACOLUMN.NAME equals “nox_rate_formula_cd”.
  4. Check the JSON again using the steps under step 1.
    1. The JSON should now contain a new “noxrEquationCode” elements with the value “F-6”.
  5. Check the Emissions page using the steps under step 2.
    1. The “NOXR Formula Code” column should now have the value “F-6”.
renaemyers commented 1 month ago

I made the database change on dev; here are screenshots of the JSON and emissions pages showing the changes.

image

image

esaber76 commented 3 weeks ago

Confirmed the Hourly NOx Rate CEMS View contains the correct formula code for the NOXR Formula Code column. Check global view and download and workspace view and download.

ibarra-michelle commented 1 week ago

Verified in the test env: the data is correct in the UI and csv download for the following two configurations (matching NOXR formula codes in ECMPS 2.0 test and FACT):

  1. ORIS 298, Location LM1 for the reporting period 2023 Q1

Image

  1. ORIS 470, Location 1 for the reporting period 2022 Q1 Image