daquinterop / Py_DSSATTools

A Python library for crop modeling using DSSAT
GNU General Public License v3.0
54 stars 18 forks source link

GWAD data not varying #28

Closed guilherber closed 8 months ago

guilherber commented 9 months ago

Despite having all the valid inputs for soil by layer and climate. The data does not vary. How can I improve the soil? layers = [ SoilLayer(10, {'SLCL': row['SLCL'], 'SLSI': (0.15 * row['SLCL']),'SLOC': rowsolo5['SLOC'], 'SCEC': rowsolo5['SCEC'], 'SBDM': rowsolo5['Bdod'],'SLLL': rowsolo5['PMP'], 'SSAT': rowsolo5['AD'],'SDUL': rowsolo5['CC'] ,'SSKS': rowsolo5['ksat'], 'SRGF': 1}), SoilLayer(20, {'SLCL': row['SLCL'], 'SLSI': (0.15 * row['SLCL']),'SLOC': rowsolo15['SLOC'], 'SCEC': rowsolo15['SCEC'], 'SBDM': rowsolo15['Bdod'],'SLLL': rowsolo15['PMP'], 'SSAT': rowsolo15['AD'], 'SDUL': rowsolo15['CC'],'SSKS': rowsolo5['ksat'], 'SRGF': 1}), SoilLayer(30, {'SLCL': row['SLCL'], 'SLSI': (0.15 * row['SLCL']),'SLOC': rowsolo30['SLOC'], 'SCEC': rowsolo30['SCEC'], 'SBDM': rowsolo30['Bdod'],'SLLL': rowsolo30['PMP'], 'SSAT': rowsolo30['AD'], 'SDUL': rowsolo30['CC'],'SSKS': rowsolo5['ksat'], 'SRGF': 0.42 }), SoilLayer(40, {'SLCL': row['SLCL'], 'SLSI': (0.15 * row['SLCL']), 'SLOC': rowsolo30['SLOC'], 'SCEC': rowsolo30['SCEC'], 'SBDM': rowsolo30['Bdod'], 'SLLL': rowsolo30['PMP'], 'SSAT': rowsolo30['AD'], 'SDUL': rowsolo30['CC'], 'SSKS': rowsolo5['ksat'], 'SRGF': 0.34}), SoilLayer(50, {'SLCL': rowsolo30['Clay'], 'SLSI': rowsolo30['Silt'], 'SLOC': rowsolo30['SLOC'], 'SCEC': rowsolo30['SCEC'], 'SBDM': rowsolo30['Bdod'], 'SLLL': rowsolo30['PMP'], 'SSAT': rowsolo30['AD'], 'SDUL': rowsolo30['CC'], 'SSKS': rowsolo5['ksat'], 'SRGF': 0.23}), SoilLayer(60, {'SLCL': rowsolo60['Clay'], 'SLSI': rowsolo60['Silt'],'SLOC': rowsolo60['SLOC'], 'SCEC': rowsolo60['SCEC'], 'SBDM': rowsolo60['Bdod'],'SLLL': rowsolo60['PMP'], 'SSAT': rowsolo60['AD'], 'SDUL': rowsolo60['CC'],'SSKS': rowsolo5['ksat'], 'SRGF': 0.20}), SoilLayer(70, {'SLCL': rowsolo60['Clay'], 'SLSI': rowsolo60['Silt'], 'SLOC': rowsolo60['SLOC'], 'SCEC': rowsolo60['SCEC'], 'SBDM': rowsolo60['Bdod'], 'SLLL': rowsolo60['PMP'], 'SSAT': rowsolo60['AD'], 'SDUL': rowsolo60['CC'], 'SSKS': rowsolo5['ksat'], 'SRGF': 0.18}), SoilLayer(80, {'SLCL': rowsolo60['Clay'], 'SLSI': rowsolo60['Silt'], 'SLOC': rowsolo60['SLOC'], 'SCEC': rowsolo60['SCEC'], 'SBDM': rowsolo60['Bdod'], 'SLLL': rowsolo60['PMP'], 'SSAT': rowsolo60['AD'], 'SDUL': rowsolo60['CC'], 'SSKS': rowsolo5['ksat'], 'SRGF': 0.16}), SoilLayer(90, {'SLCL': rowsolo60['Clay'], 'SLSI': rowsolo60['Silt'], 'SLOC': rowsolo60['SLOC'], 'SCEC': rowsolo60['SCEC'], 'SBDM': rowsolo60['Bdod'], 'SLLL': rowsolo60['PMP'], 'SSAT': rowsolo60['AD'], 'SDUL': rowsolo60['CC'], 'SSKS': rowsolo5['ksat'], 'SRGF': 0.04}), SoilLayer(100, {'SLCL': rowsolo100['Clay'], 'SLSI': rowsolo100['Silt'],'SLOC': rowsolo100['SLOC'], 'SCEC': rowsolo100['SCEC'], 'SBDM': rowsolo100['Bdod'],'SLLL': rowsolo100['PMP'], 'SSAT': rowsolo100['AD'], 'SDUL': rowsolo100['CC'],'SSKS': rowsolo5['ksat'], 'SRGF': 0.04 }), ]

image

daquinterop commented 8 months ago

Hi. Please provide more context so that I can help you.

daquinterop commented 8 months ago

Can you zip your data and code so that I can take a look? At least part of the data so that I can reproduce what's going on. Otherwise it's really difficult to help you.

guilherber commented 8 months ago

Hello, if you need any additional information, don't hesitate to request, thank you for your attention.

On Wed, Mar 6, 2024 at 4:10 PM Guilherme Landim Santos < @.***> wrote:

Thanks for the reply, file follows

On Wed, Mar 6, 2024 at 11:12 AM Diego Quintero @.***> wrote:

Can you zip your data and code so that I can take a look? At least part of the data so that I can reproduce what's going on. Otherwise it's really difficult to help you.

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1980961570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4EPPPF22UX6MSXQB5NXDTYW4P3PAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQHE3DCNJXGA . You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

daquinterop commented 8 months ago

I'm waiting for you to attach the zip file. I guess you must do it directly in the github issue.

El vie, 8 mar 2024 a las 6:04, Guilherme Landim-Santos (< @.***>) escribió:

Hello, if you need any additional information, don't hesitate to request, thank you for your attention.

On Wed, Mar 6, 2024 at 4:10 PM Guilherme Landim Santos < @.***> wrote:

Thanks for the reply, file follows

On Wed, Mar 6, 2024 at 11:12 AM Diego Quintero @.***> wrote:

Can you zip your data and code so that I can take a look? At least part of the data so that I can reproduce what's going on. Otherwise it's really difficult to help you.

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1980961570>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AO4EPPPF22UX6MSXQB5NXDTYW4P3PAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQHE3DCNJXGA>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985576615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKUW6XT66SRBV4DSNXDYXGSMFAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVGU3TMNRRGU . You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

daquinterop commented 8 months ago

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

daquinterop commented 8 months ago

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) - 1 File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", line 439, in result return self.__get_result() File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", line 391, in __get_result raise self._exception File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", line 216, in run management.write(filename=management_filename) File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", line 325, in write outstr += section_obj.write() + '\n' File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", line 544, in write outstr += rowbased_write( File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", line 1527, in __nonzero__ raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). Process finished with exit code 1 On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < ***@***.***> wrote: > Thank you for your reply. I'm using different soil profiles, as if each > input is a series of data. Is it correct to use this syntax? The climate > didn't vary because it's the same place... I didn't know about this > documentation, thank you very much! > > On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < > ***@***.***> wrote: > >> I just took a look at the DSSAT weather file in the zip you shared. >> Units do not seem to be right for solar radiation, wind speed, and par. I >> recommend you to take a look at the official DSSAT documentation, >> especially Volume 4 which is the CSM documentation. Also, in your >> wheatercode file there is this dados_clima function. I see that the >> function would not return a different Weather object each time it runs. >> Unless you're using different soil profiles, or different planting dates >> you'll get the same results each time you run the model. So, read DSSAT >> documentation to make sure you understand the weather input. Then, debug >> your code to make sure that it is creating different experimental, weather, >> and soil files if you are expecting it to do so. >> >> — >> Reply to this email directly, view it on GitHub >> < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, >> or unsubscribe >> < https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Guilherme LANDIM-SANTOS > > Engenheiro Florestal > Behance > > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA . You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

guilherber commented 8 months ago

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Management__cultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Management__cultivars' and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created. On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero ***@***.***> wrote: > what do you mean by culture? > > El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< > ***@***.***>) escribió: > > > Hi, Diego, > > > > How to insert culture into this loop? > > I didn't find the correct way to mention this object. > > > > Thanks! > > > > management_list = [] > > for idx in argila_geodf.index: > > row = argila_geodf.loc[idx] > > > > man = Management( > > planting_date=datetime(2022, 10, 4), > > irrigation='R', > > harvest='M', > > fertilization='D' > > ) > > > > man.harvest_details["HDATE"] = 23046 > > man.planting_details["PPOP"] = 30 > > man.planting_details["PPOE"] = 30 > > man.planting_details["PLRS"] = 45 > > man.simulation_controls["CO2"] = 'M' > > man.simulation_controls["WATER"] = 'Y' > > man.simulation_controls["WAOUT"] = 'Y' > > man.field['...........XCRD'] = row['geometry'].x > > man.field['...........YCRD'] = row['geometry'].y > > man.field['.............AREA'] = 30 > > man.field['.SLAS'] = df_slope > > man.field['.....ELEV'] = df_dem > > man.field['WSTA....'] = wth > > man.field['SLDP'] = argila[idx] > > management_list.append(man) > > > > manejo = management_list > > > > > > > > > > > > On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < > > ***@***.***> wrote: > > > > > Hello, Diego. > > > > > > Despite entering the weather into a loop, it returns empty values. But > > > using a single climate, and varying the soil, the values return the > > same. > > > Is there any way to make DSSAT run for imaging? I saw that > spatialDSSAT > > > exists, but it is not working... > > > I'm using different soil profiles per pixel, and the soil output > varies > > in > > > LAT, LONG, and values. > > > > > > Again, I'm inserting the zip with my code. > > > > > > Thank you for your attention and support. > > > > > > On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < > > > ***@***.***> wrote: > > > > > >> What happens is that when you mention these variables, it returns an > > >> empty %TMP%... > > >> > > >> > > >> On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < > > >> ***@***.***> wrote: > > >> > > >>> Hello, Diego. After validating the soil, I changed the method of > > >>> extracting the climate to: > > >>> > > >>> WTH_DATA = Weather( > > >>> data_weather_dssat, > > >>> {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', > > 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, > > >>> lat.iloc[0], > > >>> long.iloc[0], > > >>> elev > > >>> ) > > >>> > > >>> I also stated the x and y variables, as the climate coordinates were > > >>> being mentioned: > > >>> > > >>> man.field['...........XCRD'] = dfxy['x'] > > >>> man.field['...........YCRD'] = dfxy['y'] > > >>> # man.field['.............AREA'] = 14420000 > > >>> # man.field['.SLAS'] = df_slope > > >>> # man.field['.....ELEV'] = df_dem > > >>> # man.field['WSTA....'] = WTH_DATA > > >>> # man.field['SLDP'] = soil_profiles > > >>> > > >>> And I find this error > > >>> > > >>> > > >>> Traceback (most recent call last): > > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in > > >>> > > >>> thread = > > >>> > int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) > > - 1 > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", > > > > > >>> line 439, in result > > >>> return self.__get_result() > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", > > > > > >>> line 391, in __get_result > > >>> raise self._exception > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", > > > > > >>> line 58, in run > > >>> result = self.fn(*self.args, **self.kwargs) > > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in > > >>> run_dssat > > >>> dssat_env.run(crop=crop, weather=WTH_DATA, management=man, > > >>> soil=soil_profiles) > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", > > > > > >>> line 216, in run > > >>> management.write(filename=management_filename) > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", > > > > > >>> line 325, in write > > >>> outstr += section_obj.write() + '\n' > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", > > > > > >>> line 544, in write > > >>> outstr += rowbased_write( > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", > > > > > >>> line 336, in rowbased_write > > >>> if (fields[n] in NA_VALS) or (isna(fields[n])): > > >>> File > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", > > > > > >>> line 1527, in __nonzero__ > > >>> raise ValueError( > > >>> ValueError: The truth value of a Series is ambiguous. Use a.empty, > > >>> a.bool(), a.item(), a.any() or a.all(). > > >>> > > >>> Process finished with exit code 1 > > >>> > > >>> On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < > > >>> ***@***.***> wrote: > > >>> > > >>>> Thank you for your reply. I'm using different soil profiles, as if > > each > > >>>> input is a series of data. Is it correct to use this syntax? The > > climate > > >>>> didn't vary because it's the same place... I didn't know about this > > >>>> documentation, thank you very much! > > >>>> > > >>>> On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < > > >>>> ***@***.***> wrote: > > >>>> > > >>>>> I just took a look at the DSSAT weather file in the zip you > shared. > > >>>>> Units do not seem to be right for solar radiation, wind speed, and > > par. I > > >>>>> recommend you to take a look at the official DSSAT documentation, > > >>>>> especially Volume 4 which is the CSM documentation. Also, in your > > >>>>> wheatercode file there is this dados_clima function. I see that > the > > >>>>> function would not return a different Weather object each time it > > runs. > > >>>>> Unless you're using different soil profiles, or different planting > > dates > > >>>>> you'll get the same results each time you run the model. So, read > > DSSAT > > >>>>> documentation to make sure you understand the weather input. Then, > > debug > > >>>>> your code to make sure that it is creating different experimental, > > weather, > > >>>>> and soil files if you are expecting it to do so. > > >>>>> > > >>>>> — > > >>>>> Reply to this email directly, view it on GitHub > > >>>>> < > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, > > > > > >>>>> or unsubscribe > > >>>>> < > > > https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> > > > > > >>>>> . > > >>>>> You are receiving this because you authored the thread.Message ID: > > >>>>> ***@***.***> > > >>>>> > > >>>> > > >>>> > > >>>> -- > > >>>> Guilherme LANDIM-SANTOS > > >>>> > > >>>> Engenheiro Florestal > > >>>> Behance > > >>>> > > >>>> > > >>> > > >>> -- > > >>> Guilherme LANDIM-SANTOS > > >>> > > >>> Engenheiro Florestal > > >>> Behance > > >>> > > >>> > > >> > > >> -- > > >> Guilherme LANDIM-SANTOS > > >> > > >> Engenheiro Florestal > > >> Behance > > >> > > >> > > > > > > -- > > > Guilherme LANDIM-SANTOS > > > > > > Engenheiro Florestal > > > Behance > > > > > > > > > > -- > > Guilherme LANDIM-SANTOS > > > > Engenheiro Florestal > > Behance > > > > — > > Reply to this email directly, view it on GitHub > > < > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>, > > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA> > > > . > > You are receiving this because you commented.Message ID: > > ***@***.***> > > > > > -- > > *______________________________* > > *Diego A. Quintero P.* > Data, Python and Mathematical modeling enthusiast. > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance
guilherber commented 8 months ago

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Management__cultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Management__cultivars' Process finished with exit code 1 How to resolve this error? This is my management code: crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = [] for idx, row in argila_geodf.iterrows(): # Obter o índice correspondente no DataFrame de perfis de solo profile_index = idx % len(soil_profiles) # Usar o perfil de solo correspondente ao índice soil_data = soil_profiles[profile_index] man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' ) man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field) and this is my run dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário # Executar a função run de dssat com os resultados das funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results) print(df) On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < ***@***.***> wrote: > my keyboard autocorrects a lot of the time lol > > The error returns > > Traceback (most recent call last): > File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in > > dssat.run(make_soil(), wth, crop, make_man()) > File > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > line 170, in run > management._Management__cultivars['CR'] = crop._CODE > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > AttributeError: 'list' object has no attribute '_Management__cultivars' > > and this empty file: > C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created. > > > > On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero ***@***.***> > wrote: > >> what do you mean by culture? >> >> El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< >> ***@***.***>) escribió: >> >> > Hi, Diego, >> > >> > How to insert culture into this loop? >> > I didn't find the correct way to mention this object. >> > >> > Thanks! >> > >> > management_list = [] >> > for idx in argila_geodf.index: >> > row = argila_geodf.loc[idx] >> > >> > man = Management( >> > planting_date=datetime(2022, 10, 4), >> > irrigation='R', >> > harvest='M', >> > fertilization='D' >> > ) >> > >> > man.harvest_details["HDATE"] = 23046 >> > man.planting_details["PPOP"] = 30 >> > man.planting_details["PPOE"] = 30 >> > man.planting_details["PLRS"] = 45 >> > man.simulation_controls["CO2"] = 'M' >> > man.simulation_controls["WATER"] = 'Y' >> > man.simulation_controls["WAOUT"] = 'Y' >> > man.field['...........XCRD'] = row['geometry'].x >> > man.field['...........YCRD'] = row['geometry'].y >> > man.field['.............AREA'] = 30 >> > man.field['.SLAS'] = df_slope >> > man.field['.....ELEV'] = df_dem >> > man.field['WSTA....'] = wth >> > man.field['SLDP'] = argila[idx] >> > management_list.append(man) >> > >> > manejo = management_list >> > >> > >> > >> > >> > >> > On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < >> > ***@***.***> wrote: >> > >> > > Hello, Diego. >> > > >> > > Despite entering the weather into a loop, it returns empty values. >> But >> > > using a single climate, and varying the soil, the values return the >> > same. >> > > Is there any way to make DSSAT run for imaging? I saw that >> spatialDSSAT >> > > exists, but it is not working... >> > > I'm using different soil profiles per pixel, and the soil output >> varies >> > in >> > > LAT, LONG, and values. >> > > >> > > Again, I'm inserting the zip with my code. >> > > >> > > Thank you for your attention and support. >> > > >> > > On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < >> > > ***@***.***> wrote: >> > > >> > >> What happens is that when you mention these variables, it returns an >> > >> empty %TMP%... >> > >> >> > >> >> > >> On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < >> > >> ***@***.***> wrote: >> > >> >> > >>> Hello, Diego. After validating the soil, I changed the method of >> > >>> extracting the climate to: >> > >>> >> > >>> WTH_DATA = Weather( >> > >>> data_weather_dssat, >> > >>> {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', >> > 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, >> > >>> lat.iloc[0], >> > >>> long.iloc[0], >> > >>> elev >> > >>> ) >> > >>> >> > >>> I also stated the x and y variables, as the climate coordinates >> were >> > >>> being mentioned: >> > >>> >> > >>> man.field['...........XCRD'] = dfxy['x'] >> > >>> man.field['...........YCRD'] = dfxy['y'] >> > >>> # man.field['.............AREA'] = 14420000 >> > >>> # man.field['.SLAS'] = df_slope >> > >>> # man.field['.....ELEV'] = df_dem >> > >>> # man.field['WSTA....'] = WTH_DATA >> > >>> # man.field['SLDP'] = soil_profiles >> > >>> >> > >>> And I find this error >> > >>> >> > >>> >> > >>> Traceback (most recent call last): >> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in >> > >>> >> > >>> thread = >> > >>> >> int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) >> > - 1 >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", >> >> > >> > >>> line 439, in result >> > >>> return self.__get_result() >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", >> >> > >> > >>> line 391, in __get_result >> > >>> raise self._exception >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", >> >> > >> > >>> line 58, in run >> > >>> result = self.fn(*self.args, **self.kwargs) >> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in >> > >>> run_dssat >> > >>> dssat_env.run(crop=crop, weather=WTH_DATA, management=man, >> > >>> soil=soil_profiles) >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", >> >> > >> > >>> line 216, in run >> > >>> management.write(filename=management_filename) >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", >> >> > >> > >>> line 325, in write >> > >>> outstr += section_obj.write() + '\n' >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", >> >> > >> > >>> line 544, in write >> > >>> outstr += rowbased_write( >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", >> >> > >> > >>> line 336, in rowbased_write >> > >>> if (fields[n] in NA_VALS) or (isna(fields[n])): >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", >> >> > >> > >>> line 1527, in __nonzero__ >> > >>> raise ValueError( >> > >>> ValueError: The truth value of a Series is ambiguous. Use a.empty, >> > >>> a.bool(), a.item(), a.any() or a.all(). >> > >>> >> > >>> Process finished with exit code 1 >> > >>> >> > >>> On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < >> > >>> ***@***.***> wrote: >> > >>> >> > >>>> Thank you for your reply. I'm using different soil profiles, as if >> > each >> > >>>> input is a series of data. Is it correct to use this syntax? The >> > climate >> > >>>> didn't vary because it's the same place... I didn't know about >> this >> > >>>> documentation, thank you very much! >> > >>>> >> > >>>> On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < >> > >>>> ***@***.***> wrote: >> > >>>> >> > >>>>> I just took a look at the DSSAT weather file in the zip you >> shared. >> > >>>>> Units do not seem to be right for solar radiation, wind speed, >> and >> > par. I >> > >>>>> recommend you to take a look at the official DSSAT documentation, >> > >>>>> especially Volume 4 which is the CSM documentation. Also, in your >> > >>>>> wheatercode file there is this dados_clima function. I see that >> the >> > >>>>> function would not return a different Weather object each time it >> > runs. >> > >>>>> Unless you're using different soil profiles, or different >> planting >> > dates >> > >>>>> you'll get the same results each time you run the model. So, read >> > DSSAT >> > >>>>> documentation to make sure you understand the weather input. >> Then, >> > debug >> > >>>>> your code to make sure that it is creating different >> experimental, >> > weather, >> > >>>>> and soil files if you are expecting it to do so. >> > >>>>> >> > >>>>> — >> > >>>>> Reply to this email directly, view it on GitHub >> > >>>>> < >> > >> https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, >> >> > >> > >>>>> or unsubscribe >> > >>>>> < >> > >> https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> >> >> > >> > >>>>> . >> > >>>>> You are receiving this because you authored the thread.Message >> ID: >> > >>>>> ***@***.***> >> > >>>>> >> > >>>> >> > >>>> >> > >>>> -- >> > >>>> Guilherme LANDIM-SANTOS >> > >>>> >> > >>>> Engenheiro Florestal >> > >>>> Behance >> > >>>> >> > >>>> >> > >>> >> > >>> -- >> > >>> Guilherme LANDIM-SANTOS >> > >>> >> > >>> Engenheiro Florestal >> > >>> Behance >> > >>> >> > >>> >> > >> >> > >> -- >> > >> Guilherme LANDIM-SANTOS >> > >> >> > >> Engenheiro Florestal >> > >> Behance >> > >> >> > >> >> > > >> > > -- >> > > Guilherme LANDIM-SANTOS >> > > >> > > Engenheiro Florestal >> > > Behance >> > > >> > > >> > >> > -- >> > Guilherme LANDIM-SANTOS >> > >> > Engenheiro Florestal >> > Behance >> > >> > — >> > Reply to this email directly, view it on GitHub >> > < >> https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>, >> >> > or unsubscribe >> > < >> https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA> >> >> > . >> > You are receiving this because you commented.Message ID: >> > ***@***.***> >> > >> >> >> -- >> >> *______________________________* >> >> *Diego A. Quintero P.* >> Data, Python and Mathematical modeling enthusiast. >> >> — >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Guilherme LANDIM-SANTOS > > Engenheiro Florestal > Behance > > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance
guilherber commented 8 months ago

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Management__cultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Management__cultivars' Process finished with exit code 1 How to resolve this error? This is my management code: crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = [] for idx, row in argila_geodf.iterrows(): # Obter o índice correspondente no DataFrame de perfis de solo profile_index = idx % len(soil_profiles) # Usar o perfil de solo correspondente ao índice soil_data = soil_profiles[profile_index] man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' ) man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field) and this is my run dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário # Executar a função run de dssat com os resultados das funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results) print(df) On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < ***@***.***> wrote: > my keyboard autocorrects a lot of the time lol > > The error returns > > Traceback (most recent call last): > File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in > > dssat.run(make_soil(), wth, crop, make_man()) > File > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > line 170, in run > management._Management__cultivars['CR'] = crop._CODE > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > AttributeError: 'list' object has no attribute '_Management__cultivars' > > and this empty file: > C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created. > > > > On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero ***@***.***> > wrote: > >> what do you mean by culture? >> >> El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< >> ***@***.***>) escribió: >> >> > Hi, Diego, >> > >> > How to insert culture into this loop? >> > I didn't find the correct way to mention this object. >> > >> > Thanks! >> > >> > management_list = [] >> > for idx in argila_geodf.index: >> > row = argila_geodf.loc[idx] >> > >> > man = Management( >> > planting_date=datetime(2022, 10, 4), >> > irrigation='R', >> > harvest='M', >> > fertilization='D' >> > ) >> > >> > man.harvest_details["HDATE"] = 23046 >> > man.planting_details["PPOP"] = 30 >> > man.planting_details["PPOE"] = 30 >> > man.planting_details["PLRS"] = 45 >> > man.simulation_controls["CO2"] = 'M' >> > man.simulation_controls["WATER"] = 'Y' >> > man.simulation_controls["WAOUT"] = 'Y' >> > man.field['...........XCRD'] = row['geometry'].x >> > man.field['...........YCRD'] = row['geometry'].y >> > man.field['.............AREA'] = 30 >> > man.field['.SLAS'] = df_slope >> > man.field['.....ELEV'] = df_dem >> > man.field['WSTA....'] = wth >> > man.field['SLDP'] = argila[idx] >> > management_list.append(man) >> > >> > manejo = management_list >> > >> > >> > >> > >> > >> > On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < >> > ***@***.***> wrote: >> > >> > > Hello, Diego. >> > > >> > > Despite entering the weather into a loop, it returns empty values. >> But >> > > using a single climate, and varying the soil, the values return the >> > same. >> > > Is there any way to make DSSAT run for imaging? I saw that >> spatialDSSAT >> > > exists, but it is not working... >> > > I'm using different soil profiles per pixel, and the soil output >> varies >> > in >> > > LAT, LONG, and values. >> > > >> > > Again, I'm inserting the zip with my code. >> > > >> > > Thank you for your attention and support. >> > > >> > > On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < >> > > ***@***.***> wrote: >> > > >> > >> What happens is that when you mention these variables, it returns >> an >> > >> empty %TMP%... >> > >> >> > >> >> > >> On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < >> > >> ***@***.***> wrote: >> > >> >> > >>> Hello, Diego. After validating the soil, I changed the method of >> > >>> extracting the climate to: >> > >>> >> > >>> WTH_DATA = Weather( >> > >>> data_weather_dssat, >> > >>> {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', >> > 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, >> > >>> lat.iloc[0], >> > >>> long.iloc[0], >> > >>> elev >> > >>> ) >> > >>> >> > >>> I also stated the x and y variables, as the climate coordinates >> were >> > >>> being mentioned: >> > >>> >> > >>> man.field['...........XCRD'] = dfxy['x'] >> > >>> man.field['...........YCRD'] = dfxy['y'] >> > >>> # man.field['.............AREA'] = 14420000 >> > >>> # man.field['.SLAS'] = df_slope >> > >>> # man.field['.....ELEV'] = df_dem >> > >>> # man.field['WSTA....'] = WTH_DATA >> > >>> # man.field['SLDP'] = soil_profiles >> > >>> >> > >>> And I find this error >> > >>> >> > >>> >> > >>> Traceback (most recent call last): >> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in >> > >>> >> > >>> thread = >> > >>> >> int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) >> > - 1 >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", >> >> > >> > >>> line 439, in result >> > >>> return self.__get_result() >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", >> >> > >> > >>> line 391, in __get_result >> > >>> raise self._exception >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", >> >> > >> > >>> line 58, in run >> > >>> result = self.fn(*self.args, **self.kwargs) >> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in >> > >>> run_dssat >> > >>> dssat_env.run(crop=crop, weather=WTH_DATA, management=man, >> > >>> soil=soil_profiles) >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", >> >> > >> > >>> line 216, in run >> > >>> management.write(filename=management_filename) >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", >> >> > >> > >>> line 325, in write >> > >>> outstr += section_obj.write() + '\n' >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", >> >> > >> > >>> line 544, in write >> > >>> outstr += rowbased_write( >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", >> >> > >> > >>> line 336, in rowbased_write >> > >>> if (fields[n] in NA_VALS) or (isna(fields[n])): >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", >> >> > >> > >>> line 1527, in __nonzero__ >> > >>> raise ValueError( >> > >>> ValueError: The truth value of a Series is ambiguous. Use a.empty, >> > >>> a.bool(), a.item(), a.any() or a.all(). >> > >>> >> > >>> Process finished with exit code 1 >> > >>> >> > >>> On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < >> > >>> ***@***.***> wrote: >> > >>> >> > >>>> Thank you for your reply. I'm using different soil profiles, as >> if >> > each >> > >>>> input is a series of data. Is it correct to use this syntax? The >> > climate >> > >>>> didn't vary because it's the same place... I didn't know about >> this >> > >>>> documentation, thank you very much! >> > >>>> >> > >>>> On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < >> > >>>> ***@***.***> wrote: >> > >>>> >> > >>>>> I just took a look at the DSSAT weather file in the zip you >> shared. >> > >>>>> Units do not seem to be right for solar radiation, wind speed, >> and >> > par. I >> > >>>>> recommend you to take a look at the official DSSAT >> documentation, >> > >>>>> especially Volume 4 which is the CSM documentation. Also, in >> your >> > >>>>> wheatercode file there is this dados_clima function. I see that >> the >> > >>>>> function would not return a different Weather object each time >> it >> > runs. >> > >>>>> Unless you're using different soil profiles, or different >> planting >> > dates >> > >>>>> you'll get the same results each time you run the model. So, >> read >> > DSSAT >> > >>>>> documentation to make sure you understand the weather input. >> Then, >> > debug >> > >>>>> your code to make sure that it is creating different >> experimental, >> > weather, >> > >>>>> and soil files if you are expecting it to do so. >> > >>>>> >> > >>>>> — >> > >>>>> Reply to this email directly, view it on GitHub >> > >>>>> < >> > >> https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, >> >> > >> > >>>>> or unsubscribe >> > >>>>> < >> > >> https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> >> >> > >> > >>>>> . >> > >>>>> You are receiving this because you authored the thread.Message >> ID: >> > >>>>> ***@***.***> >> > >>>>> >> > >>>> >> > >>>> >> > >>>> -- >> > >>>> Guilherme LANDIM-SANTOS >> > >>>> >> > >>>> Engenheiro Florestal >> > >>>> Behance >> > >>>> >> > >>>> >> > >>> >> > >>> -- >> > >>> Guilherme LANDIM-SANTOS >> > >>> >> > >>> Engenheiro Florestal >> > >>> Behance >> > >>> >> > >>> >> > >> >> > >> -- >> > >> Guilherme LANDIM-SANTOS >> > >> >> > >> Engenheiro Florestal >> > >> Behance >> > >> >> > >> >> > > >> > > -- >> > > Guilherme LANDIM-SANTOS >> > > >> > > Engenheiro Florestal >> > > Behance >> > > >> > > >> > >> > -- >> > Guilherme LANDIM-SANTOS >> > >> > Engenheiro Florestal >> > Behance >> > >> > — >> > Reply to this email directly, view it on GitHub >> > < >> https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>, >> >> > or unsubscribe >> > < >> https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA> >> >> > . >> > You are receiving this because you commented.Message ID: >> > ***@***.***> >> > >> >> >> -- >> >> *______________________________* >> >> *Diego A. Quintero P.* >> Data, Python and Mathematical modeling enthusiast. >> >> — >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Guilherme LANDIM-SANTOS > > Engenheiro Florestal > Behance > > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

daquinterop commented 8 months ago

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Management__cultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Management__cultivars' Process finished with exit code 1 How to resolve this error? This is my management code: crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = [] for idx, row in argila_geodf.iterrows(): # Obter o índice correspondente no DataFrame de perfis de solo profile_index = idx % len(soil_profiles) # Usar o perfil de solo correspondente ao índice soil_data = soil_profiles[profile_index] man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' ) man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field) and this is my run dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário # Executar a função run de dssat com os resultados das funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results) print(df) On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < ***@***.***> wrote: > my keyboard autocorrects a lot of the time lol > > The error returns > > Traceback (most recent call last): > File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in > > dssat.run(make_soil(), wth, crop, make_man()) > File > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > line 170, in run > management._Management__cultivars['CR'] = crop._CODE > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > AttributeError: 'list' object has no attribute '_Management__cultivars' > > and this empty file: > C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created. > > > > On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero ***@***.***> > wrote: > >> what do you mean by culture? >> >> El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< >> ***@***.***>) escribió: >> >> > Hi, Diego, >> > >> > How to insert culture into this loop? >> > I didn't find the correct way to mention this object. >> > >> > Thanks! >> > >> > management_list = [] >> > for idx in argila_geodf.index: >> > row = argila_geodf.loc[idx] >> > >> > man = Management( >> > planting_date=datetime(2022, 10, 4), >> > irrigation='R', >> > harvest='M', >> > fertilization='D' >> > ) >> > >> > man.harvest_details["HDATE"] = 23046 >> > man.planting_details["PPOP"] = 30 >> > man.planting_details["PPOE"] = 30 >> > man.planting_details["PLRS"] = 45 >> > man.simulation_controls["CO2"] = 'M' >> > man.simulation_controls["WATER"] = 'Y' >> > man.simulation_controls["WAOUT"] = 'Y' >> > man.field['...........XCRD'] = row['geometry'].x >> > man.field['...........YCRD'] = row['geometry'].y >> > man.field['.............AREA'] = 30 >> > man.field['.SLAS'] = df_slope >> > man.field['.....ELEV'] = df_dem >> > man.field['WSTA....'] = wth >> > man.field['SLDP'] = argila[idx] >> > management_list.append(man) >> > >> > manejo = management_list >> > >> > >> > >> > >> > >> > On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < >> > ***@***.***> wrote: >> > >> > > Hello, Diego. >> > > >> > > Despite entering the weather into a loop, it returns empty values. >> But >> > > using a single climate, and varying the soil, the values return the >> > same. >> > > Is there any way to make DSSAT run for imaging? I saw that >> spatialDSSAT >> > > exists, but it is not working... >> > > I'm using different soil profiles per pixel, and the soil output >> varies >> > in >> > > LAT, LONG, and values. >> > > >> > > Again, I'm inserting the zip with my code. >> > > >> > > Thank you for your attention and support. >> > > >> > > On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < >> > > ***@***.***> wrote: >> > > >> > >> What happens is that when you mention these variables, it returns >> an >> > >> empty %TMP%... >> > >> >> > >> >> > >> On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < >> > >> ***@***.***> wrote: >> > >> >> > >>> Hello, Diego. After validating the soil, I changed the method of >> > >>> extracting the climate to: >> > >>> >> > >>> WTH_DATA = Weather( >> > >>> data_weather_dssat, >> > >>> {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', >> > 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, >> > >>> lat.iloc[0], >> > >>> long.iloc[0], >> > >>> elev >> > >>> ) >> > >>> >> > >>> I also stated the x and y variables, as the climate coordinates >> were >> > >>> being mentioned: >> > >>> >> > >>> man.field['...........XCRD'] = dfxy['x'] >> > >>> man.field['...........YCRD'] = dfxy['y'] >> > >>> # man.field['.............AREA'] = 14420000 >> > >>> # man.field['.SLAS'] = df_slope >> > >>> # man.field['.....ELEV'] = df_dem >> > >>> # man.field['WSTA....'] = WTH_DATA >> > >>> # man.field['SLDP'] = soil_profiles >> > >>> >> > >>> And I find this error >> > >>> >> > >>> >> > >>> Traceback (most recent call last): >> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in >> > >>> >> > >>> thread = >> > >>> >> int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) >> > - 1 >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", >> >> > >> > >>> line 439, in result >> > >>> return self.__get_result() >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", >> >> > >> > >>> line 391, in __get_result >> > >>> raise self._exception >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", >> >> > >> > >>> line 58, in run >> > >>> result = self.fn(*self.args, **self.kwargs) >> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in >> > >>> run_dssat >> > >>> dssat_env.run(crop=crop, weather=WTH_DATA, management=man, >> > >>> soil=soil_profiles) >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", >> >> > >> > >>> line 216, in run >> > >>> management.write(filename=management_filename) >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", >> >> > >> > >>> line 325, in write >> > >>> outstr += section_obj.write() + '\n' >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", >> >> > >> > >>> line 544, in write >> > >>> outstr += rowbased_write( >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", >> >> > >> > >>> line 336, in rowbased_write >> > >>> if (fields[n] in NA_VALS) or (isna(fields[n])): >> > >>> File >> > >>> >> > >> "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", >> >> > >> > >>> line 1527, in __nonzero__ >> > >>> raise ValueError( >> > >>> ValueError: The truth value of a Series is ambiguous. Use a.empty, >> > >>> a.bool(), a.item(), a.any() or a.all(). >> > >>> >> > >>> Process finished with exit code 1 >> > >>> >> > >>> On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < >> > >>> ***@***.***> wrote: >> > >>> >> > >>>> Thank you for your reply. I'm using different soil profiles, as >> if >> > each >> > >>>> input is a series of data. Is it correct to use this syntax? The >> > climate >> > >>>> didn't vary because it's the same place... I didn't know about >> this >> > >>>> documentation, thank you very much! >> > >>>> >> > >>>> On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < >> > >>>> ***@***.***> wrote: >> > >>>> >> > >>>>> I just took a look at the DSSAT weather file in the zip you >> shared. >> > >>>>> Units do not seem to be right for solar radiation, wind speed, >> and >> > par. I >> > >>>>> recommend you to take a look at the official DSSAT >> documentation, >> > >>>>> especially Volume 4 which is the CSM documentation. Also, in >> your >> > >>>>> wheatercode file there is this dados_clima function. I see that >> the >> > >>>>> function would not return a different Weather object each time >> it >> > runs. >> > >>>>> Unless you're using different soil profiles, or different >> planting >> > dates >> > >>>>> you'll get the same results each time you run the model. So, >> read >> > DSSAT >> > >>>>> documentation to make sure you understand the weather input. >> Then, >> > debug >> > >>>>> your code to make sure that it is creating different >> experimental, >> > weather, >> > >>>>> and soil files if you are expecting it to do so. >> > >>>>> >> > >>>>> — >> > >>>>> Reply to this email directly, view it on GitHub >> > >>>>> < >> > >> https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, >> >> > >> > >>>>> or unsubscribe >> > >>>>> < >> > >> https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> >> >> > >> > >>>>> . >> > >>>>> You are receiving this because you authored the thread.Message >> ID: >> > >>>>> ***@***.***> >> > >>>>> >> > >>>> >> > >>>> >> > >>>> -- >> > >>>> Guilherme LANDIM-SANTOS >> > >>>> >> > >>>> Engenheiro Florestal >> > >>>> Behance >> > >>>> >> > >>>> >> > >>> >> > >>> -- >> > >>> Guilherme LANDIM-SANTOS >> > >>> >> > >>> Engenheiro Florestal >> > >>> Behance >> > >>> >> > >>> >> > >> >> > >> -- >> > >> Guilherme LANDIM-SANTOS >> > >> >> > >> Engenheiro Florestal >> > >> Behance >> > >> >> > >> >> > > >> > > -- >> > > Guilherme LANDIM-SANTOS >> > > >> > > Engenheiro Florestal >> > > Behance >> > > >> > > >> > >> > -- >> > Guilherme LANDIM-SANTOS >> > >> > Engenheiro Florestal >> > Behance >> > >> > — >> > Reply to this email directly, view it on GitHub >> > < >> https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>, >> >> > or unsubscribe >> > < >> https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA> >> >> > . >> > You are receiving this because you commented.Message ID: >> > ***@***.***> >> > >> >> >> -- >> >> *______________________________* >> >> *Diego A. Quintero P.* >> Data, Python and Mathematical modeling enthusiast. >> >> — >> Reply to this email directly, view it on GitHub >> < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>, >> or unsubscribe >> < https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Guilherme LANDIM-SANTOS > > Engenheiro Florestal > Behance > > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM . You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

guilherber commented 8 months ago

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py", line 401, in get_result raise self._exception File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de solo

profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das funções

anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE . You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

guilherber commented 8 months ago

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 401, in __get_result raise self._exception File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Management__cultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Management__cultivars' On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero ***@***.***> wrote: > The cultivar is not defined in Management. It is defined in the Crop > class. > When you do ` Crop('soybean', '990004')`, you're specifying 990004 as the > cultivar. Trying to set the cultivar in the management is wrong. > > El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< > ***@***.***>) escribió: > > > Hello, Diego, how are you? > > > > I realize that in the management function when calling the cultivar it > is > > not recognized as part of the class. How can I adjust this bug to > > recognize > > the cultivar in management? > > The class also does not recognize the cultivar as part of the > experiment, > > even though it is declared in the function. > > > > Thanks! > > > > On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < > > ***@***.***> wrote: > > > > > Hello, Diego, how are you? > > > > > > Being able to orient the climatic and soil objects for each > management. > > > The problem is that the code encounters the error: > > > > > > Traceback (most recent call last): > > > File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in > > > > > > dssat.run(management_list_result, wth, crop, soil_profiles) > > > File > > > > > > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > > > > > > line 170, in run > > > management._Management__cultivars['CR'] = crop._CODE > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > AttributeError: 'list' object has no attribute > '_Management__cultivars' > > > > > > Process finished with exit code 1 > > > How to resolve this error? > > > This is my management code: > > > > > > crop = Crop('soybean', '990004') > > > def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): > > > management_list = [] > > > > > > for idx, row in argila_geodf.iterrows(): > > > # Obter o índice correspondente no DataFrame de perfis de solo > > > profile_index = idx % len(soil_profiles) > > > # Usar o perfil de solo correspondente ao índice > > > soil_data = soil_profiles[profile_index] > > > > > > man = Management( > > > planting_date=datetime(2022, 10, 4), > > > irrigation='R', > > > harvest='M', > > > fertilization='D' > > > ) > > > > > > man.harvest_details["HDATE"] = 23046 > > > man.planting_details["PPOP"] = 30 > > > man.planting_details["PPOE"] = 30 > > > man.planting_details["PLRS"] = 45 > > > man.simulation_controls["CO2"] = 'M' > > > man.simulation_controls["WATER"] = 'Y' > > > man.simulation_controls["WAOUT"] = 'Y' > > > man.field['...........XCRD'] = row['geometry'].x > > > man.field['...........YCRD'] = row['geometry'].y > > > man.field['.............AREA'] = 30 > > > man.field['.SLAS'] = df_slope > > > man.field['.....ELEV'] = df_dem > > > man.field['WSTA....'] = wth > > > man.field['SLDP'] = soil_data > > > management_list.append(man) > > > return management_list > > > > > > management_list = make_man(argila_geodf, df_slope, df_dem, wth, > > soil_profiles) > > > for man in management_list: > > > print(man.field) > > > > > > > > > and this is my run > > > > > > > > > dssat = DSSAT() > > > dssat.setup() > > > wth = wth > > > crop = crop > > > management_list_result = management_list # Supondo que > management_list() > > retorna o objeto necessário > > > > > > # Executar a função run de dssat com os resultados das funções > > anteriores > > > dssat.run(management_list_result, wth, crop, soil_profiles) > > > plant_gro_results = dssat.output.get('PlantGro', {}) > > > df = pd.DataFrame(plant_gro_results) > > > > > > print(df) > > > > > > > > > > > > On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < > > > ***@***.***> wrote: > > > > > >> my keyboard autocorrects a lot of the time lol > > >> > > >> The error returns > > >> > > >> Traceback (most recent call last): > > >> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in > > >> > > >> dssat.run(make_soil(), wth, crop, make_man()) > > >> File > > >> > > > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > > > > > >> line 170, in run > > >> management._Management__cultivars['CR'] = crop._CODE > > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > >> AttributeError: 'list' object has no attribute > '_Management__cultivars' > > >> > > >> and this empty file: > > >> C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created. > > >> > > >> > > >> > > >> On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero ***@***.***> > > >> wrote: > > >> > > >>> what do you mean by culture? > > >>> > > >>> El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< > > >>> ***@***.***>) escribió: > > >>> > > >>> > Hi, Diego, > > >>> > > > >>> > How to insert culture into this loop? > > >>> > I didn't find the correct way to mention this object. > > >>> > > > >>> > Thanks! > > >>> > > > >>> > management_list = [] > > >>> > for idx in argila_geodf.index: > > >>> > row = argila_geodf.loc[idx] > > >>> > > > >>> > man = Management( > > >>> > planting_date=datetime(2022, 10, 4), > > >>> > irrigation='R', > > >>> > harvest='M', > > >>> > fertilization='D' > > >>> > ) > > >>> > > > >>> > man.harvest_details["HDATE"] = 23046 > > >>> > man.planting_details["PPOP"] = 30 > > >>> > man.planting_details["PPOE"] = 30 > > >>> > man.planting_details["PLRS"] = 45 > > >>> > man.simulation_controls["CO2"] = 'M' > > >>> > man.simulation_controls["WATER"] = 'Y' > > >>> > man.simulation_controls["WAOUT"] = 'Y' > > >>> > man.field['...........XCRD'] = row['geometry'].x > > >>> > man.field['...........YCRD'] = row['geometry'].y > > >>> > man.field['.............AREA'] = 30 > > >>> > man.field['.SLAS'] = df_slope > > >>> > man.field['.....ELEV'] = df_dem > > >>> > man.field['WSTA....'] = wth > > >>> > man.field['SLDP'] = argila[idx] > > >>> > management_list.append(man) > > >>> > > > >>> > manejo = management_list > > >>> > > > >>> > > > >>> > > > >>> > > > >>> > > > >>> > On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < > > >>> > ***@***.***> wrote: > > >>> > > > >>> > > Hello, Diego. > > >>> > > > > >>> > > Despite entering the weather into a loop, it returns empty > values. > > >>> But > > >>> > > using a single climate, and varying the soil, the values return > > the > > >>> > same. > > >>> > > Is there any way to make DSSAT run for imaging? I saw that > > >>> spatialDSSAT > > >>> > > exists, but it is not working... > > >>> > > I'm using different soil profiles per pixel, and the soil > output > > >>> varies > > >>> > in > > >>> > > LAT, LONG, and values. > > >>> > > > > >>> > > Again, I'm inserting the zip with my code. > > >>> > > > > >>> > > Thank you for your attention and support. > > >>> > > > > >>> > > On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < > > >>> > > ***@***.***> wrote: > > >>> > > > > >>> > >> What happens is that when you mention these variables, it > returns > > >>> an > > >>> > >> empty %TMP%... > > >>> > >> > > >>> > >> > > >>> > >> On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < > > >>> > >> ***@***.***> wrote: > > >>> > >> > > >>> > >>> Hello, Diego. After validating the soil, I changed the method > of > > >>> > >>> extracting the climate to: > > >>> > >>> > > >>> > >>> WTH_DATA = Weather( > > >>> > >>> data_weather_dssat, > > >>> > >>> {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': > 'SRAD', > > >>> > 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, > > >>> > >>> lat.iloc[0], > > >>> > >>> long.iloc[0], > > >>> > >>> elev > > >>> > >>> ) > > >>> > >>> > > >>> > >>> I also stated the x and y variables, as the climate > coordinates > > >>> were > > >>> > >>> being mentioned: > > >>> > >>> > > >>> > >>> man.field['...........XCRD'] = dfxy['x'] > > >>> > >>> man.field['...........YCRD'] = dfxy['y'] > > >>> > >>> # man.field['.............AREA'] = 14420000 > > >>> > >>> # man.field['.SLAS'] = df_slope > > >>> > >>> # man.field['.....ELEV'] = df_dem > > >>> > >>> # man.field['WSTA....'] = WTH_DATA > > >>> > >>> # man.field['SLDP'] = soil_profiles > > >>> > >>> > > >>> > >>> And I find this error > > >>> > >>> > > >>> > >>> > > >>> > >>> Traceback (most recent call last): > > >>> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line > 42, > > in > > >>> > >>> > > >>> > >>> thread = > > >>> > >>> > > >>> > int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) > > >>> > - 1 > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", > > > > > >>> > > >>> > > > >>> > >>> line 439, in result > > >>> > >>> return self.__get_result() > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", > > > > > >>> > > >>> > > > >>> > >>> line 391, in __get_result > > >>> > >>> raise self._exception > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", > > > > > >>> > > >>> > > > >>> > >>> line 58, in run > > >>> > >>> result = self.fn(*self.args, **self.kwargs) > > >>> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line > 21, > > in > > >>> > >>> run_dssat > > >>> > >>> dssat_env.run(crop=crop, weather=WTH_DATA, management=man, > > >>> > >>> soil=soil_profiles) > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", > > > > > >>> > > >>> > > > >>> > >>> line 216, in run > > >>> > >>> management.write(filename=management_filename) > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", > > > > > >>> > > >>> > > > >>> > >>> line 325, in write > > >>> > >>> outstr += section_obj.write() + '\n' > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", > > > > > >>> > > >>> > > > >>> > >>> line 544, in write > > >>> > >>> outstr += rowbased_write( > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", > > > > > >>> > > >>> > > > >>> > >>> line 336, in rowbased_write > > >>> > >>> if (fields[n] in NA_VALS) or (isna(fields[n])): > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", > > > > > >>> > > >>> > > > >>> > >>> line 1527, in __nonzero__ > > >>> > >>> raise ValueError( > > >>> > >>> ValueError: The truth value of a Series is ambiguous. Use > > a.empty, > > >>> > >>> a.bool(), a.item(), a.any() or a.all(). > > >>> > >>> > > >>> > >>> Process finished with exit code 1 > > >>> > >>> > > >>> > >>> On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < > > >>> > >>> ***@***.***> wrote: > > >>> > >>> > > >>> > >>>> Thank you for your reply. I'm using different soil profiles, > as > > >>> if > > >>> > each > > >>> > >>>> input is a series of data. Is it correct to use this syntax? > > The > > >>> > climate > > >>> > >>>> didn't vary because it's the same place... I didn't know > about > > >>> this > > >>> > >>>> documentation, thank you very much! > > >>> > >>>> > > >>> > >>>> On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < > > >>> > >>>> ***@***.***> wrote: > > >>> > >>>> > > >>> > >>>>> I just took a look at the DSSAT weather file in the zip you > > >>> shared. > > >>> > >>>>> Units do not seem to be right for solar radiation, wind > speed, > > >>> and > > >>> > par. I > > >>> > >>>>> recommend you to take a look at the official DSSAT > > >>> documentation, > > >>> > >>>>> especially Volume 4 which is the CSM documentation. Also, > in > > >>> your > > >>> > >>>>> wheatercode file there is this dados_clima function. I see > > that > > >>> the > > >>> > >>>>> function would not return a different Weather object each > time > > >>> it > > >>> > runs. > > >>> > >>>>> Unless you're using different soil profiles, or different > > >>> planting > > >>> > dates > > >>> > >>>>> you'll get the same results each time you run the model. > So, > > >>> read > > >>> > DSSAT > > >>> > >>>>> documentation to make sure you understand the weather > input. > > >>> Then, > > >>> > debug > > >>> > >>>>> your code to make sure that it is creating different > > >>> experimental, > > >>> > weather, > > >>> > >>>>> and soil files if you are expecting it to do so. > > >>> > >>>>> > > >>> > >>>>> — > > >>> > >>>>> Reply to this email directly, view it on GitHub > > >>> > >>>>> < > > >>> > > > >>> > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, > > > > > >>> > > >>> > > > >>> > >>>>> or unsubscribe > > >>> > >>>>> < > > >>> > > > >>> > > > https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> > > > > > >>> > > >>> > > > >>> > >>>>> . > > >>> > >>>>> You are receiving this because you authored the > thread.Message > > >>> ID: > > >>> > >>>>> ***@***.***> > > >>> > >>>>> > > >>> > >>>> > > >>> > >>>> > > >>> > >>>> -- > > >>> > >>>> Guilherme LANDIM-SANTOS > > >>> > >>>> < > https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > > > >>> > >>>> Engenheiro Florestal > > >>> > >>>> Behance > > >>> > >>>> > > >>> > >>>> > > >>> > >>> > > >>> > >>> -- > > >>> > >>> Guilherme LANDIM-SANTOS > > >>> > >>> < > https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > > > >>> > >>> Engenheiro Florestal > > >>> > >>> Behance > > >>> > >>> > > >>> > >>> > > >>> > >> > > >>> > >> -- > > >>> > >> Guilherme LANDIM-SANTOS > > >>> > >> < > https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > >>> > >> Engenheiro Florestal > > >>> > >> Behance > > >>> > >> > > >>> > >> > > >>> > > > > >>> > > -- > > >>> > > Guilherme LANDIM-SANTOS > > >>> > > > > > >>> > > Engenheiro Florestal > > >>> > > Behance > > >>> > > > > >>> > > > > >>> > > > >>> > -- > > >>> > Guilherme LANDIM-SANTOS > > >>> > > > >>> > Engenheiro Florestal > > >>> > Behance > > >>> > > > >>> > — > > >>> > Reply to this email directly, view it on GitHub > > >>> > < > > >>> > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>, > > > > > >>> > > >>> > or unsubscribe > > >>> > < > > >>> > > > https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA> > > > > > >>> > > >>> > . > > >>> > You are receiving this because you commented.Message ID: > > >>> > ***@***.***> > > >>> > > > >>> > > >>> > > >>> -- > > >>> > > >>> *______________________________* > > >>> > > >>> *Diego A. Quintero P.* > > >>> Data, Python and Mathematical modeling enthusiast. > > >>> > > >>> — > > >>> Reply to this email directly, view it on GitHub > > >>> < > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>, > > > > > >>> or unsubscribe > > >>> < > > > https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4> > > > > > >>> . > > >>> You are receiving this because you authored the thread.Message ID: > > >>> ***@***.***> > > >>> > > >> > > >> > > >> -- > > >> Guilherme LANDIM-SANTOS > > >> > > >> Engenheiro Florestal > > >> Behance > > >> > > >> > > > > > > -- > > > Guilherme LANDIM-SANTOS > > > > > > Engenheiro Florestal > > > Behance > > > > > > > > > > -- > > Guilherme LANDIM-SANTOS > > > > Engenheiro Florestal > > Behance > > > > — > > Reply to this email directly, view it on GitHub > > < > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>, > > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM> > > > . > > You are receiving this because you commented.Message ID: > > ***@***.***> > > > > > -- > > *______________________________* > > *Diego A. Quintero P.* > Data, Python and Mathematical modeling enthusiast. > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

daquinterop commented 8 months ago

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 401, in __get_result raise self._exception File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", line 170, in run management._Management__cultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Management__cultivars' On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero ***@***.***> wrote: > The cultivar is not defined in Management. It is defined in the Crop > class. > When you do ` Crop('soybean', '990004')`, you're specifying 990004 as the > cultivar. Trying to set the cultivar in the management is wrong. > > El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< > ***@***.***>) escribió: > > > Hello, Diego, how are you? > > > > I realize that in the management function when calling the cultivar it > is > > not recognized as part of the class. How can I adjust this bug to > > recognize > > the cultivar in management? > > The class also does not recognize the cultivar as part of the > experiment, > > even though it is declared in the function. > > > > Thanks! > > > > On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < > > ***@***.***> wrote: > > > > > Hello, Diego, how are you? > > > > > > Being able to orient the climatic and soil objects for each > management. > > > The problem is that the code encounters the error: > > > > > > Traceback (most recent call last): > > > File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in > > > > > > dssat.run(management_list_result, wth, crop, soil_profiles) > > > File > > > > > > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > > > > > > line 170, in run > > > management._Management__cultivars['CR'] = crop._CODE > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > AttributeError: 'list' object has no attribute > '_Management__cultivars' > > > > > > Process finished with exit code 1 > > > How to resolve this error? > > > This is my management code: > > > > > > crop = Crop('soybean', '990004') > > > def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): > > > management_list = [] > > > > > > for idx, row in argila_geodf.iterrows(): > > > # Obter o índice correspondente no DataFrame de perfis de solo > > > profile_index = idx % len(soil_profiles) > > > # Usar o perfil de solo correspondente ao índice > > > soil_data = soil_profiles[profile_index] > > > > > > man = Management( > > > planting_date=datetime(2022, 10, 4), > > > irrigation='R', > > > harvest='M', > > > fertilization='D' > > > ) > > > > > > man.harvest_details["HDATE"] = 23046 > > > man.planting_details["PPOP"] = 30 > > > man.planting_details["PPOE"] = 30 > > > man.planting_details["PLRS"] = 45 > > > man.simulation_controls["CO2"] = 'M' > > > man.simulation_controls["WATER"] = 'Y' > > > man.simulation_controls["WAOUT"] = 'Y' > > > man.field['...........XCRD'] = row['geometry'].x > > > man.field['...........YCRD'] = row['geometry'].y > > > man.field['.............AREA'] = 30 > > > man.field['.SLAS'] = df_slope > > > man.field['.....ELEV'] = df_dem > > > man.field['WSTA....'] = wth > > > man.field['SLDP'] = soil_data > > > management_list.append(man) > > > return management_list > > > > > > management_list = make_man(argila_geodf, df_slope, df_dem, wth, > > soil_profiles) > > > for man in management_list: > > > print(man.field) > > > > > > > > > and this is my run > > > > > > > > > dssat = DSSAT() > > > dssat.setup() > > > wth = wth > > > crop = crop > > > management_list_result = management_list # Supondo que > management_list() > > retorna o objeto necessário > > > > > > # Executar a função run de dssat com os resultados das funções > > anteriores > > > dssat.run(management_list_result, wth, crop, soil_profiles) > > > plant_gro_results = dssat.output.get('PlantGro', {}) > > > df = pd.DataFrame(plant_gro_results) > > > > > > print(df) > > > > > > > > > > > > On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < > > > ***@***.***> wrote: > > > > > >> my keyboard autocorrects a lot of the time lol > > >> > > >> The error returns > > >> > > >> Traceback (most recent call last): > > >> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in > > >> > > >> dssat.run(make_soil(), wth, crop, make_man()) > > >> File > > >> > > > "C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py", > > > > > >> line 170, in run > > >> management._Management__cultivars['CR'] = crop._CODE > > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > >> AttributeError: 'list' object has no attribute > '_Management__cultivars' > > >> > > >> and this empty file: > > >> C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created. > > >> > > >> > > >> > > >> On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero ***@***.***> > > >> wrote: > > >> > > >>> what do you mean by culture? > > >>> > > >>> El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< > > >>> ***@***.***>) escribió: > > >>> > > >>> > Hi, Diego, > > >>> > > > >>> > How to insert culture into this loop? > > >>> > I didn't find the correct way to mention this object. > > >>> > > > >>> > Thanks! > > >>> > > > >>> > management_list = [] > > >>> > for idx in argila_geodf.index: > > >>> > row = argila_geodf.loc[idx] > > >>> > > > >>> > man = Management( > > >>> > planting_date=datetime(2022, 10, 4), > > >>> > irrigation='R', > > >>> > harvest='M', > > >>> > fertilization='D' > > >>> > ) > > >>> > > > >>> > man.harvest_details["HDATE"] = 23046 > > >>> > man.planting_details["PPOP"] = 30 > > >>> > man.planting_details["PPOE"] = 30 > > >>> > man.planting_details["PLRS"] = 45 > > >>> > man.simulation_controls["CO2"] = 'M' > > >>> > man.simulation_controls["WATER"] = 'Y' > > >>> > man.simulation_controls["WAOUT"] = 'Y' > > >>> > man.field['...........XCRD'] = row['geometry'].x > > >>> > man.field['...........YCRD'] = row['geometry'].y > > >>> > man.field['.............AREA'] = 30 > > >>> > man.field['.SLAS'] = df_slope > > >>> > man.field['.....ELEV'] = df_dem > > >>> > man.field['WSTA....'] = wth > > >>> > man.field['SLDP'] = argila[idx] > > >>> > management_list.append(man) > > >>> > > > >>> > manejo = management_list > > >>> > > > >>> > > > >>> > > > >>> > > > >>> > > > >>> > On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < > > >>> > ***@***.***> wrote: > > >>> > > > >>> > > Hello, Diego. > > >>> > > > > >>> > > Despite entering the weather into a loop, it returns empty > values. > > >>> But > > >>> > > using a single climate, and varying the soil, the values return > > the > > >>> > same. > > >>> > > Is there any way to make DSSAT run for imaging? I saw that > > >>> spatialDSSAT > > >>> > > exists, but it is not working... > > >>> > > I'm using different soil profiles per pixel, and the soil > output > > >>> varies > > >>> > in > > >>> > > LAT, LONG, and values. > > >>> > > > > >>> > > Again, I'm inserting the zip with my code. > > >>> > > > > >>> > > Thank you for your attention and support. > > >>> > > > > >>> > > On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < > > >>> > > ***@***.***> wrote: > > >>> > > > > >>> > >> What happens is that when you mention these variables, it > returns > > >>> an > > >>> > >> empty %TMP%... > > >>> > >> > > >>> > >> > > >>> > >> On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < > > >>> > >> ***@***.***> wrote: > > >>> > >> > > >>> > >>> Hello, Diego. After validating the soil, I changed the method > of > > >>> > >>> extracting the climate to: > > >>> > >>> > > >>> > >>> WTH_DATA = Weather( > > >>> > >>> data_weather_dssat, > > >>> > >>> {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': > 'SRAD', > > >>> > 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, > > >>> > >>> lat.iloc[0], > > >>> > >>> long.iloc[0], > > >>> > >>> elev > > >>> > >>> ) > > >>> > >>> > > >>> > >>> I also stated the x and y variables, as the climate > coordinates > > >>> were > > >>> > >>> being mentioned: > > >>> > >>> > > >>> > >>> man.field['...........XCRD'] = dfxy['x'] > > >>> > >>> man.field['...........YCRD'] = dfxy['y'] > > >>> > >>> # man.field['.............AREA'] = 14420000 > > >>> > >>> # man.field['.SLAS'] = df_slope > > >>> > >>> # man.field['.....ELEV'] = df_dem > > >>> > >>> # man.field['WSTA....'] = WTH_DATA > > >>> > >>> # man.field['SLDP'] = soil_profiles > > >>> > >>> > > >>> > >>> And I find this error > > >>> > >>> > > >>> > >>> > > >>> > >>> Traceback (most recent call last): > > >>> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line > 42, > > in > > >>> > >>> > > >>> > >>> thread = > > >>> > >>> > > >>> > int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0]) > > >>> > - 1 > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", > > > > > >>> > > >>> > > > >>> > >>> line 439, in result > > >>> > >>> return self.__get_result() > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\_base.py", > > > > > >>> > > >>> > > > >>> > >>> line 391, in __get_result > > >>> > >>> raise self._exception > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py", > > > > > >>> > > >>> > > > >>> > >>> line 58, in run > > >>> > >>> result = self.fn(*self.args, **self.kwargs) > > >>> > >>> File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line > 21, > > in > > >>> > >>> run_dssat > > >>> > >>> dssat_env.run(crop=crop, weather=WTH_DATA, management=man, > > >>> > >>> soil=soil_profiles) > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py", > > > > > >>> > > >>> > > > >>> > >>> line 216, in run > > >>> > >>> management.write(filename=management_filename) > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py", > > > > > >>> > > >>> > > > >>> > >>> line 325, in write > > >>> > >>> outstr += section_obj.write() + '\n' > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", > > > > > >>> > > >>> > > > >>> > >>> line 544, in write > > >>> > >>> outstr += rowbased_write( > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py", > > > > > >>> > > >>> > > > >>> > >>> line 336, in rowbased_write > > >>> > >>> if (fields[n] in NA_VALS) or (isna(fields[n])): > > >>> > >>> File > > >>> > >>> > > >>> > > > >>> > > > "C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py", > > > > > >>> > > >>> > > > >>> > >>> line 1527, in __nonzero__ > > >>> > >>> raise ValueError( > > >>> > >>> ValueError: The truth value of a Series is ambiguous. Use > > a.empty, > > >>> > >>> a.bool(), a.item(), a.any() or a.all(). > > >>> > >>> > > >>> > >>> Process finished with exit code 1 > > >>> > >>> > > >>> > >>> On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < > > >>> > >>> ***@***.***> wrote: > > >>> > >>> > > >>> > >>>> Thank you for your reply. I'm using different soil profiles, > as > > >>> if > > >>> > each > > >>> > >>>> input is a series of data. Is it correct to use this syntax? > > The > > >>> > climate > > >>> > >>>> didn't vary because it's the same place... I didn't know > about > > >>> this > > >>> > >>>> documentation, thank you very much! > > >>> > >>>> > > >>> > >>>> On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < > > >>> > >>>> ***@***.***> wrote: > > >>> > >>>> > > >>> > >>>>> I just took a look at the DSSAT weather file in the zip you > > >>> shared. > > >>> > >>>>> Units do not seem to be right for solar radiation, wind > speed, > > >>> and > > >>> > par. I > > >>> > >>>>> recommend you to take a look at the official DSSAT > > >>> documentation, > > >>> > >>>>> especially Volume 4 which is the CSM documentation. Also, > in > > >>> your > > >>> > >>>>> wheatercode file there is this dados_clima function. I see > > that > > >>> the > > >>> > >>>>> function would not return a different Weather object each > time > > >>> it > > >>> > runs. > > >>> > >>>>> Unless you're using different soil profiles, or different > > >>> planting > > >>> > dates > > >>> > >>>>> you'll get the same results each time you run the model. > So, > > >>> read > > >>> > DSSAT > > >>> > >>>>> documentation to make sure you understand the weather > input. > > >>> Then, > > >>> > debug > > >>> > >>>>> your code to make sure that it is creating different > > >>> experimental, > > >>> > weather, > > >>> > >>>>> and soil files if you are expecting it to do so. > > >>> > >>>>> > > >>> > >>>>> — > > >>> > >>>>> Reply to this email directly, view it on GitHub > > >>> > >>>>> < > > >>> > > > >>> > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>, > > > > > >>> > > >>> > > > >>> > >>>>> or unsubscribe > > >>> > >>>>> < > > >>> > > > >>> > > > https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM> > > > > > >>> > > >>> > > > >>> > >>>>> . > > >>> > >>>>> You are receiving this because you authored the > thread.Message > > >>> ID: > > >>> > >>>>> ***@***.***> > > >>> > >>>>> > > >>> > >>>> > > >>> > >>>> > > >>> > >>>> -- > > >>> > >>>> Guilherme LANDIM-SANTOS > > >>> > >>>> < > https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > > > >>> > >>>> Engenheiro Florestal > > >>> > >>>> Behance > > >>> > >>>> > > >>> > >>>> > > >>> > >>> > > >>> > >>> -- > > >>> > >>> Guilherme LANDIM-SANTOS > > >>> > >>> < > https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > > > >>> > >>> Engenheiro Florestal > > >>> > >>> Behance > > >>> > >>> > > >>> > >>> > > >>> > >> > > >>> > >> -- > > >>> > >> Guilherme LANDIM-SANTOS > > >>> > >> < > https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > >>> > >> Engenheiro Florestal > > >>> > >> Behance > > >>> > >> > > >>> > >> > > >>> > > > > >>> > > -- > > >>> > > Guilherme LANDIM-SANTOS > > >>> > > < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> > > > >>> > > Engenheiro Florestal > > >>> > > Behance > > >>> > > > > >>> > > > > >>> > > > >>> > -- > > >>> > Guilherme LANDIM-SANTOS > > >>> > > > >>> > Engenheiro Florestal > > >>> > Behance > > >>> > > > >>> > — > > >>> > Reply to this email directly, view it on GitHub > > >>> > < > > >>> > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>, > > > > > >>> > > >>> > or unsubscribe > > >>> > < > > >>> > > > https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA> > > > > > >>> > > >>> > . > > >>> > You are receiving this because you commented.Message ID: > > >>> > ***@***.***> > > >>> > > > >>> > > >>> > > >>> -- > > >>> > > >>> *______________________________* > > >>> > > >>> *Diego A. Quintero P.* > > >>> Data, Python and Mathematical modeling enthusiast. > > >>> > > >>> — > > >>> Reply to this email directly, view it on GitHub > > >>> < > > > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>, > > > > > >>> or unsubscribe > > >>> < > > > https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4> > > > > > >>> . > > >>> You are receiving this because you authored the thread.Message ID: > > >>> ***@***.***> > > >>> > > >> > > >> > > >> -- > > >> Guilherme LANDIM-SANTOS > > >> > > >> Engenheiro Florestal > > >> Behance > > >> > > >> > > > > > > -- > > > Guilherme LANDIM-SANTOS > > > > > > Engenheiro Florestal > > > Behance > > > > > > > > > > -- > > Guilherme LANDIM-SANTOS > > > > Engenheiro Florestal > > Behance > > > > — > > Reply to this email directly, view it on GitHub > > < > https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>, > > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM> > > > . > > You are receiving this because you commented.Message ID: > > ***@***.***> > > > > > -- > > *______________________________* > > *Diego A. Quintero P.* > Data, Python and Mathematical modeling enthusiast. > > — > Reply to this email directly, view it on GitHub > < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>, > or unsubscribe > < https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Guilherme LANDIM-SANTOS Engenheiro Florestal Behance

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU . You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

guilherber commented 8 months ago

Thanks for clarifying, I believed it would be possible to run multiple coordinates in a single experiment by just varying the handling. So, even though it is a single culture and climate, should I create the same spatial variation for climate and Crop?

Another question: Is spatialDSSAT already operational?

Thanks!

On Thu, Mar 21, 2024 at 11:06 AM Diego Quintero @.***> wrote:

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 401, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de solo

profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das funções

anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012393208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4EPPIOKYOWTPC5DAKKNVLYZLSN7AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM4TGMRQHA . You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

daquinterop commented 8 months ago

If you're not changing your cultivar and Weather then you can use the same Crop and Weather instances. spatialDSSAT runs CSM in spatial mode, About your question I can say that it works and I'm using it. However, I have not released it as a Python package cause it's still under development and the documentation is not complete now. You're free to use it though.

Running DSSAT in spatial mode signifies a little improvement in execution time. That's what I have witnessed on my tests at least. It's not a lot of improvement, but it is worth it your execution time is a limitation. I would not use it otherwise.

El jue, 21 mar 2024 a las 9:12, Guilherme Landim-Santos (< @.***>) escribió:

Thanks for clarifying, I believed it would be possible to run multiple coordinates in a single experiment by just varying the handling. So, even though it is a single culture and climate, should I create the same spatial variation for climate and Crop?

Another question: Is spatialDSSAT already operational?

Thanks!

On Thu, Mar 21, 2024 at 11:06 AM Diego Quintero @.***> wrote:

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\_base.py", line 401, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de solo

profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das funções

anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012393208>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AO4EPPIOKYOWTPC5DAKKNVLYZLSN7AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM4TGMRQHA>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012406237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKVRVQDHPD4CL2KGPE3YZLTDZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQYDMMRTG4 . You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

guilherber commented 8 months ago

Hello, Diego, how are you? Entering the coordinate is quite challenging. How can I enter the series of X and Y for each experiment knowing that they are unique elements? Thank you!

On Thu, Mar 21, 2024 at 11:25 AM Diego Quintero @.***> wrote:

If you're not changing your cultivar and Weather then you can use the same Crop and Weather instances. spatialDSSAT runs CSM in spatial mode, About your question I can say that it works and I'm using it. However, I have not released it as a Python package cause it's still under development and the documentation is not complete now. You're free to use it though.

Running DSSAT in spatial mode signifies a little improvement in execution time. That's what I have witnessed on my tests at least. It's not a lot of improvement, but it is worth it your execution time is a limitation. I would not use it otherwise.

El jue, 21 mar 2024 a las 9:12, Guilherme Landim-Santos (< @.***>) escribió:

Thanks for clarifying, I believed it would be possible to run multiple coordinates in a single experiment by just varying the handling. So, even though it is a single culture and climate, should I create the same spatial variation for climate and Crop?

Another question: Is spatialDSSAT already operational?

Thanks!

On Thu, Mar 21, 2024 at 11:06 AM Diego Quintero @.***> wrote:

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 401, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de

solo profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das

funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012393208>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIOKYOWTPC5DAKKNVLYZLSN7AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM4TGMRQHA>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012406237>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJXEPKVRVQDHPD4CL2KGPE3YZLTDZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQYDMMRTG4>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012439219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4EPPO3G6TPGLPMFM4DPB3YZLUWRAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQZTSMRRHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

guilherber commented 8 months ago

Sorry, I forgot to show you how I'm doing my code

import threading from copy import deepcopy

Função para rodar a simulação DSSAT em uma thread

def run_dssat(thread_index, soil_profile, weather, crop, man, output, lock): dssat_env = DSSAT() dssat_env.setup() dssat_env.run(soil_profile, weather, crop, man) with lock: output[thread_index] = dssat_env.output['PlantGro']

Função para adicionar as coordenadas X e Y de argila_geodf a man.field

def add_coordinates_to_man(index, x, y, man, lock): with lock: man.field[index]['...........XCRD'] = x man.field[index]['...........YCRD'] = y

Converter os geradores em listas

soil_profiles_list = list(soil_profiles)

Inicializando a lista de threads e o dicionário de saída

threads = len(soil_profileslist) output = [{} for in range(threads)] # Inicializa uma lista de dicionários vazios lock = threading.Lock() # Lock para acesso seguro ao output field_lock = threading.Lock() # Lock para acesso seguro ao man.field

Inicializando as threads e executando as simulações em paralelo

current_thread = 0 weather = wth # Assume-se que wth seja um único objeto for soil_profile in soil_profiles_list:

Acessa as coordenadas X e Y da geometria em cada iteração

x = argila_geodf.loc[current_thread, 'geometry'].x
y = argila_geodf.loc[current_thread, 'geometry'].y

# Criando uma nova thread para adicionar as coordenadas a man.field
thread = threading.Thread(
    target=add_coordinates_to_man,
    args=(current_thread, x, y, man, field_lock)
)
thread.start()
current_thread += 1

Espera todas as threads terminarem

for thread in threading.enumerate(): if thread != threading.current_thread(): thread.join()

On Thu, Mar 21, 2024 at 4:39 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you? Entering the coordinate is quite challenging. How can I enter the series of X and Y for each experiment knowing that they are unique elements? Thank you!

On Thu, Mar 21, 2024 at 11:25 AM Diego Quintero @.***> wrote:

If you're not changing your cultivar and Weather then you can use the same Crop and Weather instances. spatialDSSAT runs CSM in spatial mode, About your question I can say that it works and I'm using it. However, I have not released it as a Python package cause it's still under development and the documentation is not complete now. You're free to use it though.

Running DSSAT in spatial mode signifies a little improvement in execution time. That's what I have witnessed on my tests at least. It's not a lot of improvement, but it is worth it your execution time is a limitation. I would not use it otherwise.

El jue, 21 mar 2024 a las 9:12, Guilherme Landim-Santos (< @.***>) escribió:

Thanks for clarifying, I believed it would be possible to run multiple coordinates in a single experiment by just varying the handling. So, even though it is a single culture and climate, should I create the same spatial variation for climate and Crop?

Another question: Is spatialDSSAT already operational?

Thanks!

On Thu, Mar 21, 2024 at 11:06 AM Diego Quintero @.***> wrote:

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 401, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de

solo profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das

funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012393208>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIOKYOWTPC5DAKKNVLYZLSN7AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM4TGMRQHA>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012406237>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJXEPKVRVQDHPD4CL2KGPE3YZLTDZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQYDMMRTG4>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012439219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4EPPO3G6TPGLPMFM4DPB3YZLUWRAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQZTSMRRHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

guilherber commented 8 months ago

Hello, Diego, how are you? I achieved a very small "variability" of the experiments, of 1 number between some of them, but they all return the average. So I created a doubt: Does the climate necessarily have to be variable for all points? My data shows variable soil, but the same climate for the entire area.

Do both of them need to be variable, or would one of them necessarily present variability in relation to the average?

Thanks!

On Thu, Mar 21, 2024 at 4:42 PM Guilherme Landim Santos < @.***> wrote:

Sorry, I forgot to show you how I'm doing my code

import threading from copy import deepcopy

Função para rodar a simulação DSSAT em uma thread

def run_dssat(thread_index, soil_profile, weather, crop, man, output, lock): dssat_env = DSSAT() dssat_env.setup() dssat_env.run(soil_profile, weather, crop, man) with lock: output[thread_index] = dssat_env.output['PlantGro']

Função para adicionar as coordenadas X e Y de argila_geodf a man.field

def add_coordinates_to_man(index, x, y, man, lock): with lock: man.field[index]['...........XCRD'] = x man.field[index]['...........YCRD'] = y

Converter os geradores em listas

soil_profiles_list = list(soil_profiles)

Inicializando a lista de threads e o dicionário de saída

threads = len(soil_profileslist) output = [{} for in range(threads)] # Inicializa uma lista de dicionários vazios lock = threading.Lock() # Lock para acesso seguro ao output field_lock = threading.Lock() # Lock para acesso seguro ao man.field

Inicializando as threads e executando as simulações em paralelo

current_thread = 0 weather = wth # Assume-se que wth seja um único objeto for soil_profile in soil_profiles_list:

Acessa as coordenadas X e Y da geometria em cada iteração

x = argila_geodf.loc[current_thread, 'geometry'].x
y = argila_geodf.loc[current_thread, 'geometry'].y

# Criando uma nova thread para adicionar as coordenadas a man.field
thread = threading.Thread(
    target=add_coordinates_to_man,
    args=(current_thread, x, y, man, field_lock)
)
thread.start()
current_thread += 1

Espera todas as threads terminarem

for thread in threading.enumerate(): if thread != threading.current_thread(): thread.join()

On Thu, Mar 21, 2024 at 4:39 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you? Entering the coordinate is quite challenging. How can I enter the series of X and Y for each experiment knowing that they are unique elements? Thank you!

On Thu, Mar 21, 2024 at 11:25 AM Diego Quintero @.***> wrote:

If you're not changing your cultivar and Weather then you can use the same Crop and Weather instances. spatialDSSAT runs CSM in spatial mode, About your question I can say that it works and I'm using it. However, I have not released it as a Python package cause it's still under development and the documentation is not complete now. You're free to use it though.

Running DSSAT in spatial mode signifies a little improvement in execution time. That's what I have witnessed on my tests at least. It's not a lot of improvement, but it is worth it your execution time is a limitation. I would not use it otherwise.

El jue, 21 mar 2024 a las 9:12, Guilherme Landim-Santos (< @.***>) escribió:

Thanks for clarifying, I believed it would be possible to run multiple coordinates in a single experiment by just varying the handling. So, even though it is a single culture and climate, should I create the same spatial variation for climate and Crop?

Another question: Is spatialDSSAT already operational?

Thanks!

On Thu, Mar 21, 2024 at 11:06 AM Diego Quintero @.***> wrote:

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 401, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de

solo profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das

funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012393208>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIOKYOWTPC5DAKKNVLYZLSN7AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM4TGMRQHA>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012406237>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJXEPKVRVQDHPD4CL2KGPE3YZLTDZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQYDMMRTG4>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012439219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4EPPO3G6TPGLPMFM4DPB3YZLUWRAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQZTSMRRHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

daquinterop commented 8 months ago

I'm afraid I have not an answer for that. It depends on the type of analysis you're doing and whatever makes sense to you. I'll close this Issue. If you have more questions you can send me an email.

El vie, 22 mar 2024 a las 10:05, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you? I achieved a very small "variability" of the experiments, of 1 number between some of them, but they all return the average. So I created a doubt: Does the climate necessarily have to be variable for all points? My data shows variable soil, but the same climate for the entire area.

Do both of them need to be variable, or would one of them necessarily present variability in relation to the average?

Thanks!

On Thu, Mar 21, 2024 at 4:42 PM Guilherme Landim Santos < @.***> wrote:

Sorry, I forgot to show you how I'm doing my code

import threading from copy import deepcopy

Função para rodar a simulação DSSAT em uma thread

def run_dssat(thread_index, soil_profile, weather, crop, man, output, lock): dssat_env = DSSAT() dssat_env.setup() dssat_env.run(soil_profile, weather, crop, man) with lock: output[thread_index] = dssat_env.output['PlantGro']

Função para adicionar as coordenadas X e Y de argila_geodf a man.field

def add_coordinates_to_man(index, x, y, man, lock): with lock: man.field[index]['...........XCRD'] = x man.field[index]['...........YCRD'] = y

Converter os geradores em listas

soil_profiles_list = list(soil_profiles)

Inicializando a lista de threads e o dicionário de saída

threads = len(soil_profileslist) output = [{} for in range(threads)] # Inicializa uma lista de dicionários vazios lock = threading.Lock() # Lock para acesso seguro ao output field_lock = threading.Lock() # Lock para acesso seguro ao man.field

Inicializando as threads e executando as simulações em paralelo

current_thread = 0 weather = wth # Assume-se que wth seja um único objeto for soil_profile in soil_profiles_list:

Acessa as coordenadas X e Y da geometria em cada iteração

x = argila_geodf.loc[current_thread, 'geometry'].x y = argila_geodf.loc[current_thread, 'geometry'].y

Criando uma nova thread para adicionar as coordenadas a man.field

thread = threading.Thread( target=add_coordinates_to_man, args=(current_thread, x, y, man, field_lock) ) thread.start() current_thread += 1

Espera todas as threads terminarem

for thread in threading.enumerate(): if thread != threading.current_thread(): thread.join()

On Thu, Mar 21, 2024 at 4:39 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you? Entering the coordinate is quite challenging. How can I enter the series of X and Y for each experiment knowing that they are unique elements? Thank you!

On Thu, Mar 21, 2024 at 11:25 AM Diego Quintero @.***> wrote:

If you're not changing your cultivar and Weather then you can use the same Crop and Weather instances. spatialDSSAT runs CSM in spatial mode, About your question I can say that it works and I'm using it. However, I have not released it as a Python package cause it's still under development and the documentation is not complete now. You're free to use it though.

Running DSSAT in spatial mode signifies a little improvement in execution time. That's what I have witnessed on my tests at least. It's not a lot of improvement, but it is worth it your execution time is a limitation. I would not use it otherwise.

El jue, 21 mar 2024 a las 9:12, Guilherme Landim-Santos (< @.***>) escribió:

Thanks for clarifying, I believed it would be possible to run multiple coordinates in a single experiment by just varying the handling. So, even though it is a single culture and climate, should I create the same spatial variation for climate and Crop?

Another question: Is spatialDSSAT already operational?

Thanks!

On Thu, Mar 21, 2024 at 11:06 AM Diego Quintero @.***> wrote:

This library does not run CSM using the Spatial mode. It runs CSM in a single-experiment mode. To run a spatial analysis you'd have to create multiple instances of management, crop, weather, and soil (one per spatial unit e.g. pixel, region, etc.). I guess that's what you're trying to do when defining a Management list.

I see that your error is because when you're doing dssat.run(management_list_result, wth, crop, soil_profiles) you're not passing a Management instance, you're passing a list. You must pass to that method one single Management instance, not a list of management instances.

El jue, 21 mar 2024 a las 8:59, Guilherme Landim-Santos (< @.***>) escribió:

From what I understand from the csm v4 documentation, to analyze spatially I would need to declare all the necessary coordinates, and then direct the elements to each pixel... Would the cultivar also fit into this configuration? See this print of how I am configuring the handling. Crop is in the Crop class. [image: image.png] Thank you for your incredible work

On Thu, Mar 21, 2024 at 10:54 AM Guilherme Landim Santos < @.***> wrote:

Hello, thanks for your response. I understand that the cultivar is part of the Crop class. But when configuring management, the cultivar is not recognized... How does the management class use the Crop parameters? And how can I declare it in this configuration? See the error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 36, in

thread = int(future.result()['Profile'].str.extract('(\d+)').iloc[0].iloc[0]) - 1 ^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures_base.py",

line 401, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 22, in run_dssat dssat_env.run(crop=crop, weather=wth, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

On Thu, Mar 21, 2024 at 10:51 AM Diego Quintero @.***> wrote:

The cultivar is not defined in Management. It is defined in the Crop class. When you do Crop('soybean', '990004'), you're specifying 990004 as the cultivar. Trying to set the cultivar in the management is wrong.

El jue, 21 mar 2024 a las 8:47, Guilherme Landim-Santos (< @.***>) escribió:

Hello, Diego, how are you?

I realize that in the management function when calling the cultivar it is not recognized as part of the class. How can I adjust this bug to recognize the cultivar in management? The class also does not recognize the cultivar as part of the experiment, even though it is declared in the function.

Thanks!

On Wed, Mar 20, 2024 at 12:48 PM Guilherme Landim Santos < @.***> wrote:

Hello, Diego, how are you?

Being able to orient the climatic and soil objects for each management. The problem is that the code encounters the error:

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 177, in

dssat.run(management_list_result, wth, crop, soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

Process finished with exit code 1 How to resolve this error? This is my management code:

crop = Crop('soybean', '990004') def make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles): management_list = []

for idx, row in argila_geodf.iterrows():

Obter o índice correspondente no DataFrame de perfis de

solo profile_index = idx % len(soil_profiles)

Usar o perfil de solo correspondente ao índice

soil_data = soil_profiles[profile_index]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = soil_data management_list.append(man) return management_list

management_list = make_man(argila_geodf, df_slope, df_dem, wth, soil_profiles) for man in management_list: print(man.field)

and this is my run

dssat = DSSAT() dssat.setup() wth = wth crop = crop management_list_result = management_list # Supondo que management_list() retorna o objeto necessário

Executar a função run de dssat com os resultados das

funções anteriores dssat.run(management_list_result, wth, crop, soil_profiles) plant_gro_results = dssat.output.get('PlantGro', {}) df = pd.DataFrame(plant_gro_results)

print(df)

On Tue, Mar 19, 2024 at 8:45 AM Guilherme Landim Santos < @.***> wrote:

my keyboard autocorrects a lot of the time lol

The error returns

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 229, in

dssat.run(make_soil(), wth, crop, make_man()) File

"C:\Users\Usuario\anaconda3\envs\myenv\Lib\site-packages\DSSATTools\run.py",

line 170, in run management._Managementcultivars['CR'] = crop._CODE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute '_Managementcultivars'

and this empty file: C:\Users\Usuario\AppData\Local\Temp\dssatdhuzilta created.

On Mon, Mar 18, 2024 at 5:45 PM Diego Quintero @.***> wrote:

what do you mean by culture?

El lun, 18 mar 2024 a las 14:24, Guilherme Landim-Santos (< @.***>) escribió:

Hi, Diego,

How to insert culture into this loop? I didn't find the correct way to mention this object.

Thanks!

management_list = [] for idx in argila_geodf.index: row = argila_geodf.loc[idx]

man = Management( planting_date=datetime(2022, 10, 4), irrigation='R', harvest='M', fertilization='D' )

man.harvest_details["HDATE"] = 23046 man.planting_details["PPOP"] = 30 man.planting_details["PPOE"] = 30 man.planting_details["PLRS"] = 45 man.simulation_controls["CO2"] = 'M' man.simulation_controls["WATER"] = 'Y' man.simulation_controls["WAOUT"] = 'Y' man.field['...........XCRD'] = row['geometry'].x man.field['...........YCRD'] = row['geometry'].y man.field['.............AREA'] = 30 man.field['.SLAS'] = df_slope man.field['.....ELEV'] = df_dem man.field['WSTA....'] = wth man.field['SLDP'] = argila[idx] management_list.append(man)

manejo = management_list

On Tue, Mar 12, 2024 at 10:05 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego.

Despite entering the weather into a loop, it returns empty values. But using a single climate, and varying the soil, the values return the same. Is there any way to make DSSAT run for imaging? I saw that spatialDSSAT exists, but it is not working... I'm using different soil profiles per pixel, and the soil output varies in LAT, LONG, and values.

Again, I'm inserting the zip with my code.

Thank you for your attention and support.

On Mon, Mar 11, 2024 at 2:35 PM Guilherme Landim Santos < @.***> wrote:

What happens is that when you mention these variables, it returns an empty %TMP%...

On Mon, Mar 11, 2024 at 11:41 AM Guilherme Landim Santos < @.***> wrote:

Hello, Diego. After validating the soil, I changed the method of extracting the climate to:

WTH_DATA = Weather( data_weather_dssat, {'TMIN': 'TMIN', 'TMAX': 'TMAX', 'RAIN': 'RAIN', 'SRAD': 'SRAD', 'RHUM': 'RHUM', 'WIND':'WIND', 'DEWP':'DEWP', 'PAR':'PAR'}, lat.iloc[0], long.iloc[0], elev )

I also stated the x and y variables, as the climate coordinates were being mentioned:

man.field['...........XCRD'] = dfxy['x'] man.field['...........YCRD'] = dfxy['y']

man.field['.............AREA'] = 14420000

man.field['.SLAS'] = df_slope

man.field['.....ELEV'] = df_dem

man.field['WSTA....'] = WTH_DATA

man.field['SLDP'] = soil_profiles

And I find this error

Traceback (most recent call last): File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 42, in

thread =

int(future.result()['Profile'].str.extract('(\d+)').iloc[0:].iloc[0])

  • 1

    File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 439, in result return self.__get_result() File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures_base.py",

line 391, in __get_result raise self._exception File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\concurrent\futures\thread.py",

line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\CROPMAN_DEV\proj_dssatt\DSSATTools\main.py", line 21, in run_dssat dssat_env.run(crop=crop, weather=WTH_DATA, management=man, soil=soil_profiles) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\run.py",

line 216, in run management.write(filename=management_filename) File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\management.py",

line 325, in write outstr += section_obj.write() + '\n' File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 544, in write outstr += rowbased_write( File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\DSSATTools\base\sections.py",

line 336, in rowbased_write if (fields[n] in NA_VALS) or (isna(fields[n])): File

"C:\Users\Usuario\anaconda3\envs\conda_env\lib\site-packages\pandas\core\generic.py",

line 1527, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Process finished with exit code 1

On Fri, Mar 8, 2024 at 1:31 PM Guilherme Landim Santos < @.***> wrote:

Thank you for your reply. I'm using different soil profiles, as if each input is a series of data. Is it correct to use this syntax? The climate didn't vary because it's the same place... I didn't know about this documentation, thank you very much!

On Fri, Mar 8, 2024 at 12:30 PM Diego Quintero < @.***> wrote:

I just took a look at the DSSAT weather file in the zip you shared. Units do not seem to be right for solar radiation, wind speed, and par. I recommend you to take a look at the official DSSAT documentation, especially Volume 4 which is the CSM documentation. Also, in your wheatercode file there is this dados_clima function. I see that the function would not return a different Weather object each time it runs. Unless you're using different soil profiles, or different planting dates you'll get the same results each time you run the model. So, read DSSAT documentation to make sure you understand the weather input. Then, debug your code to make sure that it is creating different experimental, weather, and soil files if you are expecting it to do so.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-1985899653>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIZYTJVZ6PET5Q25STYXHKS5AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA4TSNRVGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS <

https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS <

https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS <

https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004747400>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVBT6ISM7P7XUBKGUDYY45PNAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUG42DONBQGA>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2004955087>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPOCLE4TY4ZGOK46WLTYY5G6XAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHE2TKMBYG4>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/> Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012353223>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV4ELCTDNIKAR4GM3TYZLQI3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM2TGMRSGM>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012360431>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPMHHAVQXGEJZGEDOUTYZLQVZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3DANBTGE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS < https://www.linkedin.com/in/guilherme-landim-santos-676152162/>

Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/

Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012376855>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKV7CZTQ5UWMEFR2BFTYZLRS3AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TMOBVGU>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012393208>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AO4EPPIOKYOWTPC5DAKKNVLYZLSN7AVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM4TGMRQHA>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub <

https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012406237>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXEPKVRVQDHPD4CL2KGPE3YZLTDZAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQYDMMRTG4>

. You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.

— Reply to this email directly, view it on GitHub < https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2012439219>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AO4EPPO3G6TPGLPMFM4DPB3YZLUWRAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGQZTSMRRHE>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

-- Guilherme LANDIM-SANTOS https://www.linkedin.com/in/guilherme-landim-santos-676152162/ Engenheiro Florestal Behance https://www.behance.net/guilherber

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/28#issuecomment-2015299682, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKTMYLNTZBLIGQPEOF3YZRCFHAVCNFSM6AAAAABEALWGV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJVGI4TSNRYGI . You are receiving this because you commented.Message ID: @.***>

--

__

Diego A. Quintero P. Data, Python and Mathematical modeling enthusiast.