ACAP 1.0 Cropping Calendar
Introduction
This section describes methods for uploading the cropping calendar for the older ACAP 1.0. Its last stable version is Release/Tag version v9.5.6 (opens in a new tab), accessible in the climate-services-webportal-v1 and acap-v2 code repositories.
Follow this link to view cropping calendar upload instructions for the latest ACAP 2.0.
Data Format
ACAP 1.0 uses a cropping calendar with only one (1) group of crop stages, supporting only one (1) type of crop (Rice). View its raw CSV data file in the /server/src/scripts/data/cropping_calendar_v2.csv
file for more information about its contents and data structure.
- cropping_calendar_v2.csv
Crop Stage Codes and Labels
The crop stage codes should match with the crop stage labels defined in the ACAP 1.0 crop recommendations raw Excel file to ensure the correct association of crop stages with target recommendations.
Crop Stage Code | Crop Stage Label |
---|---|
lprep | Preparation Stage |
plant/trans | Newly Planted |
veg/repro | Vegetative/Reproductive |
mat | Maturing |
Upload Crop Calendar Data
ACAP 1.0 uploads its cropping calendar data to the Firestore database using NPM scripts, accessible only to developers.
Prepare cropping calendar data
-
Prepare the necessary cropping calendar data for a region, following the format from the
/server/src/scripts/data/cropping_calendar_v2.csv
CSV file.💡Take note of the municipality names, which should sync with the PAGASA 10-day weather forecast naming conventions to ensure smooth data processing.
-
Put the CSV file in the
/server/src/scripts/uploaders/cropping_calendar
directory.
- cropping_calendar_v2.csv
Use a target environment
Open the server .env
file. Update the FIREBASE_SERVICE_ACC
and FIREBASE_PRIVATE_KEY
keys with the development or production key values.
Run the NPM Script
This script only works for ACAP 1.0, whose last stable version is v9.5.6. It has no backward compatibility for ACAP 2.0 and later versions and thus may fail to work as expected.
-
Navigate to the
/server
directory from a terminal. -
Run the command, replacing
cropping_calendar_v2.csv
with the filename of a cropping calendar CSV file placed in the directory specified in the Prepare cropping calendar data step:npm run upload:calendar --localfilename=cropping_calendar_v2.csv
-
Ensure running the script from step #3 is completed successfully.
Scripts
crop-calendar-generator
- External tool that generates random cropping calendar data for the municipalities of a selected region.
- Available at link (opens in a new tab)