quase
This commit is contained in:
|
Can't render this file because it is too large.
|
388
BaciaRioMucuri_estacao_chuvosa.csv
Normal file
388
BaciaRioMucuri_estacao_chuvosa.csv
Normal file
@@ -0,0 +1,388 @@
|
||||
CODIGO;INICIO;FINAL
|
||||
1740000;1980-09-26;1981-04-24
|
||||
1740000;1981-10-04;1982-04-30
|
||||
1740000;1982-09-17;1983-04-24
|
||||
1740000;1983-09-23;1984-04-18
|
||||
1740000;1984-09-03;1985-04-15
|
||||
1740000;1985-09-07;1986-04-28
|
||||
1740000;1986-10-13;1987-04-30
|
||||
1740000;1987-09-12;1988-04-22
|
||||
1740000;1988-10-11;1989-04-17
|
||||
1740000;1989-10-01;1990-04-26
|
||||
1740000;1990-09-16;1991-04-17
|
||||
1740000;1991-09-23;1992-04-28
|
||||
1740000;1992-09-24;1993-04-20
|
||||
1740000;1993-10-07;1994-04-27
|
||||
1740000;1994-09-19;1995-04-14
|
||||
1740000;1995-09-23;1996-04-19
|
||||
1740000;1996-09-03;1997-04-24
|
||||
1740000;1997-09-07;1998-04-22
|
||||
1740000;1998-09-02;1999-04-19
|
||||
1740000;1999-09-13;2000-04-30
|
||||
1740000;2000-09-07;2001-04-26
|
||||
1740000;2001-09-18;2002-04-24
|
||||
1740000;2002-09-08;2003-04-24
|
||||
1740000;2003-09-10;2004-04-23
|
||||
1740000;2004-10-07;2005-04-02
|
||||
1740000;2005-09-21;2006-04-26
|
||||
1740000;2006-09-18;2007-04-22
|
||||
1740000;2007-09-04;2008-04-25
|
||||
1740000;2008-09-24;2009-04-16
|
||||
1740000;2009-10-10;2010-04-27
|
||||
1740000;2010-09-22;2011-04-29
|
||||
1740000;2011-09-16;2012-04-25
|
||||
1740000;2012-09-27;2013-04-18
|
||||
1740000;2013-09-12;2014-04-25
|
||||
1740000;2014-10-22;2015-04-23
|
||||
1740000;2015-10-25;2016-04-17
|
||||
1740000;2016-10-05;2017-04-26
|
||||
1740000;2017-09-17;2018-04-24
|
||||
1740000;2018-10-21;2019-04-30
|
||||
1740000;2019-09-29;2020-04-26
|
||||
1740000;2020-09-25;2021-04-20
|
||||
1740000;2021-09-03;2022-04-27
|
||||
1740000;2022-09-24;2022-12-25
|
||||
1740033;1980-09-23;1981-04-23
|
||||
1740033;1981-10-04;1982-04-18
|
||||
1740033;1982-09-20;1983-04-24
|
||||
1740033;1983-09-11;1984-04-28
|
||||
1740033;1984-09-04;1985-04-20
|
||||
1740033;1985-09-07;1986-04-25
|
||||
1740033;1986-10-13;1987-04-30
|
||||
1740033;1987-09-13;1988-04-20
|
||||
1740033;1988-10-18;1989-04-23
|
||||
1740033;1989-10-01;1990-04-25
|
||||
1740033;1990-09-04;1991-04-30
|
||||
1740033;1991-09-03;1992-04-22
|
||||
1740033;1992-09-10;1993-04-30
|
||||
1740033;1993-10-07;1994-04-30
|
||||
1740033;1994-09-19;1995-04-16
|
||||
1740033;1995-09-22;1996-04-28
|
||||
1740033;1996-09-14;1997-04-30
|
||||
1740033;1997-09-13;1998-03-29
|
||||
1740033;1998-09-01;1999-04-27
|
||||
1740033;1999-09-19;2000-04-30
|
||||
1740033;2000-09-06;2001-04-26
|
||||
1740033;2001-09-17;2002-04-24
|
||||
1740033;2002-09-06;2003-04-26
|
||||
1740033;2003-09-16;2004-04-26
|
||||
1740033;2004-10-21;2005-04-27
|
||||
1740033;2005-09-11;2006-04-20
|
||||
1740033;2006-09-08;2007-04-22
|
||||
1740033;2007-09-13;2008-04-27
|
||||
1740033;2008-09-23;2009-04-28
|
||||
1740033;2009-09-25;2010-04-26
|
||||
1740033;2010-09-21;2011-04-30
|
||||
1740033;2011-10-04;2012-04-24
|
||||
1740033;2012-09-23;2013-04-18
|
||||
1740033;2013-09-06;2014-04-30
|
||||
1740033;2014-10-22;2015-04-26
|
||||
1740033;2015-10-07;2016-04-19
|
||||
1740033;2016-09-27;2017-04-30
|
||||
1740033;2017-09-17;2018-04-26
|
||||
1740033;2018-10-16;2019-04-30
|
||||
1740033;2019-09-07;2020-04-26
|
||||
1740033;2020-10-11;2021-04-30
|
||||
1740033;2021-09-01;2022-04-27
|
||||
1740033;2022-09-23;2022-12-25
|
||||
1741009;1980-09-26;1981-04-26
|
||||
1741009;1981-10-02;1982-04-30
|
||||
1741009;1982-09-17;1983-04-24
|
||||
1741009;1983-09-23;1984-04-22
|
||||
1741009;1984-09-01;1985-04-17
|
||||
1741009;1985-09-07;1986-04-29
|
||||
1741009;1986-10-13;1987-04-30
|
||||
1741009;1987-09-09;1988-04-22
|
||||
1741009;1988-10-15;1989-04-17
|
||||
1741009;1989-09-17;1990-04-27
|
||||
1741009;1990-10-05;1991-04-29
|
||||
1741009;1991-09-22;1992-04-27
|
||||
1741009;1992-09-15;1993-04-04
|
||||
1741009;1993-09-18;1994-04-26
|
||||
1741009;1994-10-04;1995-04-14
|
||||
1741009;1995-09-23;1996-04-15
|
||||
1741009;1996-09-03;1997-04-30
|
||||
1741009;1997-09-12;1998-04-14
|
||||
1741009;1998-10-18;1999-04-18
|
||||
1741009;1999-09-12;2000-04-30
|
||||
1741009;2000-09-07;2001-04-17
|
||||
1741009;2001-09-02;2002-04-25
|
||||
1741009;2002-09-12;2003-04-25
|
||||
1741009;2003-11-05;2004-04-24
|
||||
1741009;2004-10-07;2005-04-27
|
||||
1741009;2005-09-10;2006-04-24
|
||||
1741009;2006-09-22;2007-04-13
|
||||
1741009;2007-09-03;2008-04-24
|
||||
1741009;2008-09-24;2009-04-16
|
||||
1741009;2009-09-11;2010-04-18
|
||||
1741009;2010-09-21;2011-04-29
|
||||
1741009;2011-09-16;2012-04-25
|
||||
1741009;2012-09-08;2013-04-27
|
||||
1741009;2013-09-12;2014-04-26
|
||||
1741009;2014-10-27;2015-04-08
|
||||
1741009;2015-10-26;2016-04-20
|
||||
1741009;2016-10-04;2017-04-16
|
||||
1741009;2017-09-18;2018-04-26
|
||||
1741009;2018-10-15;2019-04-29
|
||||
1741009;2019-09-27;2020-04-12
|
||||
1741009;2020-09-14;2021-04-20
|
||||
1741009;2021-09-01;2022-04-26
|
||||
1741009;2022-10-24;2022-12-25
|
||||
1741007;1980-09-26;1981-04-27
|
||||
1741007;1981-10-13;1982-04-18
|
||||
1741007;1982-09-17;1983-04-16
|
||||
1741007;1983-09-14;1984-04-28
|
||||
1741007;1984-09-03;1985-04-20
|
||||
1741007;1985-09-05;1986-04-09
|
||||
1741007;1986-09-08;1987-04-06
|
||||
1741007;1987-09-21;1988-04-23
|
||||
1741007;1988-10-12;1989-04-30
|
||||
1741007;1989-09-17;1990-04-27
|
||||
1741007;1990-09-10;1991-04-29
|
||||
1741007;1991-09-13;1992-04-23
|
||||
1741007;1992-09-02;1993-04-25
|
||||
1741007;1993-09-30;1994-04-24
|
||||
1741007;1994-10-07;1995-04-21
|
||||
1741007;1995-09-12;1996-04-24
|
||||
1741007;1996-09-12;1997-04-30
|
||||
1741007;1997-09-06;1998-04-20
|
||||
1741007;1998-10-18;1999-04-22
|
||||
1741007;1999-09-19;2000-04-22
|
||||
1741007;2000-09-05;2001-04-14
|
||||
1741007;2001-09-16;2002-04-26
|
||||
1741007;2002-09-08;2003-03-25
|
||||
1741007;2003-09-30;2004-04-28
|
||||
1741007;2004-10-27;2005-04-27
|
||||
1741007;2005-09-28;2006-04-20
|
||||
1741007;2006-09-19;2007-04-25
|
||||
1741007;2007-09-05;2008-04-27
|
||||
1741007;2008-09-24;2009-04-28
|
||||
1741007;2009-10-13;2010-04-12
|
||||
1741007;2010-09-22;2011-04-30
|
||||
1741007;2011-10-04;2012-04-23
|
||||
1741007;2012-10-08;2013-04-10
|
||||
1741007;2013-09-16;2014-04-06
|
||||
1741007;2014-10-22;2015-04-26
|
||||
1741007;2015-11-15;2016-04-19
|
||||
1741007;2016-09-04;2017-04-23
|
||||
1741007;2017-09-19;2018-04-28
|
||||
1741007;2018-10-21;2019-04-27
|
||||
1741007;2019-09-30;2020-04-11
|
||||
1741007;2020-09-23;2021-04-20
|
||||
1741007;2021-09-02;2022-04-30
|
||||
1741007;2022-11-01;2022-12-27
|
||||
1741003;1980-09-23;1981-04-27
|
||||
1741003;1981-10-01;1982-04-30
|
||||
1741003;1982-09-17;1983-04-24
|
||||
1741003;1983-09-28;1984-04-22
|
||||
1741003;1984-09-02;1985-04-15
|
||||
1741003;1985-09-07;1986-04-25
|
||||
1741003;1986-10-13;1987-04-21
|
||||
1741003;1987-09-09;1988-04-20
|
||||
1741003;1988-10-18;1989-04-09
|
||||
1741003;1989-10-01;1990-04-24
|
||||
1741003;1990-09-15;1991-04-30
|
||||
1741003;1991-09-20;1992-04-28
|
||||
1741003;1992-09-14;1993-04-30
|
||||
1741003;1993-10-06;1994-04-30
|
||||
1741003;1994-09-18;1995-04-26
|
||||
1741003;1995-10-18;1996-04-23
|
||||
1741003;1996-09-14;1997-04-30
|
||||
1741003;1997-10-29;1998-04-21
|
||||
1741003;1998-09-02;1999-04-29
|
||||
1741003;1999-09-11;2000-04-30
|
||||
1741003;2000-09-04;2001-04-26
|
||||
1741003;2001-09-17;2002-04-25
|
||||
1741003;2002-09-07;2003-04-25
|
||||
1741003;2003-09-30;2004-04-23
|
||||
1741003;2004-09-13;2005-04-27
|
||||
1741003;2005-09-10;2006-04-20
|
||||
1741003;2006-09-09;2007-04-29
|
||||
1741003;2007-09-12;2008-04-06
|
||||
1741003;2008-09-23;2009-04-20
|
||||
1741003;2009-09-04;2010-04-15
|
||||
1741003;2010-09-22;2011-04-23
|
||||
1741003;2011-10-04;2012-04-25
|
||||
1741003;2012-09-23;2013-04-28
|
||||
1741003;2013-09-12;2014-04-25
|
||||
1741003;2014-10-27;2015-04-26
|
||||
1741003;2015-10-25;2016-03-18
|
||||
1741003;2016-09-27;2017-04-16
|
||||
1741003;2017-09-14;2018-04-25
|
||||
1741003;2018-10-16;2019-04-30
|
||||
1741003;2019-09-29;2020-04-26
|
||||
1741003;2020-09-24;2021-04-20
|
||||
1741003;2021-09-02;2022-04-26
|
||||
1741003;2022-10-24;2022-12-25
|
||||
1741001;1980-09-26;1981-04-27
|
||||
1741001;1981-10-01;1982-04-20
|
||||
1741001;1982-09-17;1983-04-23
|
||||
1741001;1983-09-21;1984-04-19
|
||||
1741001;1984-09-10;1985-04-15
|
||||
1741001;1985-09-07;1986-04-29
|
||||
1741001;1986-10-14;1987-04-30
|
||||
1741001;1987-09-09;1988-04-29
|
||||
1741001;1988-10-18;1989-04-17
|
||||
1741001;1989-09-03;1990-04-27
|
||||
1741001;1990-09-16;1991-04-24
|
||||
1741001;1991-09-17;1992-04-22
|
||||
1741001;1992-09-23;1993-04-30
|
||||
1741001;1993-10-07;1994-04-27
|
||||
1741001;1994-09-22;1995-04-26
|
||||
1741001;1995-09-24;1996-04-19
|
||||
1741001;1996-09-13;1997-04-30
|
||||
1741001;1997-09-07;1998-04-22
|
||||
1741001;1998-10-10;1999-04-26
|
||||
1741001;1999-09-18;2000-04-30
|
||||
1741001;2000-09-04;2001-04-25
|
||||
1741001;2001-09-17;2002-04-25
|
||||
1741001;2002-09-08;2003-04-24
|
||||
1741001;2003-09-30;2004-04-23
|
||||
1741001;2004-10-27;2005-04-30
|
||||
1741001;2005-09-21;2006-04-20
|
||||
1741001;2006-09-07;2007-04-22
|
||||
1741001;2007-09-05;2008-04-27
|
||||
1741001;2008-09-23;2009-04-28
|
||||
1741001;2009-09-21;2010-04-17
|
||||
1741001;2010-09-22;2011-04-23
|
||||
1741001;2011-09-16;2012-04-24
|
||||
1741001;2012-09-10;2013-04-19
|
||||
1741001;2013-09-12;2014-04-06
|
||||
1741001;2014-10-27;2015-04-26
|
||||
1741001;2015-11-15;2016-04-18
|
||||
1741001;2016-09-27;2017-04-20
|
||||
1741001;2017-09-13;2018-04-27
|
||||
1741001;2018-10-16;2019-04-30
|
||||
1741001;2019-09-29;2020-04-17
|
||||
1741001;2020-09-24;2021-04-20
|
||||
1741001;2021-09-02;2022-04-26
|
||||
1741001;2022-10-24;2022-12-25
|
||||
1741006;1980-09-24;1981-04-04
|
||||
1741006;1981-10-02;1982-04-30
|
||||
1741006;1982-09-17;1983-04-24
|
||||
1741006;1983-09-13;1984-04-22
|
||||
1741006;1984-09-10;1985-04-15
|
||||
1741006;1985-09-07;1986-04-25
|
||||
1741006;1986-10-14;1987-04-30
|
||||
1741006;1987-09-14;1988-04-30
|
||||
1741006;1988-10-13;1989-04-17
|
||||
1741006;1989-09-03;1990-04-26
|
||||
1741006;1990-09-16;1991-04-30
|
||||
1741006;1991-09-17;1992-04-28
|
||||
1741006;1992-09-15;1993-04-30
|
||||
1741006;1993-09-26;1994-04-24
|
||||
1741006;1994-10-09;1995-04-15
|
||||
1741006;1995-10-07;1996-04-21
|
||||
1741006;1996-09-03;1997-04-30
|
||||
1741006;1997-09-07;1998-04-13
|
||||
1741006;1998-10-14;1999-04-23
|
||||
1741006;1999-09-19;2000-04-30
|
||||
1741006;2000-09-04;2001-04-26
|
||||
1741006;2001-09-18;2002-04-24
|
||||
1741006;2002-09-08;2003-04-26
|
||||
1741006;2003-09-30;2004-04-28
|
||||
1741006;2004-10-05;2005-04-28
|
||||
1741006;2005-09-15;2006-04-29
|
||||
1741006;2006-09-08;2007-04-29
|
||||
1741006;2007-09-05;2008-04-27
|
||||
1741006;2008-09-28;2009-04-27
|
||||
1741006;2009-09-25;2010-04-18
|
||||
1741006;2010-09-22;2011-04-27
|
||||
1741006;2011-10-04;2012-04-24
|
||||
1741006;2012-10-08;2013-04-19
|
||||
1741006;2013-09-05;2014-04-25
|
||||
1741006;2014-10-27;2015-04-26
|
||||
1741006;2015-10-26;2016-04-18
|
||||
1741006;2016-10-03;2017-04-24
|
||||
1741006;2017-09-17;2018-04-26
|
||||
1741006;2018-10-16;2019-04-28
|
||||
1741006;2019-09-28;2020-04-26
|
||||
1741006;2020-10-19;2021-04-20
|
||||
1741006;2021-10-10;2022-04-26
|
||||
1741006;2022-10-24;2022-12-27
|
||||
1740026;1980-09-23;1981-04-23
|
||||
1740026;1981-10-04;1982-04-18
|
||||
1740026;1982-09-20;1983-04-24
|
||||
1740026;1983-09-11;1984-04-28
|
||||
1740026;1984-09-04;1985-04-20
|
||||
1740026;1985-09-07;1986-04-25
|
||||
1740026;1986-10-13;1987-04-30
|
||||
1740026;1987-09-13;1988-04-22
|
||||
1740026;1988-10-11;1989-04-23
|
||||
1740026;1989-10-01;1990-04-25
|
||||
1740026;1990-09-04;1991-04-30
|
||||
1740026;1991-09-03;1992-04-22
|
||||
1740026;1992-09-10;1993-04-30
|
||||
1740026;1993-10-07;1994-04-30
|
||||
1740026;1994-09-19;1995-04-10
|
||||
1740026;1995-09-23;1996-04-28
|
||||
1740026;1996-09-29;1997-04-24
|
||||
1740026;1997-09-07;1998-04-22
|
||||
1740026;1998-09-01;1999-04-12
|
||||
1740026;1999-09-18;2000-04-30
|
||||
1740026;2000-09-07;2001-04-26
|
||||
1740026;2001-09-14;2002-04-24
|
||||
1740026;2002-09-08;2003-04-26
|
||||
1740026;2003-09-10;2004-04-23
|
||||
1740026;2004-10-07;2005-04-20
|
||||
1740026;2005-09-15;2006-04-19
|
||||
1740026;2006-09-08;2007-04-19
|
||||
1740026;2007-09-13;2008-04-27
|
||||
1740026;2008-09-24;2009-04-28
|
||||
1740026;2009-09-25;2010-04-30
|
||||
1740026;2010-09-20;2011-04-30
|
||||
1740026;2011-10-06;2012-02-27
|
||||
1740026;2012-09-07;2013-04-18
|
||||
1740026;2013-09-07;2014-04-25
|
||||
1740026;2014-10-22;2015-04-24
|
||||
1740026;2015-11-16;2016-04-23
|
||||
1740026;2016-09-15;2017-04-01
|
||||
1740026;2017-09-09;2018-04-25
|
||||
1740026;2018-10-20;2019-04-30
|
||||
1740026;2019-09-05;2020-04-11
|
||||
1740026;2020-10-18;2021-04-22
|
||||
1740026;2021-09-02;2022-04-24
|
||||
1740026;2022-09-24;2022-12-25
|
||||
1740001;1980-09-26;1981-04-05
|
||||
1740001;1981-10-11;1982-04-17
|
||||
1740001;1982-09-15;1983-04-25
|
||||
1740001;1983-09-14;1984-04-18
|
||||
1740001;1984-09-17;1985-04-15
|
||||
1740001;1985-09-10;1986-04-10
|
||||
1740001;1986-10-13;1987-04-30
|
||||
1740001;1987-09-09;1988-04-22
|
||||
1740001;1988-10-22;1989-04-17
|
||||
1740001;1989-09-17;1990-04-27
|
||||
1740001;1990-10-04;1991-04-24
|
||||
1740001;1991-09-22;1992-04-23
|
||||
1740001;1992-09-25;1993-04-30
|
||||
1740001;1993-10-07;1994-04-30
|
||||
1740001;1994-09-19;1995-04-26
|
||||
1740001;1995-09-22;1996-04-15
|
||||
1740001;1996-09-12;1997-04-24
|
||||
1740001;1997-09-07;1998-04-24
|
||||
1740001;1998-09-01;1999-04-30
|
||||
1740001;1999-09-19;2000-04-16
|
||||
1740001;2000-09-12;2001-04-26
|
||||
1740001;2001-09-03;2002-04-25
|
||||
1740001;2002-09-08;2003-04-26
|
||||
1740001;2003-09-13;2004-04-16
|
||||
1740001;2004-10-27;2005-04-27
|
||||
1740001;2005-10-29;2006-04-18
|
||||
1740001;2006-09-21;2007-04-20
|
||||
1740001;2007-09-01;2008-04-19
|
||||
1740001;2008-09-24;2009-04-16
|
||||
1740001;2009-09-25;2010-04-30
|
||||
1740001;2010-09-21;2011-04-22
|
||||
1740001;2011-09-16;2012-04-25
|
||||
1740001;2012-09-08;2013-04-18
|
||||
1740001;2013-09-12;2014-04-25
|
||||
1740001;2014-10-27;2015-04-24
|
||||
1740001;2015-10-25;2016-04-23
|
||||
1740001;2016-10-07;2017-04-25
|
||||
1740001;2017-09-14;2018-04-25
|
||||
1740001;2018-10-15;2019-04-30
|
||||
1740001;2019-09-14;2020-04-26
|
||||
1740001;2020-09-24;2021-04-20
|
||||
1740001;2021-09-02;2022-04-16
|
||||
1740001;2022-09-27;2022-12-25
|
||||
|
92665
BaciaRioMucuri_filtro_setembro_abril.csv
Normal file
92665
BaciaRioMucuri_filtro_setembro_abril.csv
Normal file
File diff suppressed because it is too large
Load Diff
4971
BaciaRioMucuri_veranicos.csv
Normal file
4971
BaciaRioMucuri_veranicos.csv
Normal file
File diff suppressed because it is too large
Load Diff
12
app.py
12
app.py
@@ -1,15 +1,15 @@
|
||||
import carregar
|
||||
import processar
|
||||
import iniciochuvosa
|
||||
import veranicos
|
||||
|
||||
def mostrar_menu():
|
||||
print("Menu:")
|
||||
print("1 - Carregar arquivo")
|
||||
print("3 - Deletar csv gerando no menu 1")
|
||||
|
||||
print("1 - transformar txt em csv com todas leituras das estacoes")
|
||||
print("11 - Estacao mais proxima")
|
||||
print("20 - completar valores com -1")
|
||||
print("30 - Inicio e fim estacao chuvosa")
|
||||
print("40 - Processar veranicos com estacao chuvosa")
|
||||
print("0 - Sair")
|
||||
|
||||
def main():
|
||||
@@ -28,12 +28,16 @@ def main():
|
||||
carregar.carregar_arquivoxls_mais_proxima()
|
||||
|
||||
elif opcao == "20":
|
||||
processar.processar_arquivos()
|
||||
processar.processar_arquivos_com_menos_um()
|
||||
elif opcao == "30":
|
||||
iniciochuvosa.processar_inicio_fim_estacao_chuvosa()
|
||||
|
||||
elif opcao == "40":
|
||||
veranicos.processar_veranicos_estacao_chuvosa()
|
||||
|
||||
|
||||
|
||||
|
||||
elif opcao == "0":
|
||||
print("Saindo...")
|
||||
break
|
||||
|
||||
@@ -38,8 +38,8 @@ def filtro_setembro_abril_estacao(dados, output_csv):
|
||||
def estacaochuvosa(dados, output_csv):
|
||||
print(dados)
|
||||
|
||||
with open('iniciofimestacao.csv', 'w') as file:
|
||||
cabecalho = ['estacao', 'inicio','final']
|
||||
with open(output_csv, 'w') as file:
|
||||
cabecalho = ['CODIGO', 'INICIO','FINAL']
|
||||
writer = csv.DictWriter(file, fieldnames=cabecalho,delimiter=';')
|
||||
writer.writeheader() # Escreve o cabeçalho
|
||||
|
||||
@@ -102,9 +102,9 @@ def estacaochuvosa(dados, output_csv):
|
||||
marcador_inicio=False
|
||||
#print ('ano final chuva:', ano_do_incio_chuva+1)
|
||||
# print ('estacao:', nome_estacao,'INCIO:', data_incio_chuva,'FINAL:', data_final_chuva )
|
||||
with open('iniciofimestacao.csv', 'a') as file:
|
||||
with open(output_csv, 'a') as file:
|
||||
writer = csv.DictWriter(file, fieldnames=cabecalho, delimiter=';')
|
||||
writer.writerow({'estacao':nome_estacao, 'inicio':data_incio_chuva,'final':data_final_chuva})
|
||||
writer.writerow({'CODIGO':nome_estacao, 'INICIO':data_incio_chuva.strftime('%Y-%m-%d'),'FINAL':data_final_chuva.strftime('%Y-%m-%d')})
|
||||
|
||||
|
||||
def processar_inicio_fim_estacao_chuvosa():
|
||||
|
||||
@@ -94,7 +94,7 @@ def completar_com_valores(dados, estacao, output_csv):
|
||||
#df.to_csv(output_csv, sep=";", encoding='utf-8', decimal=',', index=False)
|
||||
|
||||
|
||||
def processar_arquivos():
|
||||
def processar_arquivos_com_menos_um():
|
||||
print("Carregando arquivo...")
|
||||
diretorio = 'data' # nome da pasta principal
|
||||
pastas = listar_pastas(diretorio)
|
||||
|
||||
98
veranicos.py
98
veranicos.py
@@ -2,6 +2,8 @@ import os
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from time import sleep
|
||||
from datetime import datetime
|
||||
import csv
|
||||
|
||||
|
||||
def listar_pastas(diretorio):
|
||||
@@ -9,12 +11,94 @@ def listar_pastas(diretorio):
|
||||
return pastas
|
||||
|
||||
|
||||
|
||||
def veranicos_com_estacao_chuvosa(estacao,dados_veranivos, output_csv):
|
||||
|
||||
def processar_veranicos_estacao_chuvosa():
|
||||
print("processar veranicos ...")
|
||||
diretorio = 'data' # nome da pasta principal
|
||||
pastas = listar_pastas(diretorio)
|
||||
|
||||
dados_df = pd.read_csv(dados, sep=';', decimal=',', parse_dates=['DATA'], dayfirst=True)
|
||||
start_date = '1980-01-01'
|
||||
end_date = '2022-12-31'
|
||||
filtered_df = dados_df[(dados_df['DATA'] >= start_date) & (dados_df['DATA'] <= end_date)]
|
||||
for pasta in pastas:
|
||||
print(f"Encontrada pasta: {pasta}")
|
||||
estacao_com_inicio_fim_chuva=f"./{pasta}_estacao_chuvosa.csv"
|
||||
dados_veranivos=f"./{pasta}_dados.csv"
|
||||
output_csv = f"./{pasta}_veranicos.csv"
|
||||
print(estacao_com_inicio_fim_chuva)
|
||||
print(dados_veranivos)
|
||||
print(output_csv)
|
||||
|
||||
veranicos_com_estacao_chuvosa(estacao_com_inicio_fim_chuva,dados_veranivos, output_csv)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def veranicos_com_estacao_chuvosa(estacao_com_inicio_fim_chuva,dados_veranivos, output_csv):
|
||||
|
||||
with open(output_csv, 'w') as file:
|
||||
cabecalho = ['CODIGO', 'INICIO','FINAL', 'QTDDIAS']
|
||||
writer = csv.DictWriter(file, fieldnames=cabecalho, delimiter=';')
|
||||
writer.writeheader() # Escreve o cabeçalho
|
||||
|
||||
|
||||
|
||||
df_dados_estacao_chuvosa = pd.read_csv(estacao_com_inicio_fim_chuva, sep=';', decimal=',')
|
||||
try:
|
||||
df_dados_estacao_chuvosa['INICIO'] = pd.to_datetime(df_dados_estacao_chuvosa['INICIO'], format='%Y-%m-%d', errors='raise')
|
||||
df_dados_estacao_chuvosa['FINAL'] = pd.to_datetime(df_dados_estacao_chuvosa['FINAL'], format='%Y-%m-%d', errors='raise')
|
||||
except Exception as e:
|
||||
raise ValueError(f"Erro ao converter a coluna 'DATA': {e}")
|
||||
|
||||
|
||||
df_dados_veranivos =pd.read_csv(dados_veranivos, sep=';', decimal=',')
|
||||
try:
|
||||
df_dados_veranivos['DATA'] = pd.to_datetime(df_dados_veranivos['DATA'], format='%Y-%m-%d', errors='raise')
|
||||
except Exception as e:
|
||||
raise ValueError(f"Erro ao converter a coluna 'DATA': {e}")
|
||||
|
||||
|
||||
|
||||
|
||||
for index, row in df_dados_estacao_chuvosa.iterrows():
|
||||
estacao= row['CODIGO']
|
||||
start_date= row['INICIO']
|
||||
end_date= row['FINAL']
|
||||
print(estacao , "INICIO: ", start_date, "FINAL: ", end_date)
|
||||
df_dados = df_dados_veranivos[(df_dados_veranivos['CODIGO'] == estacao) &(df_dados_veranivos['DATA'] >= start_date) & (df_dados_veranivos['DATA'] <= end_date)]
|
||||
|
||||
|
||||
|
||||
marcador_inicio= False
|
||||
marcador_final= False
|
||||
marcador_primeirodia= False
|
||||
leitura_chuva=0
|
||||
cont_veranico=0
|
||||
data_anterior=''
|
||||
data_incio=''
|
||||
for index, row in df_dados.iterrows():
|
||||
leitura_chuva= row['VALOR']
|
||||
data= row['DATA']
|
||||
|
||||
if (marcador_inicio): #FALSO
|
||||
if leitura_chuva <1:
|
||||
cont_veranico= cont_veranico+1
|
||||
else:
|
||||
marcador_final= True
|
||||
|
||||
if (cont_veranico==1 and marcador_inicio):
|
||||
data_incio= data
|
||||
if marcador_final:
|
||||
if (cont_veranico>=4):
|
||||
|
||||
#print ('estacao:', nome_estacao,'INCIO:', data_incio, ' FIM:', data_anterior , ' DIAS:', cont_veranico)
|
||||
with open(output_csv, 'a') as file:
|
||||
writer = csv.DictWriter(file, fieldnames=cabecalho, delimiter=';')
|
||||
writer.writerow({'CODIGO':estacao, 'INICIO':data_incio.strftime('%Y-%m-%d'),'FINAL':data_anterior.strftime('%Y-%m-%d'), 'QTDDIAS':cont_veranico})
|
||||
|
||||
#toda ver que chove mais que 0.5 mm ele reinicia o contador
|
||||
if leitura_chuva >=1:
|
||||
marcador_inicio= True
|
||||
cont_veranico= 0
|
||||
marcador_final= False
|
||||
|
||||
data_anterior= data
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user