Code Monkey home page Code Monkey logo

filesdssat's Introduction

FilesDSSAT

This was an exercise I made to extract data from an excel/csv file and organize it into a .CST file (DSSAT specific format). It can also extract data from a .CST file to a pandas dataframe.

Overview

The source file contains field data from cassava experiments.

The .CST is where we inform real data for DSSAT. With a .CST we are able to compare this results against simulations. That is used for model calibration and validation purposes.

How to use

From excel/csv to .CST

from main import sourceFile, targetFile

# Create the source instance
source = sourceFile('excelFileDirectory')

# Choose the variables to extract and the cultivar name
source.choose_variables(var_list = ["MASSA SECA DE RAÍZ", 
                                    "MASSA SECA DE FOLHAS", 
                                    "MASSA SECA DE CAULE", 
                                    "MASSA SECA TOTAL", 
                                    "IAF"],
                        cultivar = "EUCALIPTO")

# Create the target instance
target = targetFile(filename = "EBCZ1802.CST")  # the filename can be of a nonexistent one

# Set the var list with the same sequence as the 'source' above 
target.set_variables(var_list = ["HWAD", "LWAD", "SWAD", "TWAD", "LAID"])

# and Go!
source.write_file(target)

Of course, the source file must follow the same structure as the exampleSource.xlsx.


From .CST to pd.DataFrame

# That time, must be an existent one
target = targetFile("yourFile.CST")

# and Go!
df = target.read_file()

Further Reading

Working with dynamic crop models

The DSSAT crop modeling ecosystem

filesdssat's People

Contributors

fabioseixas avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.