data_dir = data_dir_noJumps f_name = "Eastern_WA_SF_" + str(SF_year) + "_70cloud_" + indeks + ".csv" a_df = pd.read_csv(data_dir + f_name, low_memory=False) ################################################################## ################################################################## #### #### plots has to be exact. So, we need #### to filter out NASS, and filter by last survey date #### ################################################################## ################################################################## a_df = a_df[a_df['county'] == given_county] # Filter given_county a_df = rc.filter_out_NASS(a_df) # Toss NASS a_df = rc.filter_by_lastSurvey(a_df, year=SF_year) # filter by last survey date a_df['SF_year'] = SF_year if irrigated_only == True: a_df = rc.filter_out_nonIrrigated(a_df) output_Irr = "irrigated_only" else: output_Irr = "non_irrigated_only" a_df = rc.filter_out_Irrigated(a_df) ################################################################## if jumps == "yes": output_dir = "/data/hydro/users/Hossein/remote_sensing/02_Eastern_WA_plots_tbls/" + \ "2Yr_plt_70cloud_notRegular_wJump/" + given_county + "_" + str(SF_year) + "_raw_" + output_Irr + "_" + indeks + "/"
for NASS_out in NASS_out_options: for last_survey_date in last_survey_date_options: for double_potential in double_potential_options: for irrigated in irrigated_options: for SF_year in SF_years: all_data = pd.DataFrame() for county in counties: file_name = county + "_" + SF_year + postfix_1 + postfix_2 a_df = pd.read_csv(data_dir + file_name, low_memory=False) print(file_name) print(a_df.SF_year.unique()) if NASS_out == True: a_df = rc.filter_out_NASS(a_df) out_name_NASS = "NASSOut" else: out_name_NASS = "NASSIn" if last_survey_date == True: a_df = a_df[a_df['LstSrvD'].str.contains(SF_year)] out_name_survey = "LastSrvCorrect" else: out_name_survey = "LastSrvFalse" if irrigated == True: a_df = rc.filter_out_nonIrrigated(a_df) out_name_irrigated = "JustIrr" else: out_name_irrigated = "IrrAndNonIrr"
elif filter_lastSurDate == False: print("4") last_part_name = "NassIn_NotCorrectYears" print(last_part_name) print("filter_NASS is " + str(filter_NASS)) print("filter_lastSurDate is " + str(filter_lastSurDate)) if (filter_NASS == True): a_df = rc.filter_by_lastSurvey(dt_df_surv=a_df, year=2018) print( "After filtering by last survey date, a_df is of dimension {fileShape}." .format(fileShape=a_df.shape)) if (filter_lastSurDate == True): a_df = rc.filter_out_NASS(dt_df_NASS=a_df) print("After filtering out NASS, a_df is of dimension {fileShape}.".format( fileShape=a_df.shape)) ###################### output_dir = data_dir + "/savitzky/Grant_Irrigated_EVI_2018_" + last_part_name + \ "/delta" + str(delt) + "_Sav_win" + str(Sav_win_size) + "_Order" + str(sav_order) + "/" plot_dir_base = output_dir print("plot_dir_base is " + plot_dir_base) os.makedirs(output_dir, exist_ok=True) os.makedirs(plot_dir_base, exist_ok=True) ###################### a_df['year'] = 2018
output['parameters'] = delta_windows_degrees #### #### Build shapeFile info accordingly #### curr_SF = WSDA_DataTable.copy() if double_by_Note == False: dbl_name = "_dblNotFiltered_" else: curr_SF = rc.filter_double_by_Notes( curr_SF) dbl_name = "_onlyDblByNotes_" if NASS_out == True: curr_SF = rc.filter_out_NASS(curr_SF) NASS_name = "NASSOut_" else: NASS_name = "NASSin_" if non_Irr_out == True: curr_SF = rc.filter_out_nonIrrigated( curr_SF) non_Irr_name = "JustIrr" else: non_Irr_name = "BothIrr" if perennials_out == True: print("line 165") print(curr_SF.shape) curr_SF = curr_SF[curr_SF.CropTyp.isin(