Releases: ideas-lab-nus/epwshiftr
v0.1.4
epwshiftr v0.1.4
Major changes
-
match_coord()
has been refactored to correct the calculation method of geographical distance. Previously, epwshiftr assumes that distance on longitude and latitude is the same which is not true. Now it uses a spheroid formula to calculate the tunnel distance (#39). For details, please see Tunnel Distance . The structure of the returnedepw_cmip6_coord
object has also changed. Thecoord
column in thecoord
data.table
is also adata.table
which contains 6 columns describing the matched coordinates:index
: the indices of matched coordinatesind_lon
,ind_lat
: The value indices of longitude or latitude in the NetCDF coordinate grids. These values are used to extract the corresponding variable valueslon
,lat
: the actual longitude or latitude in the NetCDF coordinate gridsdist
: the distance in km between the coordinate values in NetCDF and input EPW
Besides, the usage of the input
threshold
andmax_num
has been changed a little bit:threshold
: Due to the change in distance calculation, the meaning of thethreshold
input has been changed. Instead of directly being used to get the 'closest' grid points in NetCDF, the longitude and latitude threshold is only used to help exclude grid points that are definitely too far away from the target location. The default threshold, which is 1 degree for both longitude and latitude, is still reasonable for common use cases and is kept unchanged. Alsothreshold
now can be set toNULL
. In this case, the distances between the target location and all grid points will be calculated. But this may be only useful for rare cases.max_num
: Now the valuemax_num
is the key input to control how many grid points are to be matched. The points will always be ordered in descending order in terms of the distances.
-
The
data
in the returned value ofextract_data()
has been updated to include a new columndist
which gives the spherical distance in km between EPW location and grid coordinates (#39). -
The document on the return value structure for
extract_data()
andmorphing_epw()
has been fixed (#29). And the column order for all metadata in the returneddata.table
fromextract_data()
andmorphing_epw()
are not consistent. The columns will always be in the order below (#45):activity_drs
institution_id
source_id
experiment_id
member_id
table_id
lon
lat
dist
New features
- A new parameter
full
is added tofuture_epw()
. When setting toTRUE
, adata.table
containing information about how the data are split by theby
argument and also the generated future EPWs and their paths are returned (#18). - Now
summary_database()
can append results to the previous scan and detect if any previously matched NetCDF files do not exist. It stores the metadata of those missing files as a new attributenot_found
in the results. Warnings are issued ifwarning
is set toTRUE
. Also, a new parametermiss
has been added to control how to manage those invalid entries. You can set it to"keep"
, which is the default, to do nothing about it or"overwrite"
to overwrite those entries based on the newly matched NetCDF files if possible (#40). extract_data()
now supports non-standard calendar, e.g.360_day
(#32).- A new parameter
warning
has been added inmorphing_epw()
. If set toTRUE
, warnings will be issued for cases with input data less than a decade (10 years) . This is because using data that only covers a short period of time may not be able to capture the average of future climate (#41). - Now epwshiftr is able to download, parse and store CMIP6 Controlled Vocabularies (CVs) and Data Request data using the newly introduced class
Cmip6Dict
. Please see?Cmip6Dict
for details (#53). - A new option
epwshiftr.threshold_alpha
has been added to set the threshold of the absolute value for alpha, i.e. monthly-mean fractional change when performing morphing operations. The default value is set to3
. If the morphing methods are set"stretch"
or"combined"
, and the absolute alpha exceeds the threshold value, warnings are issued and the morphing method is fallbacked to"shift"
to avoid unrealistic morphed values (#54). - Now HDF5 format is supported (#60).
- Now
replica
can beNULL
inesgf_query()
andinit_cmip6_index()
. In this case, both the master record and replicas are all returned (#61). - New class
EsgfQuery
is added to support more flexible APIs for ESGF search services. Please see?EsgfQuery
for details (#63, #69).
Bug fixes
- Fix the error in
summary_database()
when no NetCDF files are found in the input directory (#25). - Fix the error about overwriting temporary EPW file when
epw
inmatch_coord()
is a search string (#25). - Now
morphing_epw()
can correctly fall back to use "Shift" method when any missing values are detected in maximum and minimum prediction values of climate variables (#25). - Fix the wrong warning messages when
combined
method is used inmorphing_epw()
(#25). - Now
get_data_node()
works again (#80)
Internal refactor
epwshiftr v0.1.3
- Remove
LazyData
inDESCRIPTION
(#16)
epwshiftr v0.1.2
epwshiftr v0.1.1
epwshiftr v0.1.0
The initial CRAN version