Git Product home page Git Product logo

gqf-pyqgis3's People

Contributors

biglimp avatar sunt05 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gqf-pyqgis3's Issues

Transport profile possibly weighted incorrectly

The weighting of the transport profile, DW, is normalised around 1 by being divided by the mean in TransportProfiles.py line 153.

The fuel use is calculated as (spatialHelpers/py lines 269 - 280):

FU = AADT * km in area * fuel consumption

# Make use of the extra detail available to us
newValues[fieldMap['diesel']['car']].loc[ids] = aadtData['diesel_car'] * \
lkm * \
fuelCon.getFuelConsumption(age, 'car', rType_cons, 'diesel')
newValues[fieldMap['petrol']['car']].loc[ids] = aadtData['petrol_car'] * \
lkm * \
fuelCon.getFuelConsumption(age, 'car', rType_cons, 'petrol')
newValues[fieldMap['diesel']['lgv']].loc[ids] = aadtData['diesel_lgv'] * \
lkm * \
fuelCon.getFuelConsumption(age, 'lgv', rType_cons, 'diesel')
newValues[fieldMap['petrol']['lgv']].loc[ids] = aadtData['petrol_lgv'] * \
lkm * \
fuelCon.getFuelConsumption(age, 'lgv', rType_cons, 'petrol')

Then (kg fuel per square metre, Transport.py line 269):

FU / m2

# Convert to kg fuel per square metre of output area too

Then QF,T is found as (Calcs3.py, lines 133-160):

QF,T = (heat of combustion * (FU / m2) * DW ) / 86400

GQF-PYQGIS3/GQF/Calcs3.py

Lines 133 to 160 in 272adb5

WattHour.loc[areaCodes,columns[9]] = (petHoc * trans.getMotorcycle(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getMotorcycle(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getMotorcycle(timeStepEnd, timeStepDuration)[0]/86400.0 # motorcycles
WattHour.loc[areaCodes,columns[10]] = (petHoc * trans.getTaxi(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getTaxi(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getTaxi(timeStepEnd, timeStepDuration)[0]/86400.0 # Taxis
WattHour.loc[areaCodes,columns[11]] = (petHoc * trans.getCar(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getCar(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getCar(timeStepEnd, timeStepDuration)[0]/86400.0 # Cars
WattHour.loc[areaCodes,columns[12]] = (petHoc * trans.getBus(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getBus(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getBus(timeStepEnd, timeStepDuration)[0]/86400.0 # Bus
WattHour.loc[areaCodes,columns[13]] = (petHoc * trans.getLGV(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getLGV(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getLGV(timeStepEnd, timeStepDuration)[0]/86400.0 # LGVs
WattHour.loc[areaCodes,columns[14]] = (petHoc * trans.getRigid(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getRigid(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getRigid(timeStepEnd, timeStepDuration)[0]/86400.0 # Rigid HGVs
WattHour.loc[areaCodes,columns[15]] = (petHoc * trans.getArtic(areaCodes, 'petrol', timeStepEnd) * petSc +
dslHoc * trans.getArtic(areaCodes, 'diesel', timeStepEnd) * dslSc) * \
diurnalTrans.getArtic(timeStepEnd, timeStepDuration)[0]/86400.0 # Articulated HGVs

As DW is found by dividing by the mean, this means that DW > 1 sometimes, meaning that for that time step > 1 * AADT is accounted for.

Surely DW should be found as being normalised between 0 and 1, by dividing by the sum?

datetime issue with UMEP

@biglimp
Have a look here when you load the dates in via UMEP/QGIS GUI settings:

startDates = self.config.dt_start
endDates = self.config.dt_end
# Set up UTC time bins @ 30 min intervals
# for i in range(0,len(startDates),1):
# bins = pd.date_range(pd.datetime.strptime(startDates[i].strftime('%Y-%m-%d %H:%M'), '%Y-%m-%d %H:%M') + timedelta(seconds=1800),
# pd.datetime.strptime(endDates[i].strftime('%Y-%m-%d %H:%M'), '%Y-%m-%d %H:%M'),
# tz='UTC',
# freq='30Min')
# if i == 0:
# timeBins = bins
# else:
# timeBins = timeBins.append(bins)
try:
# offline scenario
timeBins = pd.date_range(
pd.to_datetime(startDates) + timedelta(seconds=1800),
pd.to_datetime(endDates) + timedelta(seconds=1800),
tz='UTC',
freq='30Min')
except:
# UMEP scenario
timeBins = pd.date_range(
startDates[0] + timedelta(seconds=1800),
endDates[0] + timedelta(seconds=1800),
tz='UTC',
freq='30Min')

Make sure your loaded startDates and endDates can be properly picked up by pd.date_range.

As I don't have GQF installed in QGIS, I cannot help too much there.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.