Skip to content

Commit

Permalink
in complete data filter the file issue.csv and we won't process it. a…
Browse files Browse the repository at this point in the history
…lso include a log in prediccionClimatica folder to check what is on going
  • Loading branch information
stevensotelo committed Sep 13, 2023
1 parent 7f86937 commit 576b1cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ src/unittests.py
/cdsapirc
/.cdsapirc


# TEST FILES

data/local
test/test_files
/test/complete_local_test.py
test/complete_local_test.py

data/chirp.2023.06.01.tif
data/Temperature-Air-2m-Max-24h_C3S-glob-agric_AgERA5_20230601_final-v1.0.tif
Expand Down
14 changes: 7 additions & 7 deletions src/aclimate_resampling/complete_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,8 @@ def extract_values(self,dir_path,var,locations, date_start,date_end,date_format)
def filter_extract_data(self, data_frame):
current_year = self.start_date.year
current_month = self.start_date.month

filter_data_frame = data_frame.loc[
(data_frame["year"] <= current_year) & (data_frame["month"] <= current_month),
:]

filter_data_frame = data_frame.loc[(data_frame["year"] <= current_year) & (data_frame["month"] <= current_month),:]
return filter_data_frame


Expand Down Expand Up @@ -466,8 +464,10 @@ def run(self):

print("Listing stations")
df_ws = self.list_ws()
df_ws_full = df_ws[df_ws['message'].isna()]
df_ws_nan = df_ws[~df_ws['message'].isna()]
df_ws_full = df_ws.loc[df_ws['message'] == "",:]
df_ws_nan = df_ws.loc[df_ws['message'] != "",:]
df_ws_full.to_csv(os.path.join(self.path_country_outputs_forecast,"resampling_complete_data_stations_coord.csv"),index=False)
df_ws_nan.to_csv(os.path.join(self.path_country_outputs_forecast,"resampling_complete_data_stations_without_coord.csv"),index=False)
print("Listed stations")
print("Adding data started!")
pool = mp.Pool(processes=self.cores)
Expand All @@ -477,5 +477,5 @@ def run(self):
process.get()
print("Added data!")

df_ws_nan.to_csv(os.path.join(self.path_country_outputs_forecast,"stations_without_coord.csv"),index=False)

print("Process finished")

0 comments on commit 576b1cf

Please sign in to comment.