Uploaded image for project: 'Cover Crop'
  1. Cover Crop
  2. CCROP-31

Create a python script that parses DSSAT output files

XMLWordPrintableJSON

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Normal Normal
    • 0.1
    • None
    • None
    • None

      The OUT files produced by the DSSAT model need parsed and formatted so they can be easily plotted in the web application, similar to the attached excel spreadsheet. In this task, we want to write a python script that can take the OUT files and create a JSON representation of the data we intend to plot only.  The web application will be responsible for taking the JSON data and plotting it.  An example JSON return for 3 values might be:

      [

      {

      "year" : "2011-07-18",

      "GWAD" : "0",

      "units" : "lb/acre"

      },

      {

      "year" : "2011-07-19",

      "GWAD" : "184.68",

      "units" : "lb/acre"

      },

      {

      "year" : "2011-07-20",

      "GWAD" : "355.09",

      "units" : "lb/acre"

      }

      ]

       

      Outputs required for beta:

      TWAD: total plant weight for wheat (cover crop) in the PlantGro.OUT

      NUAD: N uptake for wheat (cover crop) in the PlantN.OUT

      NLCC: N leached in the SoilNi.OUT

      NIAD: total soil inorganic N in the SoilNi.OUT

      C:N Ratio 

      Regard the C:N ratio, there is no variable for that. However, we can calculate from some variables in other output files. You can have the ratio by dividing the SCS20D (Organic C (SOM) in top 20 cm (kg/ha)) in the SOMLITC.OUT by the SNS20D (Organic N in top 20 cm of soil (kg/ha)) in the SOMLITN.OUT. This ratio is only for the soil profile depth of 0-20cm. It was a value of 11-12 in my case and it can differ since it largely depends on the soil series. If we want to calculate the ratio for the entire soil profile, then we can use SCTD (total soil organic carbon) and SNTD (total soil organic N) in the SoilOrg.OUT instead of the SCS20D and SNS20D, respectively. But just use the first since I believe the top layer soil’s information regarding the C:N ratio is more important. If anyone has any other comments about calculating the C:N ratio, please share your thoughts with us.  

          1. ComparisonFigures.xlsx
            1018 kB
          2. PlantGro_CC.OUT
            310 kB
          3. PlantGro.OUT.txt
            193 kB
          4. PlantN.OUT
            69 kB
          5. SoilNi.OUT
            391 kB
          6. SOMLITC.OUT
            705 kB
          7. SOMLITN.OUT
            634 kB
          8. VARIABLE.LIST
            32 kB

              ahchang6 Alvin Chang
              cnavarro Christopher Navarro
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: