Example #1
0
 def test_annualOutput2(self):
     p1 = """{"system_name":"HAPPY CUSTOMER",
     "address":"15013 Denver W Pkwy, Golden, CO",
     "zipcode":"80401",
     "tilt":23,
     "azimuth":180,
     "phase":1,
     "voltage":240,
     "array":[
         {"inverter":"SMA America: SB11000TL-US-12 (240V) 240V",
         "panel":"Axitec : AC-250P-156-60S *",
         "series":14,
         "parallel":4,
         "quantity":7
         },
         {"inverter":"SMA America: SB8000TL-US-12 (240V) 240V",
         "panel":"Axitec : AC-250P-156-60S *",
         "series":14,
         "parallel":3,
         "quantity":1
         }
         ]}
         """
     js1 = json.loads(p1)
     plant1 = pv.jsonToSystem(js1)
     rs1 = plant1.model()
     js2 = json.loads(json.dumps(plant1.dump()))
     plant2 = pv.jsonToSystem(js2)
     js3 = json.loads(json.dumps(plant2.dump()))
     rs2 = plant2.model()
     self.assertDictEqual(js2,js3)
     self.assertAlmostEquals(rs1.annualOutput,rs2.annualOutput)
Example #2
0
def modelPlant(jsonDef):
    plant = pv.jsonToSystem(jsonDef)
    yearone = plant.model(singleThread = True)
    PDC = sum([i.array.output(1000) for i in plant.shape])
    plantDict = plant.dump()
    plantDict['yearone'] = yearone.annualOutput
    plantDict['DCnominal'] = int(PDC)
    return plantDict
Example #3
0
 def test_annualOutput1(self):
     p1 = """{"system_name":"HAPPY CUSTOMER",
     "address":"15013 Denver W Pkwy, Golden, CO",
     "zipcode":"80401",
     "phase":1,
     "voltage":240,
     "array":[
         {"inverter":"Enphase Energy: M215-60-2LL-S2x-IG-NA (240 V) 240V",
         "panel":"Mage Solar : Powertec Plus 250-6 PL",
         "quantity":20,
         "azimuth":180,
         "tilt":25
         }
         ]}"""
     plant = pv.jsonToSystem(json.loads(p1))
     rs = plant.model()
     self.assertAlmostEquals(rs.annualOutput,7697.56)
Example #4
0
 def test_hourlyShading(self):
     p1 = """{"system_name":"Another Happy Customer",
     "zipcode":"44654",
     "tilt":25,
     "azimuth":180,
     "phase":1,
     "voltage":240,
     "shade":{"0": [0.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.0, 1.0, 0.1, 0.0, 0.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "9": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 1.0, 0.1, 0.0, 0.1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "10": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 1.0, 1.0, 1.0, 1.0, 0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "11": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 1.0, 1.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]},
     "array":[
         {"inverter":"Enphase Energy: M215-60-2LL-S2x-IG-NA (240 V) 240V",
         "derate":0.98,
         "panel":"Mage Solar : Powertec Plus 250-6 PL",
         "series":1,
         "parallel":1,
         "scale":36
         }
         ]}"""
     js1 = json.loads(p1)
     plant1 = pv.jsonToSystem(js1)
     rs1 = plant1.model()
     self.assertAlmostEquals(rs1.annualOutput,8600.66)
Example #5
0
 def test_virr1(self):
     import datetime
     p1 = """{"system_name":"HAPPY CUSTOMER",
     "address":"15013 Denver W Pkwy, Golden, CO",
     "zipcode":"80401",
     "phase":1,
     "voltage":240,
     "array":[
         {"inverter":"Enphase Energy: M215-60-2LL-S2x-IG-NA (240 V) 240V",
         "panel":"Mage Solar : Powertec Plus 250-6 PL",
         "quantity":20,
         "azimuth":180,
         "tilt":25
         }
         ]}"""
     plant = pv.jsonToSystem(json.loads(p1))
     ts =datetime.datetime(2000,9,22,19)
     weatherData = {}
     weatherData['temperature'] = 25
     weatherData['windSpeed'] = 0
     virrRec = plant.virr(2000,ts, weatherData)
     self.assertAlmostEquals(virrRec['girr'],437.0)
Example #6
0
    from subprocess import call
    cmd = shlex.split("pdftk Example2-Micro-Inverter.pdf fill_form data.fdf output output.pdf flatten")
    rc = call(cmd)

if __name__ == "__main__":
    import argparse
    import json
    parser = argparse.ArgumentParser(description='Model a PV system. Currently displays annual output and graph')
    parser.add_argument('-f', '--file')
    args = vars(parser.parse_args())
    try:
        #start program
        jsonP = json.loads(open(args['file']).read())
        if 'address' in jsonP:
            print '%s - %s %s' % \
                (jsonP['system_name'].upper(),jsonP['address'],jsonP['zipcode'])
        plant = pv.jsonToSystem(jsonP)
        if "run" in jsonP:
            string_notes(plant,jsonP["run"])
            pass
        else:

            string_notes(plant)
        #graph = plant.model()
        #graph.savefig('pv_output_%s.png' % plant.zipcode)

    except (KeyboardInterrupt, SystemExit):
        sys.exit(1)
    except:
        raise
Example #7
0
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 
            "10": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
            0.0, 0.4, 1.0, 1.0, 1.0, 1.0, 0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 
            "11": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
            0.0, 0.0, 0.0, 0.1, 1.0, 1.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]}
            }"""

    parser = argparse.ArgumentParser(description='Design a PV system')
    parser.add_argument('-f', '--file')
    args = vars(parser.parse_args())
    try:
        #start program
        if args['file']:
            testreqs = open(args['file']).read()

        for proposed in design(testreqs):
            proposedPlant = pv.jsonToSystem(proposed)
            print json.dumps(proposedPlant.dump(), sort_keys=True, indent=4, \
                separators=(',', ': '))
            print proposed['notes']
            expedite.string_notes(proposedPlant)

    except (KeyboardInterrupt, SystemExit):
        sys.exit(1)
    except:
        raise