diff --git a/README.md b/README.md index 409ef1a..5ad27d7 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,10 @@ -https://carra2.readthedocs.io/en/latest/ +# Copernicus Arctic Re-Analysis project v2 Python (carra2py). +Simple python package for downloading, reprojecting, masking and interpolating satellite albedo data in the arctic region for the Copernicus Arctic Re-Analysis project v2 (CARRA2). +The latest version includes albedo data from the Advanced Very High Respolution Radiometer (AVHRR) satellite borne instrument in the period 1982 - present[1]. +Documentation: https://carra2.readthedocs.io/en/latest/index.html -# Copernicus Arctic Re-Analysis project v2 Python (CARRA2PY). -Sentinel-3, MODIS and AVHRR inputs assimilated into a state of the art numerical weather prediction system (HARMONIE) -Advanced Very-High-Resolution Radiometer -# CARRA2 Input Module - -## class carra2.AVHRR(date): -### Parameter: date: str -the processed date, only in 'yyyymmdd' format - -### Methods: - -#### AVHRR.get_data(polar=None) - -Import the raw AVHRR data of the northern hempishere in native resolution of 5000 meters. - -#### Parameter: polar: bool, optional -      {if None or False the output will be in a EPSG:4326 projection, if True the output will be in a EPSG:3413 projection.} - -#### Returns:   raw_lon or raw_x: (m,n) array of floats: - -      Longitude coordinates (EPSG:4326) of raw data if polar == None or False, x cooordinates (EPSG:3413) of raw data if polar == True. -####       raw_lat or raw_y: (m,n) array of floats: - -      Latitiude coordinates (EPSG:4326) of raw data if polar == None or False, y cooordinate (EPSG:3413) of raw data if polar == True. - -####       raw_alb: (m,n) array of floats: - -      Raw albedo data in native 5000 meter resolution - - -#### AVHRR.proc(raw_data=None, area=None, res=2500) - -Reproject and Intepolate raw AVHRR data to ESPG:3413 and a better resolution. -The data is also masked to 9 possible search areas in the arctic region - -#### Parameter: raw_data: tuple -      if None, the data for the processing wil come from get_data(), else, the user has tp input the data wants processed. the tuple needs to include (x,y,albedo) in that order, x and y is the data coordinates in EPSG:3413 with shape (m,n). Albedo is the raw albedo data from AVHRR in shape (m,n) - -####       area: str, list of str -      - -####       res: int - - -#### Returns:   data: dict: - -      Longitude coordinates (EPSG:4326) of raw data if polar == None or False, x cooordinates (EPSG:3413) of raw data if polar == True. - - +## References +[1] Key, Jeffrey; Wang, Xuanji; Liu, Yinghui; and NOAA CDR Program (2019). NOAA Climate Data Record of AVHRR Polar Pathfinder Extended (APP-X), Version 2. NOAA National Centers for Environmental Information. doi:10.25921/AE96-0E57 diff --git a/docs/Introduction.rst b/docs/Introduction.rst index ced435b..5701034 100644 --- a/docs/Introduction.rst +++ b/docs/Introduction.rst @@ -3,13 +3,27 @@ Introduction ================ -Hey What up +carra2py is a simple python package for downloading, reprojecting and processing albedo data for CARRA2 in the arctic region. +For now it includes the Advanced Very High Resolution Radiometer (AVHRR) dataset from 1984-present. + Installation ================ -Please + +**Clone the repository:** + ``git clone git@github.com:RasmusBahbah/carra2py.git`` + +**Change into the top-level directory:** + ``cd carra2py`` + +**Create python environement:** + ``conda env create -f carra2py.yml`` + +**Activate python environement:** + ``conda activate carra2py`` + Dependencies ================ -Siiiiiii +Python 3.5 or up diff --git a/docs/carra2py methods.rst b/docs/carra2py methods.rst index b9243fc..ab3229e 100644 --- a/docs/carra2py methods.rst +++ b/docs/carra2py methods.rst @@ -8,20 +8,115 @@ Description of the carra2py modules and its methods. class carra2py.AVHRR(date): ================ +Parameter: date: str +---------------- + +the processed date, only in 'yyyymmdd' format + Methods: ---------------- AVHRR.get_data(polar=None) ~~~~~~~~~~~~~~~~ +Import the raw AVHRR data of the northern hempishere in native resolution of 5000 meters. + +**Parameter: polar: bool, optional:** + + if None or False the output will be in a EPSG:4326 projection, if True the output will be in a EPSG:3413 projection. + + +**Returns:  raw_lon or raw_x: (m,n) array of floats** + + Longitude coordinates (EPSG:4326) of raw data if polar == None or False, x cooordinates (EPSG:3413) of raw data if polar == True. + + **raw_lat or raw_y: (m,n) array of floats** +      + Latitiude coordinates (EPSG:4326) of raw data if polar == None or False, y cooordinate (EPSG:3413) of raw data if polar == True. + + **raw_alb: (m,n) array of floats** +      + Raw albedo data in native 5000 meter resolution + + AVHRR.proc(raw_data=None, area=None, res=2500) ~~~~~~~~~~~~~~~~ -AVHRR.export_to_tif(polar=None) +Reproject and Intepolate raw AVHRR data to ESPG:3413 and a better resolution. The data is also masked to 9 possible search areas in the arctic region + +**Parameter: raw_data: tuple** + + if None, the data for the processing wil come from get_data(), else, the user has tp input the data wants processed. the tuple needs to include (x,y,albedo) in that order, x and y is the data coordinates in EPSG:3413 with shape (m,n). Albedo is the raw albedo data from AVHRR in shape (m,n) + + **area: str, or list** + + if None, all areas in the arctic with glaciers are processed. Else, indicate which area or areas you want to process. + Areas included: [AlaskaYukon, Greenland, Iceland, NorthernArcticCanada, SoutherArcticCanada, Norway, SevernayaZemlya, NovayaZemlya, Svalbard] + + **res: int** + + The resoultion of the output, there are three options, 1000,2500 or 5000 all in meters, the default is set to 2500 meters. + +**Returns:  output: dict of floats** + + outputs a dictionary of the albedo at each area in the specifiec resolution in EPSG:3413 projection. + The dictionary strutcture: output[area] = {"x" : x_coordinates, "y" : y_coordinates, "albedo" : albedo} + +AVHRR.export_to_tif(output=None, path='default') ~~~~~~~~~~~~~~~~ +Export the processed data to tif files in ESPG:3413 + + +**Parameter: output: dict** + + If None, the exported processed data will come from AVHRR.proc(raw_data=None, area=None, res=2500) with the default inputs. Else, + input the processed data you want to export, the input needs to be a dictionary with this format: + output[area] = {"x" : x_coordinates, "y" : y_coordinates, "albedo" : albedo} + + **path: str** + + if "default", the data will be exported to /output/"yyyymmdd", Else, specify the output folder. + +**Returns:  None** -AVHRR.export_to_csv(polar=None) + The method will not return anything + +AVHRR.export_to_csv(output=None, path='default') ~~~~~~~~~~~~~~~~ -AVHRR.export_to_nc(polar=None) +Export the processed data to csv files in ESPG:3413, the format will be + + +**Parameter: output: dict** + + If None, the exported processed data will come from AVHRR.proc(raw_data=None, area=None, res=2500) with the default inputs. Else, + input the processed data you want to export, the input needs to be a dictionary with this format: + output[area] = {"x" : x_coordinates, "y" : y_coordinates, "albedo" : albedo} + + **path: str** + + if "default", the data will be exported to /output/"yyyymmdd", Else, specify the output folder. + +**Returns:  None** + + The method will not return anything + +AVHRR.export_to_nc(output=None, path='default') ~~~~~~~~~~~~~~~~ + +Export the processed data to netcdf4 files in ESPG:3413, the format will be + + +**Parameter: output: dict** + + If None, the exported processed data will come from AVHRR.proc(raw_data=None, area=None, res=2500) with the default inputs. Else, + input the processed data you want to export, the input needs to be a dictionary with this format: + output[area] = {"x" : x_coordinates, "y" : y_coordinates, "albedo" : albedo} + + **path: str** + + if "default", the data will be exported to /output/"yyyymmdd", Else, specify the output folder. + +**Returns:  None** + + The method will not return anything