Skip to content

Slope of linear fit: Using xskillscore.linslope #358

@HARSHBARDHANK94

Description

@HARSHBARDHANK94
import glob
import numpy as np
import xarray as xr
import xskillscore as xs

# fetching files from foldersb and opening using mfdataset()............................................
filename1= glob.glob("E:\\ACI_data\\AOD\\*.nc")
data1=xr.open_mfdataset(filename1)

# Region of Interest Subsetting...........................................................
AOI1=data1.sel(lat=slice(-1,26.5), lon=slice(39.5,100.5))

# Variable selection from the dataset ................................................
AOD=AOI1.MYD08_M3_6_1_AOD_550_Dark_Target_Deep_Blue_Combined_Mean_Mean

image

The Dimension of the Variables are:
lat=28
lon=62
time=216
AOD=(216,28,62)

In xskillscore.linslope (), parameters requires two labeled array(s) (e.g., a and b) as detailed in documentation: https://xskillscore.readthedocs.io/en/stable/api/xskillscore.linslope.html

But I want to compute the linear slope against time in AOD. As my AOD variable has 216 month of time dimension, I want to compute linear fit between time and AOD, that should produce slope of trend. May be I getting the documentation wrong or something different.........................

slope=xs.linslope (AOD.chunk(dict(time=-1)),...............b................., dim='time')

What I should declare in the above line at position 'b'

Thanks for constructive comments!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions