Re: [GRASS-user] r.futures.demand

2022-09-26 Thread Mitchell Meads via grass-user
Hi Anna,

Sorry for the late reply myself but to answer your question; yes. Some of
the subregions do have no developed cells? Could this be my issue and, if
so, is there a workaround?

Thanks,
Mitchell Meads, PhD Student
Texas A University at Galveston
Marine & Coastal Management Sciences; IDRT 
Contact: mitchell.me...@tamu.edu; (832) 619-0729





On Wed, Sep 14, 2022 at 10:21 AM Anna Petrášová 
wrote:

> Sorry for late reply, is it possible one of the subregions has no
> developed cells? On Thu, Sep 1, 2022, 9: 31 PM Mitchell Meads via
> grass-user  wrote: Hi, I'm currently
> attempting to use the futures extension
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
>
> ZjQcmQRYFpfptBannerEnd
> Sorry for late reply, is it possible one of the subregions has no
> developed cells?
>
> On Thu, Sep 1, 2022, 9:31 PM Mitchell Meads via grass-user <
> grass-user@lists.osgeo.org> wrote:
>
>> Hi,
>>
>> I'm currently attempting to use the futures extension in GRASS 7.8.5 and
>> I'm having some issues with the r.futures.demand extension. The error is
>> reading as such:
>>
>>
>>
>>
>>
>>
>>
>>
>> *Traceback (most recent call last):  File
>> "C:\Users\mitchell.meads\AppData\Roaming\GRASS7\addons/scripts/r.futures.demand.py
>> ",
>> line 443, in sys.exit(main())  File
>> "C:\Users\mitchell.meads\AppData\Roaming\GRASS7\addons/scripts/r.futures.demand.py
>> ",
>> line 172, in mainsubregionId, developed_cells = stats[0],
>> int(stats[12])ValueError: invalid literal for int() with base 10: 'nan'*
>>
>>
>> I believe the addon of r.futures.demand is having an issue reading my
>> data, however, I have the population trend and projection CSV files
>> formatted correctly, according to the manual. If you could please identify
>> a potential cause or solution to this error, please let me know.
>>
>> Additionally, if you need anything else, I'm happy to share whatever I
>> have.
>>
>>
>> Thanks,
>> Mitchell Meads, PhD Student
>> Texas A University at Galveston
>> Marine & Coastal Management Sciences; IDRT 
>> Contact: mitchell.me...@tamu.edu; (832) 619-0729
>>
>>
>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>> 
>>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.futures.demand

2022-09-14 Thread Anna Petrášová
Sorry for late reply, is it possible one of the subregions has no developed
cells?

On Thu, Sep 1, 2022, 9:31 PM Mitchell Meads via grass-user <
grass-user@lists.osgeo.org> wrote:

> Hi,
>
> I'm currently attempting to use the futures extension in GRASS 7.8.5 and
> I'm having some issues with the r.futures.demand extension. The error is
> reading as such:
>
>
>
>
>
>
>
>
> *Traceback (most recent call last):  File
> "C:\Users\mitchell.meads\AppData\Roaming\GRASS7\addons/scripts/r.futures.demand.py
> ", line 443, in sys.exit(main())
> File
> "C:\Users\mitchell.meads\AppData\Roaming\GRASS7\addons/scripts/r.futures.demand.py
> ", line 172, in mainsubregionId,
> developed_cells = stats[0], int(stats[12])ValueError: invalid literal for
> int() with base 10: 'nan'*
>
>
> I believe the addon of r.futures.demand is having an issue reading my
> data, however, I have the population trend and projection CSV files
> formatted correctly, according to the manual. If you could please identify
> a potential cause or solution to this error, please let me know.
>
> Additionally, if you need anything else, I'm happy to share whatever I
> have.
>
>
> Thanks,
> Mitchell Meads, PhD Student
> Texas A University at Galveston
> Marine & Coastal Management Sciences; IDRT 
> Contact: mitchell.me...@tamu.edu; (832) 619-0729
>
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.futures.demand

2021-02-11 Thread Anna Petrášová
On Thu, Feb 11, 2021 at 3:14 PM Mitchell Meads 
wrote:

> Hi Anna,
>
> Thank you for the helpful information! I suppose I was somewhat confused
> as to what exactly should all be in the parameters for the
> r.futures.potential submodel. I've made the changes you've suggested above,
> but I'm still getting some type of "Unable to select cursor" error. Below
> is the command output with its errors, if you could help me pin down what
> I'm doing wrong, that would be great! Also on a side note, unfortunately,
> I'm not experienced in R and and somewhat relying on the futures modeling
> in GRASS to complete my task. Thanks again for your help!
>
> (Thu Feb 11 13:11:21 2021)
>
> r.futures.potential --overwrite input=sampling_f_km@PERMANENT
> output=potential_f_km.csv
> columns=devclip_2016,block_rast,county_rast,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_2001_km,dist_toh20_2004_km,dist_toh20_2006,dist_toh20_2008_km,dist_toh20_2011_km,dist_toh20_2013_km,dist_toh20_2016_km,per_forest_2001,per_forest_2004,per_forest_2006,per_forest_2008,per_forest_2011,per_forest_2013,per_forest_2016,urban_change_01_16
> developed_column=devclip_2016 subregions_column=county_rast min_variables=5
> max_variables=10
> Computing model...
> WARNING: fixed-effect model matrix is rank deficient so dropping 2 columns
> / coefficients
> Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev =
> compDev,  :
> pwrssUpdate did not converge in (maxit) iterations
> Calls: glmer ...  ->  -> stopifnot -> fn ->
> pwrssUpdate
> In addition: Warning message:
> Some predictor variables are on very different scales: consider rescaling
> Execution halted
> WARNING: fixed-effect model matrix is rank deficient so dropping 2 columns
> / coefficients
> Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev =
> compDev,  :
> pwrssUpdate did not converge in (maxit) iterations
> Calls: glmer ...  ->  -> stopifnot -> fn ->
> pwrssUpdate
> In addition: Warning message:
> Some predictor variables are on very different scales: consider rescaling
> Execution halted
> ERROR: Running R script failed, check messages above
> (Thu Feb 11 13:11:25 2021) Command finished (3 sec)
>
> (Thu Feb 11 14:09:43 2021)
>
> r.futures.potential -d --overwrite input=sampling_f_km@PERMANENT
> output=potential_f_km.csv
> columns=devclip_2016,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_2016_km,per_forest_2016,
>
>

looks like you have an extra comma after per_forest_2016? What
is devclip_2016?


> developed_column=urban_change_01_16 subregions_column=county_rast
> min_variables=2 max_variables=6
> DBMI-SQLite driver error:
> Error in sqlite3_prepare():
> SELECT devclip_2016,devpress_0_5_2016,dist_to_evac_km,dist_t
> o_pp_km,dist_toh20_2016_km,per_forest_2016,,urban_change_01_
> 16,county_rast FROM sampling_f_km WHERE devclip_2016 IS NOT
> NULL AND devpress_0_5_2016 IS NOT NULL AND dist_to_evac_km
> IS NOT NULL AND dist_to_pp_km IS NOT NULL AND
> dist_toh20_2016_km IS NOT NULL AND per_forest_2016 IS NOT
> NULL AND  IS NOT NULL AND urban_change_01_16 IS NOT NULL AND
> county_rast IS NOT NULL
> near ",": syntax error
> DBMI-SQLite driver error:
> Error in sqlite3_prepare():
> SELECT devclip_2016,devpress_0_5_2016,dist_to_evac_km,dist_t
> o_pp_km,dist_toh20_2016_km,per_forest_2016,,urban_change_01_
> 16,county_rast FROM sampling_f_km WHERE devclip_2016 IS NOT
> NULL AND devpress_0_5_2016 IS NOT NULL AND dist_to_evac_km
> IS NOT NULL AND dist_to_pp_km IS NOT NULL AND
> dist_toh20_2016_km IS NOT NULL AND per_forest_2016 IS NOT
> NULL AND  IS NOT NULL AND urban_change_01_16 IS NOT NULL AND
> county_rast IS NOT NULL
> near ",": syntax error
> ERROR: Unable to open select cursor
> Traceback (most recent call last):
>   File "/Users/mitchellmeads/Library/GRASS/7.8/Modules/scrip
> ts/r.futures.potential", line 221, in 
> sys.exit(main())
>   File "/Users/mitchellmeads/Library/GRASS/7.8/Modules/scrip
> ts/r.futures.potential", line 181, in main
> gscript.run_command('v.db.select', map=vinput,
> columns=columns, separator='comma', where=where,
> file=TMP_CSV)
>   File "/Applications/GRASS-7.8.app/Contents/Resources/etc/p
> ython/grass/script/core.py", line 441, in run_command
> return handle_errors(returncode, returncode, args,
> kwargs)
>   File "/Applications/GRASS-7.8.app/Contents/Resources/etc/p
> ython/grass/script/core.py", line 342, in handle_errors
> raise CalledModuleError(module=None, code=code,
> grass.exceptions.CalledModuleError: Module run None
> v.db.select map=sampling_f_km@PERMANENT columns=devclip_2016
> ,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_
> 2016_km,per_forest_2016,,urban_change_01_16,county_rast
> separator=comma where=devclip_2016 IS NOT NULL AND
> devpress_0_5_2016 IS NOT NULL AND dist_to_evac_km IS NOT
> NULL AND dist_to_pp_km IS NOT NULL AND dist_toh20_2016_km IS
> NOT NULL AND per_forest_2016 IS NOT NULL AND  IS NOT NULL
> AND urban_change_01_16 IS NOT NULL AND county_rast 

Re: [GRASS-user] r.futures.demand

2021-02-11 Thread Mitchell Meads
Hi Anna,

Thank you for the helpful information! I suppose I was somewhat confused as
to what exactly should all be in the parameters for the r.futures.potential
submodel. I've made the changes you've suggested above, but I'm still
getting some type of "Unable to select cursor" error. Below is the command
output with its errors, if you could help me pin down what I'm doing wrong,
that would be great! Also on a side note, unfortunately, I'm not
experienced in R and and somewhat relying on the futures modeling in GRASS
to complete my task. Thanks again for your help!

(Thu Feb 11 13:11:21 2021)

r.futures.potential --overwrite input=sampling_f_km@PERMANENT
output=potential_f_km.csv
columns=devclip_2016,block_rast,county_rast,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_2001_km,dist_toh20_2004_km,dist_toh20_2006,dist_toh20_2008_km,dist_toh20_2011_km,dist_toh20_2013_km,dist_toh20_2016_km,per_forest_2001,per_forest_2004,per_forest_2006,per_forest_2008,per_forest_2011,per_forest_2013,per_forest_2016,urban_change_01_16
developed_column=devclip_2016 subregions_column=county_rast min_variables=5
max_variables=10
Computing model...
WARNING: fixed-effect model matrix is rank deficient so dropping 2 columns
/ coefficients
Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev =
compDev,  :
pwrssUpdate did not converge in (maxit) iterations
Calls: glmer ...  ->  -> stopifnot -> fn ->
pwrssUpdate
In addition: Warning message:
Some predictor variables are on very different scales: consider rescaling
Execution halted
WARNING: fixed-effect model matrix is rank deficient so dropping 2 columns
/ coefficients
Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev =
compDev,  :
pwrssUpdate did not converge in (maxit) iterations
Calls: glmer ...  ->  -> stopifnot -> fn ->
pwrssUpdate
In addition: Warning message:
Some predictor variables are on very different scales: consider rescaling
Execution halted
ERROR: Running R script failed, check messages above
(Thu Feb 11 13:11:25 2021) Command finished (3 sec)

(Thu Feb 11 14:09:43 2021)

r.futures.potential -d --overwrite input=sampling_f_km@PERMANENT
output=potential_f_km.csv
columns=devclip_2016,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_2016_km,per_forest_2016,
developed_column=urban_change_01_16 subregions_column=county_rast
min_variables=2 max_variables=6
DBMI-SQLite driver error:
Error in sqlite3_prepare():
SELECT devclip_2016,devpress_0_5_2016,dist_to_evac_km,dist_t
o_pp_km,dist_toh20_2016_km,per_forest_2016,,urban_change_01_
16,county_rast FROM sampling_f_km WHERE devclip_2016 IS NOT
NULL AND devpress_0_5_2016 IS NOT NULL AND dist_to_evac_km
IS NOT NULL AND dist_to_pp_km IS NOT NULL AND
dist_toh20_2016_km IS NOT NULL AND per_forest_2016 IS NOT
NULL AND  IS NOT NULL AND urban_change_01_16 IS NOT NULL AND
county_rast IS NOT NULL
near ",": syntax error
DBMI-SQLite driver error:
Error in sqlite3_prepare():
SELECT devclip_2016,devpress_0_5_2016,dist_to_evac_km,dist_t
o_pp_km,dist_toh20_2016_km,per_forest_2016,,urban_change_01_
16,county_rast FROM sampling_f_km WHERE devclip_2016 IS NOT
NULL AND devpress_0_5_2016 IS NOT NULL AND dist_to_evac_km
IS NOT NULL AND dist_to_pp_km IS NOT NULL AND
dist_toh20_2016_km IS NOT NULL AND per_forest_2016 IS NOT
NULL AND  IS NOT NULL AND urban_change_01_16 IS NOT NULL AND
county_rast IS NOT NULL
near ",": syntax error
ERROR: Unable to open select cursor
Traceback (most recent call last):
  File "/Users/mitchellmeads/Library/GRASS/7.8/Modules/scrip
ts/r.futures.potential", line 221, in 
sys.exit(main())
  File "/Users/mitchellmeads/Library/GRASS/7.8/Modules/scrip
ts/r.futures.potential", line 181, in main
gscript.run_command('v.db.select', map=vinput,
columns=columns, separator='comma', where=where,
file=TMP_CSV)
  File "/Applications/GRASS-7.8.app/Contents/Resources/etc/p
ython/grass/script/core.py", line 441, in run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "/Applications/GRASS-7.8.app/Contents/Resources/etc/p
ython/grass/script/core.py", line 342, in handle_errors
raise CalledModuleError(module=None, code=code,
grass.exceptions.CalledModuleError: Module run None
v.db.select map=sampling_f_km@PERMANENT columns=devclip_2016
,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_
2016_km,per_forest_2016,,urban_change_01_16,county_rast
separator=comma where=devclip_2016 IS NOT NULL AND
devpress_0_5_2016 IS NOT NULL AND dist_to_evac_km IS NOT
NULL AND dist_to_pp_km IS NOT NULL AND dist_toh20_2016_km IS
NOT NULL AND per_forest_2016 IS NOT NULL AND  IS NOT NULL
AND urban_change_01_16 IS NOT NULL AND county_rast IS NOT
NULL file=/Volumes/Extreme
SSD/grassdata/forecast2/PERMANENT/.tmp/Mitchells-MacBook-
Pro.local/49600.0.csv ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
(Thu Feb 11 14:09:44 2021) Command finished (0 sec)




Cheers,
Mitchell Meads, PhD Student
Texas A University at Galveston

Re: [GRASS-user] r.futures.demand

2021-02-11 Thread Anna Petrášová
Hi Mitchell,

looking at your command there are several things to fix. Parameter columns
should have only the predictors, so for example remove county_rast and
urban_change_01_16. Parameter developed_column should be the response
variable, so I suppose urban_change_01_16 is the one to use here. Lastly,
without the dredge mode only use combination of predictors that are not
correlated and don't represent the same info, for example, do not include
dist_toh20_2001_km,dist_toh20_2004_km,dist_toh20_2006,dist_toh20_2008_km,dist_toh20_2011_km,dist_toh20_2013_km,dist_toh20_2016_km,
since these all represent the same variable (I suppose). Without the dredge
mode, all provided predictors will be used in the model, with the dredge
mode, it will try different combinations and return the best model.

Note r.futures.potential is basically just a wrapper around R glmer (lme4)
function, so if you are familiar with R, you can experiment with finding a
model directly in R if you need more flexibility etc.

Please keep the conversation on this mailing list which is archived, so
that others can add to it or benefit from it later.

Best,
Anna

On Thu, Feb 11, 2021 at 2:12 PM Mitchell Meads 
wrote:

> Hi Anna,
>
> I've revisited the r.futures.potential submodel for the futures modeling
> and I still can't get the r.futures.potential submodel to run. I've
> rescaled my variables so they all should be on a similar scale but the
> program is telling me that the variables are still not in appropriate scale
> along with some other error messages that I have copied below. Please let
> me know what you think I'm doing wrong.
>
> (Thu Feb 11 13:11:21 2021)
>
> r.futures.potential --overwrite input=sampling_f_km@PERMANENT
> output=potential_f_km.csv
> columns=devclip_2016,block_rast,county_rast,devpress_0_5_2016,dist_to_evac_km,dist_to_pp_km,dist_toh20_2001_km,dist_toh20_2004_km,dist_toh20_2006,dist_toh20_2008_km,dist_toh20_2011_km,dist_toh20_2013_km,dist_toh20_2016_km,per_forest_2001,per_forest_2004,per_forest_2006,per_forest_2008,per_forest_2011,per_forest_2013,per_forest_2016,urban_change_01_16
> developed_column=devclip_2016 subregions_column=county_rast min_variables=5
> max_variables=10
> Computing model...
> WARNING: fixed-effect model matrix is rank deficient so dropping 2 columns
> / coefficients
> Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev =
> compDev,  :
> pwrssUpdate did not converge in (maxit) iterations
> Calls: glmer ...  ->  -> stopifnot -> fn ->
> pwrssUpdate
> In addition: Warning message:
> Some predictor variables are on very different scales: consider rescaling
> Execution halted
> WARNING: fixed-effect model matrix is rank deficient so dropping 2 columns
> / coefficients
> Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev =
> compDev,  :
> pwrssUpdate did not converge in (maxit) iterations
> Calls: glmer ...  ->  -> stopifnot -> fn ->
> pwrssUpdate
> In addition: Warning message:
> Some predictor variables are on very different scales: consider rescaling
> Execution halted
> ERROR: Running R script failed, check messages above
> (Thu Feb 11 13:11:25 2021) Command finished (3 sec)
>
> Cheers,
> Mitchell Meads, PhD Student
> Texas A University at Galveston
> Marine & Coastal Management Sciences; CTBS 
> Email: mitchell.me...@tamu.edu
>
>
>
>
> On Sat, Jan 23, 2021 at 9:54 PM Anna Petrášová 
> wrote:
>
>> Hi Mitchell,
>>
>> On Fri, Jan 22, 2021 at 3:23 PM Mitchell Meads 
>> wrote:
>>
>>> Hi all,
>>>
>>> I'm getting an error when running r.futures.demand that says "Number of
>>> development raster maps doesn't not correspond to the number of observed
>>> times". I thought that a fix for this would be to make sure my input
>>> population csv had years that matched the input raster maps in the first
>>> column but this didn't change the error. If you could let me know what you
>>> think I'm doing wrong, that would be greatly appreciated!
>>>
>>
>> The error means the number of raster maps in the development parameter
>> does not match the number of years in the observed_population CSV. So for
>> example, if you specify development=urban_2001,urban_2006,urban_2011 (3
>> maps) then the observed_population file should look like this (header + 3
>> lines):
>>
>> year,37037,37063,...
>> 2001,19860,10980,...
>> 2006,20760,12660,...
>> 2011,21070,13090,...
>>
>> If you can't see any obvious mistake with your data, I would have to see
>> the r.futures.demand command you are trying to execute and the input CSV
>> file.
>>
>>
>>>
>>>
>>> Cheers,
>>> Mitchell
>>>
>>>
>>> ___
>>> grass-user mailing list
>>> grass-user@lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/grass-user
>>> 
>>>
>>
___

Re: [GRASS-user] r.futures.demand

2021-01-23 Thread Anna Petrášová
Hi Mitchell,

On Fri, Jan 22, 2021 at 3:23 PM Mitchell Meads 
wrote:

> Hi all,
>
> I'm getting an error when running r.futures.demand that says "Number of
> development raster maps doesn't not correspond to the number of observed
> times". I thought that a fix for this would be to make sure my input
> population csv had years that matched the input raster maps in the first
> column but this didn't change the error. If you could let me know what you
> think I'm doing wrong, that would be greatly appreciated!
>

The error means the number of raster maps in the development parameter does
not match the number of years in the observed_population CSV. So for
example, if you specify development=urban_2001,urban_2006,urban_2011 (3
maps) then the observed_population file should look like this (header + 3
lines):

year,37037,37063,...
2001,19860,10980,...
2006,20760,12660,...
2011,21070,13090,...

If you can't see any obvious mistake with your data, I would have to see
the r.futures.demand command you are trying to execute and the input CSV
file.


>
>
> Cheers,
> Mitchell
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user