Commit Graph

108 Commits

Author SHA1 Message Date
James Douglass bc721523f6 Adding a test for normalized dichotomous kernel.
RE:#722
2023-01-21 10:28:58 -08:00
James Douglass 520bb4a4ed Adding a test for squaring off pixels.
RE:#722
2023-01-21 10:24:58 -08:00
James Douglass 52433d3df6 Adding a test for an invalid search radius.
RE:#722
2023-01-21 10:14:44 -08:00
James Douglass 8bc0ad7ae3 Testing greenspace supply across modes.
Greenspace supply across modes should be consistent when provided
consistent search radii.  RE:#722
2023-01-20 14:01:32 -08:00
James Douglass dd1677ca2e Cleaning up split pop/radii test.
RE:#722
2023-01-14 17:13:17 -06:00
James Douglass 5ef4533b86 Further work on split population radii module.
RE:#722
2023-01-14 16:55:21 -06:00
James Douglass e763ab202f Writing a test for split population radii.
RE:#722
2023-01-12 19:24:23 -06:00
James Douglass bcefb98572 Refactoring a few tasks related to split populations.
RE:#722
2023-01-12 19:03:55 -06:00
James Douglass 171b4b6963 Various minor bugfixes revealed through testing.
RE:#722
2023-01-12 13:28:21 -06:00
James Douglass 8d117cf6bd Merge branch 'feature/722-urban-nature-access-model' of github.com:phargogh/invest into feature/722-urban-nature-access-model-split-pop-and-radii 2023-01-05 14:28:03 -06:00
James Douglass 8e8cdb387d Updating another regression value. I think that'll be the last on them. RE:#722 2022-11-02 16:26:46 -07:00
James Douglass b630f71722 Updating another regression value. RE:#722 2022-11-02 14:41:28 -07:00
James Douglass 981e09eda0 Updating regression values in response to updated greenspace values. RE:#722 2022-11-01 15:30:07 -07:00
James Douglass f2cfd43298
Merge branch 'feature/urban-nature-access' into feature/722-urban-nature-access-model 2022-08-24 14:47:48 -07:00
James Douglass 845ecc9e58 Correcting a path in a test. RE:#722 2022-08-12 12:50:38 -07:00
James Douglass eb74798914 Adding a warning when admin polygons overlap. RE:#722 2022-08-12 12:43:49 -07:00
James Douglass bca7408db9 Supporting nonoverlapping admin units in split population.
RE:#722
2022-07-18 22:18:29 -07:00
James Douglass 356f8e722b Adding a test to reclassify_and_multiply. RE:#722 2022-07-15 15:57:29 -07:00
James Douglass 24f891118e Removing unneeded comments. RE:#722 2022-07-15 15:36:09 -07:00
James Douglass 59d33fa020 Renaming admin units to AOIs. RE:#722 2022-07-15 15:23:36 -07:00
James Douglass e5897869b3 Adding split population to the target vector.
Also refactoring a bit to add an identifying administrative feature.
RE:#722
2022-07-07 16:48:08 -07:00
James Douglass a2aa787c1d Adding raster versions of the split greenspace proportion.
RE:#722
2022-07-07 15:05:33 -07:00
James Douglass e28d10e408 Starting split population groups. RE#722 2022-07-07 13:56:04 -07:00
James Douglass b2a1f7a594 Fixing a few issues with the decay function arg.
* args['decay_function'] is now required
* I was previously using the wrong key to determine the kernel type,
  leading to incorrect regression test results.
* Test results have been fixed.

RE:#722
2022-06-10 14:58:11 -07:00
James Douglass 807eb9bc27 Reworking how radii/lucodes are grouped.
I hope this has made it a little clearer and might be a better use of
pandas.  I've also added a few more inline comments about why we're
doing this. RE:#722
2022-06-09 14:51:42 -07:00
James Douglass b5a46055a1 Refactoring a test. RE:#722 2022-05-03 19:19:55 -07:00
James Douglass b1542ce17e Search_radius_m is now a required attr table column.
Roy and Hongxiao agreed that this would be a better idea and less
confusing. RE:#722
2022-05-03 16:47:02 -07:00
James Douglass 4a908eea17 Minor refactor of the assertions in the base case test. RE:#722 2022-04-13 15:51:48 -07:00
James Douglass f131e87986 Adding assertions to the split greenspace test.
RE:#722
2022-04-13 15:50:54 -07:00
James Douglass 134b93858c Slight refactor of tests.
This refactor is to ensure that with the refactor of the model to
provide split greenspace functionality that the base case of split
greenspace (where all greenspace types share a search radius) has
consistent results with the core model case.

RE:#722
2022-04-13 15:37:49 -07:00
James Douglass a83f1b627a Taking a first stab at the split greenspace module.
RE:#722
2022-04-12 16:55:49 -07:00
James Douglass 5d17f75522 Preprocessing the attribute CSV for split greenspace.
RE:#722
2022-01-24 15:19:49 -08:00
James Douglass 8ae0b82b3f Refactor of UNA test to move data creation to function.
RE:#722
2022-01-24 13:34:18 -08:00
James Douglass fe6d375a08 Minor updates to comments in tests. RE:#722 2021-12-01 13:50:15 -08:00
James Douglass 3482f02dcb Using a UG-defined variable name in the output vector. RE:#722 2021-12-01 13:47:46 -08:00
James Douglass 8a1e934403 Adding under/oversupplied population counts to output vector.
This is most easily done by creating new rasters matching the given
criteria and then aggregating over the admin units.  RE:#722
2021-12-01 13:32:16 -08:00
James Douglass 67ec9109ed Refactoring greenspace budgets into raster_calculator.
After some thought and discussion with @dcdenu4, it seemed best to
refactor the iterblocks-based approach into 2 raster_calculator calls.
The main reasons to use iterblocks are if we either 1) need access to
the spatial context of the pixels or 2) need to modify a raster
in-place.  We need neither of these, and while it might save us some
runtime to avoid reading a raster from disk, this does seem the more
maintainable approach.

RE:#722
2021-12-01 11:47:09 -08:00
James Douglass d2180721bc Commenting a scalar. RE:#722 2021-12-01 11:01:34 -08:00
James Douglass d7a944f814 Asserting summary vector values.
RE:#722
2021-12-01 08:35:40 -08:00
James Douglass f9af5369e8 Adding the summarization to admin units.
RE:#722
2021-11-30 17:09:22 -08:00
James Douglass 2dbd93feb1 Refactoring to do both greenspace budgets in one task.
This avoids having to read an array from disk.  RE:#722
2021-11-30 14:26:14 -08:00
James Douglass 0bb53c9eaa Adding the per-capita greenspace budget output.
RE:#722
2021-11-30 13:26:29 -08:00
James Douglass 5ae39a8ff9 Updating kernel name for consistency with UG.
The UNA UG chapter describes the kernel as "dichotomous" rather than
"instantaneous", so this has been updated. RE:#722
2021-11-22 22:51:32 -08:00
James Douglass 5cce195e09 Calculating the greenspace supply.
RE:#722
2021-11-18 09:40:08 -08:00
James Douglass b5ef7a52b2 Adding is_greenspace reclassification.
This is just a simple identification of which pixels are greenspace,
which is needed for the 2-step floating catchment area. RE:#722
2021-11-17 19:05:46 -08:00
James Douglass beb7707fb7 Adding a density decay kernel. RE:#722 2021-11-17 18:01:03 -08:00
James Douglass 162cf0140d Reworking the instantaneous decay function.
The instantaneous decay function is now a blockwise function to avoid
the case where we have a large search radius and small pixels.  RE:#722
2021-11-17 17:21:50 -08:00
James Douglass b0e9c212a2 Adding a function for instantaneous decay.
This function is based on the stormwater implementation of the search
kernel.

RE:#722
2021-11-17 16:34:15 -08:00
James Douglass e8f3edbe37 Squaring off the LULC's pixels.
Since I'm now aligning two rasters in a way that's more manual than
simply calling `pygeoprocessing.align_and_resize_raster_stack`, I've
added a few assertions to help me be confident that this is working as I
expect it to. RE:#722
2021-11-17 11:48:44 -08:00
James Douglass ae68329b33 Minor typo. RE:#722 2021-11-16 14:51:38 -08:00
James Douglass 6fa201f4ee Renaming function parameters to reflect the intended source. RE:#722 2021-11-16 14:50:04 -08:00
James Douglass 442e84e974 Using isort to sort imports and adding configuration for it. RE:#722 2021-11-16 13:34:16 -08:00
James Douglass b203b647d6 Adding a test for the model.
This test doesn't have assertions yet, just the most basic inputs to
make sure the model can at least run.

RE:#722
2021-11-15 12:17:46 -08:00
James Douglass 53c12bcfd9 Adding a more interesting population warping test.
This adds a seeded randomization step to the population warping test,
just so I can be more confident that this function is doing what I
expect it to do with more reasonable data.  It does, which I'm happy to
see.

RE:#722
2021-11-15 11:59:45 -08:00
James Douglass 10c5f5a5ea Testing multiple pixel sizes. RE:#722 2021-11-15 11:39:53 -08:00
James Douglass 4f3761dc89 Finishing basic test for resampling population.
This adds the callthrough for the population raster resampling function
and also asserts that the outputs are reasonable for what we're trying
to do.  Initial results look like that at least in this basic test we're
getting numerically sensible results. RE:#722
2021-11-15 11:27:34 -08:00
James Douglass e381c1f9bc Implementing population resampling.
The function provided is a first stab at resampling/reprojecting a
population raster by way of converting to a population density, then
reprojecting and converting back to a population count.  Correctness has
yet to be determined, but this way we should pretty reasonably be
preserving the population counts. RE:#722
2021-11-15 11:09:26 -08:00
James Douglass 90955c93e5 Adding a skeleton for UNA model tests.
RE#722
2021-11-15 09:08:00 -08:00